NOAA-MDL / grib2io

Python interface to the NCEP G2C Library for reading and writing GRIB2 messages.
https://noaa-mdl.github.io/grib2io
MIT License
30 stars 11 forks source link

A mechanism to what attributes in sections 3, 4, and 5 are mutable and which ones are required. #75

Open Marston opened 1 year ago

Marston commented 1 year ago

It would be beneficial to the community if there was a mechanism to inform a user as to what attributes are required to be populated. Sections 0 and 1 are easy because they are static, but 3, 4, and 5 are dynamic according to their template numbers. And even with section 5, some of the metadata, should not be edited by the user.

Let me think about an added feature re: this.

Originally posted by @EricEngle-NOAA in https://github.com/NOAA-MDL/grib2io/discussions/66#discussioncomment-5652839

EricEngle-NOAA commented 1 year ago

Saw your comment on the NCEPLIBS-ip CMAKE issue related to this one. This is a work in progress...and thinking out loud here...

Incorrect metadata for sections 3 and 5 would cause the most problems in terms of mapping/plotting and unpacking/packing data values, and with interpolation. Section 4 is product definition info, which could cause problems, but mainly just in terms what the data are.

Marston commented 1 year ago

@EricEngle-NOAA

I'm just using another model dataset, i.e. globally gridded data expressed on 0:360 longitude and the levels, when encoding 3D data is set a integers. I like your notebook that you created and I think an example where encoding a 3D array from scratch, not a copy from 1 grib file to another, is demoed would be a great gesture to the grib2io community :-)

Marston commented 1 year ago

@EricEngle-NOAA
We are still looking to leverage grib2io to write gribs in our system so there is still interest in your work.