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

Compare with Current View Page History

« Previous Version 13 Next »

The purpose of the Product Definition section is to describe the nature of the data contained in the Data section.

Note that there are three categories of GRIB2 templates – Grid Definition Templates, Product Definition Templates and Data Representation Templates. They are identified by the Grid Definition Template Number, Product Definition Template Number, and Data Representation Template Number, respectively.

Here we describe the Product Definition Templates only. The ecCodes key for its template number is "productDefinitionTemplateNumber".

The Product Definition Templates are normally divided into groups of 4. For example the most commonly used ones are:


DeterministicEnsemble
Instantaneous01
Interval-based811

So for a product definition, we have two dimensions:

  1. Whether it is deterministic or part of an ensemble
  2. Whether the field is instantaneous or interval-based (e.g. accumulated)

A Product Definition Template Number of 8 means "deterministic and interval-based". If you chose 11 then your product would represent an ensemble member.

In the latter case the GRIB message will have the key "perturbationNumber" but not in the former case because it is not part of an ensemble.

Now there are other kinds of product groups which follow this pattern. Let's look at the atmospheric chemical constituents:

ChemicalDeterministicEnsemble
Instantaneous4041
Interval-based4243

For the meaning of the various Product Definition Template numbers see http://apps.ecmwf.int/codes/grib/format/grib2/templates/4/.
You can also click on each entry to see the keys (contents) of the particular template e.g. for template 11, see https://apps.ecmwf.int/codes/grib/format/grib2/templates/4/11.

To view these templates in ecCodes, go to the grib2 definitions directory (this can be found via the "codes_info" command) and look for files named: template.4.*def
Some of these will include other template files. Let's look at one example of the template numbers 8 and 11:

% codes_info
  ecCodes Version 2.17.0
  Default definition files path is used: /usr/local/apps/eccodes/2.17.0/GNU/7.3.0/share/eccodes/definitions
...
# Go to the definitions directory for GRIB edition 2
% cd /usr/local/apps/eccodes/2.17.0/GNU/7.3.0/share/eccodes/definitions/grib2
% cat template.4.11.def
include "grib2/template.4.parameter.def"
include "grib2/template.4.horizontal.def"
include "grib2/template.4.eps.def"
include "grib2/template.4.statistical.def"

% cat template.4.8.def
include "grib2/template.4.parameter.def"
include "grib2/template.4.horizontal.def"
include "grib2/template.4.statistical.def"

# We see that the only difference is the inclusion of the ensemble file (template.4.eps.def)
# Now look in this file to see what keys are there
% more template.4.eps.def
...
unsigned[1] perturbationNumber  : dump;
...
# This tells us there is a one-octet key called perturbationNumber




  • No labels