NCEPLIBS-g2c  1.7.0
g2_unpack7.c File Reference

Unpack Section 7 (Data Section) as defined in GRIB Edition 2. More...

#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <string.h>
#include "grib2_int.h"

Go to the source code of this file.

Functions

g2int g2_unpack7 (unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float **fld)
 This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2. More...
 

Detailed Description

Unpack Section 7 (Data Section) as defined in GRIB Edition 2.

Author
Stephen Gilbert
Date
2002-10-31

Definition in file g2_unpack7.c.

Function Documentation

◆ g2_unpack7()

g2int g2_unpack7 ( unsigned char *  cgrib,
g2int iofst,
g2int  igdsnum,
g2int igdstmpl,
g2int  idrsnum,
g2int idrstmpl,
g2int  ndpts,
float **  fld 
)

This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.

Program History Log

Date Programmer Comments
2002-10-31 Gilbert Initial
2002-12-20 Gilbert Added GDT info to arguments and added 5.51 processing.
2003-08-29 Gilbert New templates using PNG and JPEG2000 algorithms/templates.
2004-11-29 Gilbert JPEG2000 now allowed to use WMO Template 5.40 PNG allowed to use 5.41
2004-12-16 Taylor Added check on comunpack return code.
2008-12-23 Wesley Initialize Number of data points unpacked
Parameters
cgribchar array containing Section 7 of the GRIB2 message
iofstBit offset of the beginning of Section 7 in cgrib.
igdsnumGrid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51)
igdstmplPointer to an integer array containing the data values for the specified Grid Definition Template (N=igdsnum). Each element of this integer array contains an entry (in the order specified) of Grid Definition Template 3.N. (Only used for DRS Template 5.51).
idrsnumData Representation Template Number (see Code Table 5.0)
idrstmplPointer to an integer array containing the data values for the specified Data Representation Template (N=idrsnum). Each element of this integer array contains an entry (in the order specified) of Data Representation Template 5.N
ndptsNumber of data points unpacked and returned.
fldPointer to a float array containing the unpacked data field.
Returns
Author
Stephen Gilbert
Date
2002-10-31

Definition at line 55 of file g2_unpack7.c.

References comunpack(), G2_NO_ERROR, G2_UNPACK7_BAD_DRT, G2_UNPACK7_CORRUPT_SEC, G2_UNPACK7_WRONG_GDT, G2_UNPACK_BAD_SEC, G2_UNPACK_NO_MEM, gbit(), jpcunpack(), pngunpack(), rdieee(), simunpack(), and specunpack().

Referenced by g2_getfld().