satpy icon indicating copy to clipboard operation
satpy copied to clipboard

Add default enhancement for brightness temperature and possibly other common names

Open gerritholl opened this issue 7 months ago • 4 comments

Feature Request

Is your feature request related to a problem? Please describe.

Satpy does not have a default enhancement defined for brightness temperatures. Showing single-channel imagery will have clouds showing as black. Moreover, if #3237 is implemented, the following code will show a warning:

import hdf5plugin
from satpy import Scene
from glob import glob
fci_files = glob("/media/nas/x23352/MTG/FCI/L1c-cases/202309_10-cwg/10/01/08/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-*-FD--CHK-BODY---NC4E_C_EUMT_20231001*_IDPFI_VAL_20231001*_20231001*_N__C_0054_*.nc")
sc = Scene(filenames={"fci_l1c_nc": fci_files})
sc.load([10.5])
sc.show(10.5)

Today, it does not show a warning, but it does produce dark clouds:

Image

Describe the solution you'd like

I would like a default enhancement for infrared channels.

We could also consider default enhancements for other common standard names, such as cloud_binary_mask and cloud_type, or commonly used names that are not CF standard names, such as cloud_top_height (the list of WMO OSCAR variables has many more entries than there are standard names).

Describe any changes to existing user workflow

This will break backward compatibility for any users who are directly displaying infrared channels, without enhancements defined.

Additional context

This idea is not new; it is mentioned in #2873, but I could not find an issue. It was triggered by thinking about the implications of #3237. We could also have a default enhancement that applies the same stretching as today, retaining dark clouds and backward compatibility.

gerritholl avatar Sep 18 '25 08:09 gerritholl

Thanks for filing this. And yes, I think SMHI developers were some of the only people who preferred the black clouds scaling and since it was already the default then we didn't change it. I've added this issue to the Satpy 1.0 milestone to make sure we don't forget it even though it is also mentioned in #2873. I would prefer some basic default with white clouds. In my Polar2Grid project I do:

enhancements:
  brightness_temperature_default:
    standard_name: toa_brightness_temperature
    operations:
    - name: btemp_threshold
      method: !!python/name:satpy.enhancements.contrast.btemp_threshold
      kwargs:
        threshold: 242.0
        min_in: 163.0
        max_in: 330.0

djhoese avatar Sep 18 '25 14:09 djhoese

Default ranges applicable for all channels are difficult, so we could still have dynamic stretching like today, just inverted.

gerritholl avatar Nov 10 '25 12:11 gerritholl

I would suggest that this is not applied some the mid-IR channels where there may be a strong fire signature (hot pixels). An inverse scaling would render the fires dark, which is probably not desired from a user perspective!

For the long wave IR this would be much less of a problem.

simonrp84 avatar Nov 10 '25 14:11 simonrp84

@simonrp84 I think if people care then they should have a specific enhancement for those bands. This issue is for the default and should cover most cases. Having defaults for each mid-IR channel that is used for fire detection seems like something that would want to be customized with specific ranges anyway.

djhoese avatar Nov 10 '25 15:11 djhoese