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

Reading Grib1 datasets by name #8

Closed da-br closed 1 year ago

da-br commented 1 year ago

Hello,

I would like to use this library to read grib1 files.

The following image is the sample file marine-lion_corse.grb opened in Panoply

image

Reading it in NGrib only shows undefined parameter names.

image

I am looking to do something like:

var allRecords = _gribReader.ReadRecords();
var record = allRecords.First(r => r.ProductDefinitionSection.Parameter.Name == "wantedDataSetName");
var data = _gribReader.ReadRecordRawData(record);

Is this currently possible?

Specifications

da-br commented 1 year ago

Okay, I just read the ecmwf grib1 format spec and I can answer my own question 😄

By using code tables I can map the parameter number to the name. But I more than likely won't even bother and just use the parameter number as a lookup

Thanks