38 g2int *ifld, j, iofst, nbits;
39 float ref, bscale, dscale, *unpk;
40 float *pscale, tscale;
41 g2int Js, Ks, Ms, Ts, Ns, Nm, n, m;
42 g2int inc, incu, incp;
44 rdieee(idrstmpl+0, &ref, 1);
56 unpk = malloc(ndpts *
sizeof(
float));
57 ifld = malloc(ndpts *
sizeof(
g2int));
59 gbits(cpack, ifld, 0, 32, 0, Ts);
62 gbits(cpack, ifld, iofst, nbits, 0, ndpts - Ts);
66 pscale = malloc((JJ + MM + 1) *
sizeof(
float));
67 tscale = idrstmpl[4] * 1E-6;
68 for (n = Js; n <= JJ + MM; n++)
69 pscale[n] = pow((
float)(n * (n+1)), -tscale);
75 for (m = 0; m <= MM; m++)
83 for (n = m; n <= Nm; n++)
85 if (n <= Ns && m <= Ms)
87 fld[inc++] = unpk[incu++];
88 fld[inc++] = unpk[incu++];
92 fld[inc++] = (((float)ifld[incp++] * bscale) + ref) *
94 fld[inc++] = (((float)ifld[incp++] * bscale) + ref) *
106 printf(
"specunpack: Cannot handle 64 or 128-bit floats.\n");
107 for (j = 0; j < ndpts; j++)