NCEPLIBS-g2c  1.6.4
drstemplates.h File Reference

This C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS). More...

#include "grib2.h"

Go to the source code of this file.

Data Structures

struct  drstemplate
 Stuct for GRIB2 Data Representation Section (DRS) template. More...
 

Macros

#define MAXDRSMAPLEN   200
 maximum template map length More...
 
#define MAXDRSTEMP   9
 maximum number of templates More...
 

Variables

const struct drstemplate templatesdrs [MAXDRSTEMP]
 Stuct holding data for GRIB2 Data Representation Section (DRS) template. More...
 

Detailed Description

This C struct contains info on all the available GRIB2 Data Representation Templates used in Section 5 (DRS).

The information decribing each template is stored in the drstemplate structure defined below.

Each Template has three parts:

  1. The number of entries in the template (mapdrslen).
  2. A map of the template (mapdrs), which contains the number of octets in which to pack each of the template values.
  3. A logical value (needext) that indicates whether the Template needs to be extended. In some cases the number of entries in a template can vary depending upon values specified in the "static" part of the template. (See Template 5.1 as an example.)
Note
Array mapdrs contains the number of octets in which the corresponding template values will be stored. A negative value in mapdrs is used to indicate that the corresponding template entry can contain negative values. This information is used later when packing (or unpacking) the template data values. Negative data values in GRIB are stored with the left most bit set to one, and a negative number of octets value in mapdrs indicates that this possibility should be considered. The number of octets used to store the data value in this case would be the absolute value of the negative value in mapdrs.
Author
Stephen Gilbeert
Date
2002-10-26

Definition in file drstemplates.h.


Data Type Documentation

◆ drstemplate

struct drstemplate

Stuct for GRIB2 Data Representation Section (DRS) template.

Definition at line 42 of file drstemplates.h.

Data Fields
g2int mapdrs[MAXDRSMAPLEN] A map of the template.
g2int mapdrslen Length of map of the template.
g2int needext Whether the Template needs to be extended.
g2int template_num The number of entries in the template.

Macro Definition Documentation

◆ MAXDRSMAPLEN

#define MAXDRSMAPLEN   200

maximum template map length

Definition at line 37 of file drstemplates.h.

◆ MAXDRSTEMP

#define MAXDRSTEMP   9

maximum number of templates

Definition at line 36 of file drstemplates.h.

Variable Documentation

◆ templatesdrs

const struct drstemplate templatesdrs[MAXDRSTEMP]

Stuct holding data for GRIB2 Data Representation Section (DRS) template.

Definition at line 1 of file drstemplates.h.

Referenced by getdrsindex(), and getdrstemplate().