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

iris.load() fails on single time value .grib2 files with KeyError: 'numberOfTimeRange not defined in section 4' #553

Open
hydroscopex opened this issue Oct 12, 2024 · 2 comments

Comments

@hydroscopex
Copy link

I've stumbled upon an issue when trying to import .grib2 files that only contain a single time value, when trying to re-run a piece of code I had written a while back (probably with iris-grib 0.17.0 or earlier) but which used to run at the time.

I'm currently running:

  • iris 3.10.0
  • iris-grib 0.20.0
  • eccodes 2.38.0
  • python 3.12.7

The files i'm trying to load into iris are the output of weather model runs for a single time, such as those that can be found at : https://mf-models-on-aws.org/#arome-france-hd/v1/

See for instance : https://mf-models-on-aws.org/#arome-france-hd/v1/2024-10-12/00/SP1/00H.grib2 (this link will die in a month's time but any similar grib should raise the same error).

When I attempt to load the files in iris with this configuration I get the error :

KeyError: 'numberOfTimeRange not defined in section 4'

with the stack trace included in the attached file stack_trace_KeyError-numberOfTimeRange.txt

I'm not sure where this error might come from, but I'm wondering if it has anything to do with #498 ?

PS : I'm very thankful for this library which simplifys my work a lot !
PS2 : I'm not very well versed in grib files but if anyone can put me on the right path I'd be happy to help solve this issue.

@pp-mo
Copy link
Member

pp-mo commented Oct 14, 2024

Unfortunately I think this is due to a recent breaking change in eccodes, which we are aware of + working on.
See this
I think if you can wind back to eccodes version 2.37 it will fix it. In the meantime, we are working on a fix.

@hydroscopex
Copy link
Author

Yes reverting to eccodes 2.37.0 fixes the issue. Thx! Good luck with the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants