Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect writing of regular Gaussian grids as GRIB #330

Closed
iainrussell opened this issue Feb 23, 2023 · 0 comments
Closed

Incorrect writing of regular Gaussian grids as GRIB #330

iainrussell opened this issue Feb 23, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@iainrussell
Copy link
Member

This was exposed when using ecCodes 2.28.0, which has stricter checking of a GRIB file's geography.

------------------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------------------
ECCODES ERROR   :  Failed to find index for latitude=87.864
ECCODES ERROR   :  Geoiterator factory: Error instantiating iterator gaussian (Problem with calculation of geographic attributes)
ECCODES ERROR   :  latitudes: Unable to create iterator
------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------
WARNING  cfgrib.messages:messages.py:555 Ignoring index file '/perm/cgi/dev/git/mpy/cfgrib/tests/sample-data/regular_gg_pl.grib.923a8.idx' incompatible with GRIB file
============================================================================ short test summary info =============================================================================
FAILED test_50_sample_data.py::test_canonical_dataset_to_grib[regular_gg_sfc] - gribapi.errors.GeocalculusError: Problem with calculation of geographic attributes
FAILED test_50_sample_data.py::test_canonical_dataset_to_grib[regular_gg_pl] - gribapi.errors.GeocalculusError: Problem with calculation of geographic attributes
======================================================= 2 failed, 30 passed, 84 deselected, 3 xfailed, 2 xpassed in 4.99s ========================================================

The reason behind the failure is that cfgrib is not storing and therefore not writing the first and last latitude coordinates when dealing with regular Gaussian grids. Therefore, the written GRIB file contains these values as they are set in the template, rather than as they are set in the original data.

@iainrussell iainrussell self-assigned this Feb 23, 2023
@iainrussell iainrussell added the bug Something isn't working label Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant