Closed rabernat closed 9 months ago
The Product Definition Section (section 4) is badly encoded. It has the key "n" set to zero This key is at octet 42 and its description is (according to WMO):
"number of time range specifications describing the time intervals used to calculate the statistically processed field"
This has to be at least 1
If you try to decode this with "wgrib2", it also fails:
% wgrib2 tmp.grib
pdt_len: bad stat_proc ranges = 0 set to to 1
** ERROR bad grib message: Statistical Processing bad n=0 **
1:0:d=2022041400:PRATE:surface::
*** FATAL ERROR (delayed): forecast time for tmp.grib
And Panoply also complains: Cannot invoke ucar.nc2.CalendarPeriod.millisecs() because "from" is null
It cannot even load the message
Thanks for your reply. I will try to understand why WRF is producing this invalid message.
What happened?
I encountered the grib message attached to this issue in a WRF dataset. Parsing this message with cfgrib fails when attempting to access the
step
field. The error occurs because the messageendStep
field evaluates to the stringunavailable
. This in turn triggers an error in Kerchunk here.This seems somewhat similar to #335.
What are the steps to reproduce the bug?
tmp.grib.zip
this produces the following stack trace
Digging deeper, this it because
m['endStep']
evaluates to the stringunavailable
rather than an int, as expected by cfgrib.Version
0.9.10.4
Platform (OS and architecture)
x86_64 GNU/Linux
Relevant log output
No response
Accompanying data
Attached above
Organisation
Earthmover PBC