Changeset 20652 for trunk/Ohana/src/libfits/matrix/F_compress_M.c
- Timestamp:
- Nov 10, 2008, 2:17:14 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/matrix/F_compress_M.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/matrix/F_compress_M.c
r18403 r20652 34 34 char cmptype[80]; 35 35 char zaxis[10], naxis[10], key[10], word[81], exttype[81], checksum[81], datasum[81]; 36 int Noptions, NOPTIONS ;36 int Noptions, NOPTIONS, zblank, oblank; 37 37 VarLengthColumn zdef; 38 38 float zscale, zzero; … … 177 177 gfits_scan (header, "ZSCALE", "%lf", 1, &zscale); 178 178 179 zblank = 32767; 180 gfits_scan (header, "ZBLANK", "%d", 1, &zblank); 181 182 oblank = 32767; 183 gfits_scan (header, "BLANK", "%d", 1, &oblank); 184 179 185 zzero = 0; 180 186 gfits_scan (header, "ZZERO", "%lf", 1, &zzero); … … 248 254 249 255 // copy the uncompressed pixels into their correct locations 250 if (!gfits_distribute_data (matrix, odata_pixsize, out, Nout, otile, ztile, zscale, zzero)) return (FALSE);256 if (!gfits_distribute_data (matrix, odata_pixsize, out, Nout, otile, oblank, ztile, zblank, zscale, zzero)) return (FALSE); 251 257 252 258 // update the tile counters, carrying to the next dimension if needed … … 289 295 290 296 // bitpix is the input data size/type 291 int gfits_distribute_data (Matrix *matrix, int bitpix, char *data, int Ndata, int *otile, int *ztile, float zscale, float zzero) {297 int gfits_distribute_data (Matrix *matrix, int bitpix, char *data, int Ndata, int *otile, int oblank, int *ztile, int zblank, float zscale, float zzero) { 292 298 293 299 int i, j, start, offset, coord, Nline; … … 331 337 TYPE *Optr = (TYPE *) &matrix->buffer[SIZE*(offset + start)]; \ 332 338 for (j = 0; j < Ztile[0]; j++, Iptr++, Optr++) { \ 333 *Optr = *Iptr * zscale + zzero; \ 334 } } 339 if (*Iptr == zblank) { \ 340 *Optr = oblank; \ 341 } else { \ 342 *Optr = *Iptr * zscale + zzero; \ 343 } } } 335 344 336 345 // this macro sets up the outer switch and calls above macro with all output bitpix options
Note:
See TracChangeset
for help on using the changeset viewer.
