Closed ghaarsma closed 10 months ago
I checked the downloaded files: ds.wwa.bin ds.wspd.bin ds.wdir.bin ds.wgust.bin ds.waveh.bin
and all use WMO encodings for their parameters except for ds.wwa.bin which uses a LOCAL encoding i.e., discipline=0 parameterCategory=19 parameterNumber=217
and this is not recognised by ecCodes and therefore the shortName key has the "unknown" value
Thank you @shahramn, for your troubleshooting so far.
Yes, I agree that the wwa.bin file has an "unknown" data variable (as seen in the logs). However, In cfgrib 0.9.10.1 all 5 files properly extract the 2-dim Data array. All cfgrib later versions (0.9.10.2, 0.9.10.3, & 0.9.10.4) fail to extract the data array for all five files.
I have done a little bit of debugging and it seems that for all 5 NWS NOAA files, inside dataset.py
line 316: the code section message.get("alternativeRowScanning", False)
returns 1 (True), which results in the crash on line 318.
Hope this helps
Hi @ghaarsma,
I believe I've fixed the issue (thanks for the report, it was a particular case that we had not previously encountered - alternativeRowScanning in a Mercator grid). Are you able to test my branch locally, or do you need a new release of cfgrib?
Cheers, Iain
Hi @iainrussell,
I can confirm that the branch fix/alternate-scanning-mercator
fixes the problem after some local testing. Thank you for the quick fix. Looking forward to a new release of cfgrib, so we can roll it into production.
What happened?
When downloading, opening [
open_file
] and getting the data values from NWS NOAA grib files, all works perfect under cfgrib 0.9.10.1. Any newer cfgrib version, the file still opens, but getting a numpy array from the OnDiskArray fails in the newly (0.9.10.2) added functionget_values_in_order
.What are the steps to reproduce the bug?
Version
0.9.10.2, 0.9.10.3, & 0.9.10.4
Platform (OS and architecture)
Python: 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
Relevant log output
Accompanying data
https://tgftp.nws.noaa.gov/SL.us008001/ST.opnl/DF.gr2/DC.ndfd/AR.oceanic/VP.001-003/ds.waveh.bin
Organisation
No response