You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening a GRIB file AUX_ECMWFT provided as part of a Sentinel-2 granule with xarray and engine "cfgrib" returns a dataset. The AUX_ECMWF is a subset of 9x9 points in geographic projection just covering the Sentinel-2 image data which is in UTM.
If the granule overlaps the ante-meridian then the coordinates returned in the dataset look strange. Longitude seem to be somehow rotated by one pixel, while the geophysical data is not.
What are the steps to reproduce the bug?
#The example input S2B_MSIL1C_20240103T221939_N0510_R029_T01KAB_20240103T232410.SAFE can be downloaded from CDSE.
What happened?
Opening a GRIB file AUX_ECMWFT provided as part of a Sentinel-2 granule with xarray and engine "cfgrib" returns a dataset. The AUX_ECMWF is a subset of 9x9 points in geographic projection just covering the Sentinel-2 image data which is in UTM.
If the granule overlaps the ante-meridian then the coordinates returned in the dataset look strange. Longitude seem to be somehow rotated by one pixel, while the geophysical data is not.
What are the steps to reproduce the bug?
#The example input S2B_MSIL1C_20240103T221939_N0510_R029_T01KAB_20240103T232410.SAFE can be downloaded from CDSE.
import xarray as xr
ds1 = xr.open_dataset("/windows/tmp/sen2water/S2B_MSIL1C_20240103T221939_N0510_R029_T01KAB_20240103T232410.SAFE/GRANULE/L1C_T01KAB_A035662_20240103T221938/AUX_DATA/AUX_ECMWFT", engine="cfgrib")
ds2 = xr.open_dataset("/windows/tmp/sen2water/S2B_MSIL1C_20240103T221939_N0510_R029_T01KAB_20240103T232410.SAFE/GRANULE/L1C_T01KAB_A035662_20240103T221938/AUX_DATA/AUX_ECMWFT", engine="rasterio")
rotated lon with cfgrib, lon in sequence with rasterio
ds1.longitude.values
ds2.x.values
same data values, not rotated, with both engines
ds1.tcwv.values[0]
ds2.band_data[0].values[0]
#Python 3.11.5, xarray 2024.9.0, cfgrib 0.9.13.0
Version
0.9.13.0, reproduced in 0.9.14.1
Platform (OS and architecture)
Linux vm1 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Relevant log output
Accompanying data
CDSE does not provide links to data items,
Organisation
Brockmann Consult GmbH
The text was updated successfully, but these errors were encountered: