You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

ecCodes provides high-level access to the information in a GRIB message through a set of edition independent keys. The advantage in writing code using only those keys is that the resulting application is edition independent and can therefore process GRIB edition 1 or 2 transparently.

Some of the edition independent keys are grouped in namespaces for convenience (think of a namespace as a fancy word for a grouping of related keys).

The values of the keys in a namespace can be obtained from the GRIB just using the "codes_get" instruction with the key name or with the key name prefixed by the namespace name. For example the following are equivalent:
  shortName
  parameter.shortName

The same is valid for the "codes_set" instruction.

All the values of the keys belonging to a namespace can be printed with the -n option of grib_ls or with the keys iterator provided by the library.

The corresponding namespaces of two GRIB messages can be compared with grib_compare which is able to detect the keys of the enquired namespace having different values in the two messages

The following namespaces are available:

  • ls: This is the namespace used by the grib_ls and bufr_ls tools and has the most commonly used keys e.g. center, shortName, level, etc
  • parameter: Contains keys like paramId, shortName, units which relate to the meteorological parameter
  • statistics: Contains keys that relate to the statistics of the data values e.g. maximum, minimum, average, standard deviation, etc
  • time: Contains keys that describe the forecast runs e.g. forecast date, validity date, steps, etc
  • geography: Contains keys that describe the grid geometry e.g. bounding box of the grid, number of points along with a parallel, etc
  • vertical: Contains keys that describe the levels and layers e.g. type of the level, list of coefficients of the vertical coordinate, etc
  • mars: Contains the list of MARS (ECMWF's Meteorological Archive and Retrieval System) keywords like class, stream, type, etc

The contents of a namespace can vary depending on the type of GRIB message, for example the geography namespace will contain the pl key for reduced grids but not for regular grids.

The keys in some of these namespaces are shown here:

Parameter
Time
Geography
Vertical


  • No labels