pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.08k stars 298 forks source link

SEVIRI/FCI Water Vapour channel different normalization? #2920

Closed guidocioni closed 1 month ago

guidocioni commented 1 month ago

I was trying to plot the water vapour channel (6.2) of SEVIRI in the hope of reproducing what I'm seeing on Eumetview

Eumetsat_View_2024-10-06T0030

However I'm getting an image which has quite a different histogram normalization

synoptic_North-Atlantic_20241006_003000

Is this expected? I tried with FCI and I get a similar result (albeit higher resolution, as expected).

synoptic_North-Atlantic_20241006_003000

I'm just loading the data like this

channel='WV_062'
scn = satpy.Scene({
                        "filenames": {"seviri_l1b_native": files},
                        "reader_kwargs": {"fill_disk": True},
                    })
scn.load([channel], upper_right_corner='NE')
scn = scn.crop(ll_bbox=tuple(cust_area))
image = satpy.writers.get_enhanced_image(scn[channel]).data
image[0].plot.imshow(vmin=0, vmax=1,
                                 cmap='Greys_r',
                                 add_colorbar=False,
          )
pnuu commented 1 month ago

This is expected.

Satpy does not have any static enhancement for "plain" brightness temparature channel data, and it determines the limits based on the data it self. If I remember correctly, the data are stretched linearly between 5 % and 95 % values within the area of the image. So if you change the area to cover less/more, the look of the image will also change.

guidocioni commented 1 month ago

This is expected.

Satpy does not have any static enhancement for "plain" brightness temparature channel data, and it determines the limits based on the data it self. If I remember correctly, the data are stretched linearly between 5 % and 95 % values within the area of the image. So if you change the area to cover less/more, the look of the image will also change.

However this is not brightness temperature calibrated data, but rather radiance calibrated. Anyway I realized the problem is something else: when using water vapour the colormap is inverted, so by using cmap='Greys' I get the correct image.

synoptic_North-Atlantic_20241006_003000

of course this won't be the same as in eumetview because, as you said, the limits are based on the cropped area.

pnuu commented 1 month ago

If the calibration radiance is not defined, Satpy will default to brightness_temperature for all IR data. But that actually doesn't matter, because only the reflectance data have a static built-in stretch giving consistent images. Tb and radiances don't have a such "universal" limits that could be used in most visualisations.

Oh, and I didn't even notice the inverted scale in the images :see_no_evil:

guidocioni commented 1 month ago

If the calibration radiance is not defined, Satpy will default to brightness_temperature for all IR data.

You're right, I forgot I even added this comment line in my code :-)

# No calibration, we let satpy decides what is best
scn.load([channel], upper_right_corner='NE')

But that actually doesn't matter, because only the reflectance data have a static built-in stretch giving consistent images. Tb and radiances don't have a such "universal" limits that could be used in most visualisations.

That may explain why when I export the frames for my animation all images look the same

Oh, and I didn't even notice the inverted scale in the images 🙈

Yeah that was the problem.

As a feat, have a look at the final animation ;)

https://github.com/user-attachments/assets/cb11b484-79f9-439f-8726-766a65270c50