pytroll / satpy

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

Tiny difference in SEVIRI HRIT area extents #2706

Open sfinkens opened 6 months ago

sfinkens commented 6 months ago

Describe the bug

In some very rare cases, the area extent of a SEVIRI HRIT scene is a tiny bit different from the majority of scenes.

Majority, areas.yaml (5567248.28340708, 5570248.686685662, -5570248.686685662, -5567248.28340708)
2021-11-08 12:00     (5567248.28340708, 5570248.686685663, -5570248.686685662, -5567248.28340708)
                                                        ^

As a consequence, the x/y coordinates are also slightly different. When concatenating many scenes along the time dimension, xarray doubles the dimension and insert NaNs because the grids don't align.

A workaround is to use for example xr.concat(..., join="override") but I'm still curious why this happens. Maybe it can be fixed.

To Reproduce

import satpy
import glob

filenames = glob.glob("H-000-MSG1__-MSG1_IODC*202111081200*")
scene = satpy.Scene(filenames, reader="seviri_l1b_hrit")
scene.load(["IR_108"])
print(scene["IR_108"].attrs["area"].area_extent)

Environment Info:

djhoese commented 6 months ago

Related: https://github.com/pytroll/satpy/pull/2573

mraspaud commented 5 months ago

@ameraner any comments on this?

ameraner commented 5 months ago

Hmm this is a little odd, I'd also be curious to know where it comes from... looks like a floating point precision issue, even though the input parameters should be always the same. I requested that slot from the archive, I'll try to take a look when I find a moment