NCEPLIBS-g2c
1.6.4
|
Unpack Section 7 (Data Section) as defined in GRIB Edition 2. More...
Go to the source code of this file.
Functions | |
int | comunpack (unsigned char *, g2int, g2int, g2int *, g2int, g2float *) |
This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.2 or Template 5.3. More... | |
g2int | g2_unpack7 (unsigned char *cgrib, g2int *iofst, g2int igdsnum, g2int *igdstmpl, g2int idrsnum, g2int *idrstmpl, g2int ndpts, g2float **fld) |
This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2. More... | |
g2int | jpcunpack (unsigned char *, g2int, g2int *, g2int, g2float *) |
This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More... | |
g2int | pngunpack (unsigned char *, g2int, g2int *, g2int, g2float *) |
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010. More... | |
g2int | simunpack (unsigned char *, g2int *, g2int, g2float *) |
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.0. More... | |
g2int | specunpack (unsigned char *, g2int *, g2int, g2int, g2int, g2int, g2float *) |
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.51. More... | |
Unpack Section 7 (Data Section) as defined in GRIB Edition 2.
Definition in file g2_unpack7.c.
int comunpack | ( | unsigned char * | cpack, |
g2int | lensec, | ||
g2int | idrsnum, | ||
g2int * | idrstmpl, | ||
g2int | ndpts, | ||
g2float * | fld | ||
) |
This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.2 or Template 5.3.
Supports GRIB2 complex packing templates with or without spatial differences (i.e. DRTs 5.2 and 5.3).
Date | Programmer | Comments |
---|---|---|
2002-10-29 | Gilbert | Initial |
2004-12-16 | Gilbert | Added test (from Arthur Taylor/MDL) verifying group widths/lengths |
cpack | pointer to the packed data field. |
lensec | length of section 7 (used for error checking). |
idrsnum | Data Representation Template number. Must equal 2 or 3. |
idrstmpl | pointer to the array of values for Data Representation Template 5.2 or 5.3 |
ndpts | The number of data values to unpack |
fld | Contains the unpacked data values. Must be allocated with at least ndpts * sizeof(g2float) bytes before calling this routine. |
Definition at line 42 of file comunpack.c.
References gbit(), gbits(), int_power(), and rdieee().
Referenced by g2_unpack7().
g2int g2_unpack7 | ( | unsigned char * | cgrib, |
g2int * | iofst, | ||
g2int | igdsnum, | ||
g2int * | igdstmpl, | ||
g2int | idrsnum, | ||
g2int * | idrstmpl, | ||
g2int | ndpts, | ||
g2float ** | fld | ||
) |
This subroutine unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
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 |
cgrib | char array containing Section 7 of the GRIB2 message |
iofst | Bit offset of the beginning of Section 7 in cgrib. |
igdsnum | Grid Definition Template Number (see Code Table 3.0) (Only used for DRS Template 5.51) |
igdstmpl | Pointer 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). |
idrsnum | Data Representation Template Number (see Code Table 5.0) |
idrstmpl | Pointer 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 |
ndpts | Number of data points unpacked and returned. |
fld | Pointer to a float array containing the unpacked data field. |
Definition at line 65 of file g2_unpack7.c.
References comunpack(), gbit(), jpcunpack(), pngunpack(), rdieee(), simunpack(), and specunpack().
Referenced by g2_getfld().
This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
cpack | The packed data field (character*1 array). |
len | length of packed field cpack. |
idrstmpl | Pointer to array of values for Data Representation Template 5.40 or 5.40000. |
ndpts | The number of data values to unpack. |
fld | Contains the unpacked data values. |
Definition at line 31 of file jpcunpack.c.
References dec_jpeg2000(), int_power(), and rdieee().
Referenced by g2_unpack7().
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010.
cpack | The packed data field (character*1 array). |
len | length of packed field cpack(). |
idrstmpl | Pointer to array of values for Data Representation Template 5.41 or 5.40010. |
ndpts | The number of data values to unpack. |
fld | Contains the unpacked data values. |
Definition at line 30 of file pngunpack.c.
References dec_png(), gbits(), int_power(), and rdieee().
Referenced by g2_unpack7().
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.0.
cpack | pointer to the packed data field. |
idrstmpl | pointer to the array of values for Data Representation Template 5.0. |
ndpts | The number of data values to unpack. |
fld | Contains the unpacked data values. fld must be `* allocated with at least ndpts * sizeof(g2float) bytes before calling this routine. |
Definition at line 26 of file simunpack.c.
References gbits(), int_power(), and rdieee().
Referenced by g2_unpack7().
g2int specunpack | ( | unsigned char * | cpack, |
g2int * | idrstmpl, | ||
g2int | ndpts, | ||
g2int | JJ, | ||
g2int | KK, | ||
g2int | MM, | ||
g2float * | fld | ||
) |
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for spherical harmonic data as defined in the GRIB2 documention, using info from the GRIB2 Data Representation Template 5.51.
cpack | pointer to the packed data field. |
idrstmpl | pointer to the array of values for Data Representation Template 5.51. |
ndpts | The number of data values to unpack (real and imaginary parts). |
JJ | pentagonal resolution parameter. |
KK | pentagonal resolution parameter. |
MM | pentagonal resolution parameter. |
fld | Contains the unpacked data values. fld must be allocated with at least ndpts * sizeof(g2float) bytes before calling this routine. |
Definition at line 35 of file specunpack.c.
References gbits(), int_power(), and rdieee().
Referenced by g2_unpack7().