NOAA-EMC / NCEPLIBS-g2c

This library contains C decoder/encoder routines for GRIB edition 2.
Other
18 stars 11 forks source link

Add g2c_open_index() which opens a GRIB2 file using an index file for metadata #356

Closed edwardhartnett closed 1 year ago

edwardhartnett commented 1 year ago

Part of #333

In this PR I introduce the capability of opening a GRIB2 data file using a pre-existing index file. The file metadata is read from the index file, instead of scanned from the actual GRIB2 file, and this is quicker.

At this time no checking is done to confirm that the correct index file was supplied with the data file. If an incorrect index file is used, unintended hilarity or disaster may result. Since the g2c API is read-only so far, no harm can be done.

edwardhartnett commented 1 year ago

OK, this is ready for review and merge, but it will be a lot simpler to review after all the other open PRs get merged, since they are all part of this PR too. ;-)