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

Grib2 reader issue for data using second order packing and a bitmap section #1305

Open
1 task done
team-metoc opened this issue Feb 15, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@team-metoc
Copy link

Versions impacted by the bug

All versions up to and including netcdf-java-5.5.3

What went wrong?

Our team is currently preparing to read Grib2 files featuring oceanographic data encoded with ECMWF's second order packing.
However it seems that, while the second order packing type is fully supported by netCDF-Java, the library's read process does not take into account the presence of a bitmap section.
Reading the source code, we think this is because Grib2DataReader.getData50002 method doesn't use the bitmap array (*) (while other packing types like 40 - JPEG2000 do and work perfectly on oceanographic data).
For this reason, we think any attempt to read a Grib2 file featuring oceanographic data encoded using second order packing and a bitmap section will either fail or produce a random array of points.

(*) To be more precise, at the end of the method, the loop converting the data to the return array should be using the GribNumbers.testIsBitSet method (like in Grib2DataReader.getData40 for example)

Thank you for your help.

Relevant stack trace

No response

Relevant log messages

No response

If you have an example file that you can share, please attach it to this issue.

If so, may we include it in our test datasets to help ensure the bug does not return once fixed?
Note: the test datasets are publicly accessible without restriction.

No

Code of Conduct

  • I agree to follow the UCAR/Unidata Code of Conduct
@team-metoc team-metoc added the bug Something isn't working label Feb 15, 2024
@haileyajohnson haileyajohnson added the help wanted Extra attention is needed label Feb 15, 2024
@haileyajohnson
Copy link
Member

Thanks for opening an issue! Unfortunately, the netcdf-java maintainers are not necessarily experts in all the data formats that we support, as much as we would like to be. I'm not sure that we will be able to look at this issue unless you're able to provide a test file and an example of a failure?

I have also added the help-wanted tag to indicate we'd love the larger community to take a look.

@team-metoc
Copy link
Author

Thank you for your answer.
We are providing a sample grib and a screenshot of the problem from toolsUI :
grib2-read-error
sea_surface_temperature.zip

The data is sea surface temperature, so we should be seeing colored points only at sea.

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants