NCEPLIBS-g2c 2.0.0
|
Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS). More...
#include "grib2_int.h"
Go to the source code of this file.
Functions | |
gtemplate * | extpdstemplate (g2int number, g2int *list) |
This subroutine generates the remaining octet map for a given Product Definition Template, if required. | |
int | g2c_get_pds_template (int pds_template_num, int *maplen, int *map, int *needext) |
Get PDS template information. | |
int | g2c_get_pds_template_extension (int pds_template_num, int *template, int *extlen, int *ext) |
Get pds template extension information. | |
static g2int | getpdsindex (g2int number) |
This function returns the index of specified Product Definition Template in array templates. | |
gtemplate * | getpdstemplate (g2int number) |
This subroutine returns PDS template information for a specified Product Definition Template. | |
Variables | |
static const struct pdstemplate | templatespds [G2C_MAX_PDS_TEMPLATE] |
Data for struct for PDS template. | |
Functions for GRIB2 Product Definition Templates used in Section 4 - the Product Definition Section (PDS).
Each Template has three parts:
Date | Programmer | Comments |
---|---|---|
2001-06-28 | Gilbert | Initial |
2009-01-14 | Vuong | Changed structure name template to gtemplate |
2009-12-15 | Vuong | Added Product Definition Templates 4.31, 4.15 |
2010-08-03 | Vuong | Added Product Definition Template 4.42 and 4.43 |
2010-12-08 | Vuong | Corrected Product Definition Template 4.42 and 4.43 |
2012-03-29 | Vuong | Added Templates 4.44,4.45,4.46,4.47,4.48,4.50, 4.51,4.91,4.32 and 4.52 |
2013-08-05 | Vuong | Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54 |
2015-10-07 | Vuong | Added Templates 4.57, 4.60, 4.61 and allow a forecast time to be negative |
2022-10-18 | Hartnett | Added g2c_get_pds_template() and g2c_get_pds_template_extension(). |
Definition in file pdstemplates.c.
This subroutine generates the remaining octet map for a given Product Definition Template, if required.
Some Templates can vary depending on data values given in an earlier part of the Template, and it is necessary to know some of the earlier entry values to generate the full octet map of the Template.
This function allocates memory in the ext field of the gtemplate struct. This memory must be freed by the caller.
number | number of the Product Definition Template 4.NN that is being requested. |
list | The list of values for each entry in the the Product Definition Template. |
Definition at line 326 of file pdstemplates.c.
References getpdsindex(), and getpdstemplate().
Referenced by g2_addfield(), g2_unpack4(), and g2c_get_pds_template_extension().
int g2c_get_pds_template | ( | int | pds_template_num, |
int * | maplen, | ||
int * | map, | ||
int * | needext | ||
) |
Get PDS template information.
The PDS template consists of a template map, its length, and, for some templates, an extra extension map, and its length. If an extension is needed, use g2c_get_pds_template_extension() to get it.
pds_template_num | The PDS template number. |
maplen | Pointer that gets the length of the map. Ignored if NULL. |
map | Pointer that gets the map as an array of int. Memory must be allocated by caller. Ignored if NULL. |
needext | Pointer that a non-zero value if an extension to this template is needed. Ignored if NULL. |
Definition at line 831 of file pdstemplates.c.
References G2C_ENOTEMPLATE, G2C_MAX_PDS_TEMPLATE, G2C_NOERROR, and templatespds.
Referenced by g2c_rw_section4_metadata().
int g2c_get_pds_template_extension | ( | int | pds_template_num, |
int * | template, | ||
int * | extlen, | ||
int * | ext | ||
) |
Get pds template extension information.
pds_template_num | The pds template number. |
template | Pointer to array that contains the template values. |
extlen | Pointer that gets the length of the extension. Ignored if NULL. |
ext | Pointer that gets template extension array, if there is one. Memory must be allocated by the caller. Ignored if NULL. |
Definition at line 756 of file pdstemplates.c.
References gtemplate::ext, gtemplate::extlen, extpdstemplate(), G2C_EINVAL, G2C_ENOMEM, G2C_ENOTEMPLATE, G2C_MAX_PDS_TEMPLATE, G2C_NOERROR, and templatespds.
This function returns the index of specified Product Definition Template in array templates.
number | The number of the Product Definition Template that is being requested. |
Definition at line 242 of file pdstemplates.c.
References G2C_MAX_PDS_TEMPLATE, getpdsindex(), and templatespds.
Referenced by extpdstemplate(), getpdsindex(), and getpdstemplate().
This subroutine returns PDS template information for a specified Product Definition Template.
The number of entries in the template is returned along with a map of the number of octets occupied by each entry. Also, a flag is returned to indicate whether the template would need to be extended.
This function allocates memory for the gtemplate struct, which must be freed by the caller.
number | the number of the Product Definition Template that is being requested. |
Definition at line 277 of file pdstemplates.c.
References getpdsindex(), and templatespds.
Referenced by extpdstemplate(), g2_addfield(), and g2_unpack4().
|
static |
Data for struct for PDS template.
Definition at line 57 of file pdstemplates.c.
Referenced by g2c_get_pds_template(), g2c_get_pds_template_extension(), getpdsindex(), and getpdstemplate().