GRIB helper routines

IDL’s GRIB routines are a thin layer on top of the the C version of the ECMWF GRIB API.  The ECMWF routines exposed in IDL are fairly low-level, so they require a bit of programming to extract even simple information from a GRIB file.

I have three routines, built on IDL’s GRIB API, to help make it easier to get information from a GRIB edition 1 or 2 file:

  • GRIB_GET_RECORD: Gets a single record, selected by a one-based index, from a GRIB file.
  • GRIB_GET_PARAMETERNAMES: Gets the value of the parameterName key from each record in a GRIB file.
  • GRIB_GET_PARAMETER: Uses the two routines above to extract all the records in a GRIB file with a given parameterName.

You can download all three routines from the VIS Code Library. The routines can be called from the IDL command line or used as library routines in programs. See the IDLdoc documentation for these routines for examples of how to call them.

I’ve tested these routines on a variety of GRIB1 and GRIB2 files from ECMWF, NCEP, NCAR, NOAA and AFWA. Hopefully, they’ll work with any GRIB file, but if they don’t, please let me know.

About Mark

I solve scientific programming and visualization problems with IDL.
This entry was posted in data access, programming and tagged , , . Bookmark the permalink.

2 Responses to GRIB helper routines

  1. Pingback: michaelgalloy.com — The IDL Data Point

  2. Pingback: An example of using the GRIB helper routines | The IDL Data Point

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s