nmangue / NGrib

NGrib is a .NET library to read GRIB (GRid in Binary) files. GRIB is a gridded data standard from WMO (World Meteorological Organisation) and is used by many meteorological organisation. Fork of GribCS.
GNU Lesser General Public License v3.0
17 stars 10 forks source link

Issue reading data from a specific provider #25

Open da-br opened 1 month ago

da-br commented 1 month ago

Hello,

Sorry for the lack of information here, but I am quite stumped.

I have a grb2 file that is failing to read some datasets. I have created a PR here, which has two failing tests demonstrating the error.

The two tests crash at different points.

Panoply can open these variables, so I don't believe the problem is in the data file.

Thanks :)

nmangue commented 1 month ago

Hello,

Well, you're in luck ! (Or sort of ^^) The error occurs in the grid point data decoding, which uses the Complex packing and spatial differencing data representation (template 5.3).

23 is also an issue on this format. As a fix, I just completely rewrote the unpack function. This seems to also fix your file decoding. I have quickly ran your unit tests and it seems ok. The only mismatch I get is on the average value check. I get a value of -0.67744476 instead of ~-0.0677. Could it be a typo ?

It would be great if you could you rerun your test using branch fix/issue-23.

da-br commented 1 month ago

Thanks so much!

I've rerun the tests and am happy with the result, the extra 0 must have been a typo.

da-br commented 1 month ago

Is there an update on getting #23 merged?