Go to the documentation of this file.
64 gbit(cgrib, &lensec, *iofst, 32);
66 gbit(cgrib, &isecnum, *iofst, 8);
73 if (!(lfld = calloc(ndpts ? ndpts : 1,
sizeof(
float))))
79 simunpack(cgrib + ipos, idrstmpl, ndpts, lfld);
80 else if (idrsnum == 2 || idrsnum == 3)
82 if (
comunpack(cgrib+ipos, lensec, idrsnum, idrstmpl, ndpts, lfld))
85 else if (idrsnum == 50)
87 simunpack(cgrib + ipos, idrstmpl, ndpts - 1, lfld + 1);
88 rdieee(idrstmpl + 4, lfld, 1);
90 else if (idrsnum == 51)
92 if (igdsnum >= 50 && igdsnum <= 53)
93 specunpack(cgrib + ipos, idrstmpl, ndpts, igdstmpl[0], igdstmpl[2],
97 fprintf(stderr,
"g2_unpack7: Cannot use GDT 3.%d to unpack Data Section 5.51.\n",
105 #if defined USE_JPEG2000 || defined USE_OPENJPEG
106 else if (idrsnum == 40 || idrsnum == 40000)
108 jpcunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
112 else if (idrsnum == 41 || idrsnum == 40010)
114 pngunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
119 fprintf(stderr,
"g2_unpack7: Data Representation Template 5.%d not yet "
120 "implemented.\n", (
int)idrsnum);
127 *iofst = *iofst + (8 * lensec);
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
#define G2_NO_ERROR
Function succeeded.
#define G2_UNPACK7_CORRUPT_SEC
In g2_unpack7(), corrupt section 7.
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
Header file with internal function prototypes NCEPLIBS-g2c library.
g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representatio...
void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
int64_t g2int
Long integer type.
#define G2_UNPACK7_BAD_DRT
In g2_unpack7(), unrecognized Data Representation Template.
g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB...
g2int simunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
int comunpack(unsigned char *cpack, g2int lensec, g2int idrsnum, g2int *idrstmpl, g2int ndpts, float *fld)
This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in ...
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.
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
g2int specunpack(unsigned char *cpack, g2int *idrstmpl, g2int ndpts, g2int JJ, g2int KK, g2int MM, float *fld)
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for...
#define G2_UNPACK7_WRONG_GDT
In g2_unpack7(), need one of GDT 3.50 through 3.53 to decode DRT 5.51.