ISSUE: Can't read data from grb file - #24
Conversation
# Conflicts: # tests/NGrib.Tests/GribFileSamples.cs # tests/NGrib.Tests/NGrib.Tests.csproj
Allows for reading of parameter type 48
|
@nmangue, sorry for the direct mention. I'm kindly asking when a proper release with the spatial decoding fix is planned or estimated. We are waiting for an official release that includes the fix to upgrade our applications that use the library. Thanks! |
|
v0.12.0 that was released last december should fix this issue. Do you still encounter this error ? |
@nmangue The fixed version worked in our tests, but as far as I can see 0.12.0 is not yet an official release, the latest reported in the "Release" section is 0.11.0 in May 2024. |
|
My bad, I have published the v0.12.0 on NuGet (https://www.nuget.org/packages/NGrib/0.12.0) but I did not update the Github project accordingly. This is now fixed. |
|
@nmangue got it thank you very much. I hadn't thought of checking Nuget directly. |
…-178-AddPeakWavePeriod-ECMWF # Conflicts: # tests/NGrib.Tests/GribFileSamples.cs
BG-178-AddPeakWavePeriod-ECMWF
NCORE-4937 - Read ECMWF SetI_HRES
…5,3)
NGrib's parameter table only carried downward long-wave radiation as the NCEP-local
variant (category 5, number 192). ECCC MSC HRDPS - and the WMO standard - encode it as
category 5, number 3 ("Surface long-wave (thermal) radiation downwards"), which was
absent, so that record resolved to no parameter and consumers dropped it. Adds the WMO
entry (mirroring the existing category-4 number-7 short-wave downwards entry).
Tests: a direct Parameter.Get(0,5,3) lookup, and reading a real HRDPS DLWRF grib sample
(Jpeg2000 accumulation) asserting the parameter resolves and the decoded field matches an
independent OpenJPEG decode (min 522543.5 = referenceValue*100, max 1724543.5 J m-2).
Bumps the package version to 0.13.4.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A field encoded with complex packing + spatial differencing but zero groups (NumberOfGroups == 0, e.g. a constant all-reference-value field such as an all-zero sea-ice-fraction field) was decoded as garbage: the group-decoding loop never writes the secondary-value buffer, which comes from ArrayPool.Rent and holds stale data, and that garbage then flows through the spatial-differencing reconstruction into the output. Zero the secondary-value buffer after renting so an unwritten (zero-group) field decodes to the reference value, matching eccodes (which returns all zeros for this field). Also corrects two pre-existing assertions in Grib2Reader_EastChinaJapan_Test that this exposes: the Ice test compared KeyValuePair elements against 0 (never valid) - it now asserts every decoded value is 0; and the U10 test's expected average was wrong (-0.0677 -> -0.6774, confirmed with eccodes; min/max already matched). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nwards Add WMO long-wave-downwards parameter (0,5,3) + fix zero-group constant-field decode
See #25 for discription