17 #if defined USE_JPEG2000 || defined USE_OPENJPEG
75 gbit(cgrib, &lensec, *iofst, 32);
77 gbit(cgrib, &isecnum, *iofst, 8);
88 lfld = calloc(ndpts ? ndpts : 1,
sizeof(
g2float));
100 simunpack(cgrib + ipos, idrstmpl, ndpts, lfld);
101 else if (idrsnum == 2 || idrsnum == 3)
103 if (
comunpack(cgrib+ipos, lensec, idrsnum, idrstmpl, ndpts, lfld) != 0)
108 else if (idrsnum == 50)
110 simunpack(cgrib + ipos, idrstmpl, ndpts - 1, lfld + 1);
111 rdieee(idrstmpl + 4, lfld, 1);
113 else if (idrsnum == 51)
114 if (igdsnum>=50 && igdsnum <=53)
115 specunpack(cgrib + ipos, idrstmpl, ndpts, igdstmpl[0], igdstmpl[2],
119 fprintf(stderr,
"g2_unpack7: Cannot use GDT 3.%d to unpack Data Section 5.51.\n",
127 #if defined USE_JPEG2000 || defined USE_OPENJPEG
128 else if (idrsnum == 40 || idrsnum == 40000)
130 jpcunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
134 else if (idrsnum == 41 || idrsnum == 40010)
136 pngunpack(cgrib + ipos, lensec - 5, idrstmpl, ndpts, lfld);
141 fprintf(stderr,
"g2_unpack7: Data Representation Template 5.%d not yet "
142 "implemented.\n", (
int)idrsnum);
150 *iofst = *iofst + (8 * lensec);
g2int simunpack(unsigned char *, g2int *, g2int, g2float *)
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
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 ...
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 GRIB...
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 ...
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.
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...
void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbyte)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
Header file for NCEPLIBS-g2c library.
int64_t g2int
Long integer type.
void rdieee(g2int *rieee, g2float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.