30 float ref, bscale, dscale;
32 assert(cpack && idrstmpl && fld);
34 LOG((3,
"simunpack ndpts %ld idrstmpl: %ld %ld %ld %ld %ld", ndpts, idrstmpl[0],
35 idrstmpl[1], idrstmpl[2], idrstmpl[3], idrstmpl[4]));
42 if (!(ifld = calloc(ndpts,
sizeof(
g2int))))
44 fprintf(stderr,
"Could not allocate space in simunpack.\n "
45 "Data field NOT upacked.\n");
53 gbits(cpack, ifld, 0, nbits, 0, ndpts);
54 for (j = 0; j < ndpts; j++)
55 fld[j] = (((
float)ifld[j] * bscale) + ref) * dscale;
59 for (j = 0; j < ndpts; j++)
void gbits(unsigned char *in, g2int *iout, g2int iskip, g2int nbits, g2int nskip, g2int n)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
#define G2_NO_ERROR
Function succeeded.
#define G2_JPCUNPACK_MEM
In jpcunpack() or other unpack function: out of memory.
int64_t g2int
Long integer type.
Header file with internal function prototypes NCEPLIBS-g2c library.
double int_power(double x, g2int y)
Function similar to C pow() power function.
#define LOG(e)
Ignore logging to stdout.
void rdieee(g2int *rieee, float *a, g2int num)
This subroutine reads a list of real values in 32-bit IEEE floating point format.
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...