IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 10, 2008, 2:17:14 PM (18 years ago)
Author:
eugene
Message:

ippScripts/scripts/camera_exp.pl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/matrix/F_compress_M.c

    r18403 r20652  
    3434  char cmptype[80];
    3535  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;
    3737  VarLengthColumn zdef;
    3838  float zscale, zzero;
     
    177177  gfits_scan (header, "ZSCALE", "%lf", 1, &zscale);
    178178
     179  zblank = 32767;
     180  gfits_scan (header, "ZBLANK", "%d", 1, &zblank);
     181
     182  oblank = 32767;
     183  gfits_scan (header, "BLANK", "%d", 1, &oblank);
     184
    179185  zzero = 0;
    180186  gfits_scan (header, "ZZERO", "%lf", 1, &zzero);
     
    248254
    249255    // 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);
    251257
    252258    // update the tile counters, carrying to the next dimension if needed
     
    289295
    290296// 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) {
     297int gfits_distribute_data (Matrix *matrix, int bitpix, char *data, int Ndata, int *otile, int oblank, int *ztile, int zblank, float zscale, float zzero) {
    292298
    293299  int i, j, start, offset, coord, Nline;
     
    331337    TYPE *Optr = (TYPE *) &matrix->buffer[SIZE*(offset + start)]; \
    332338    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      } } }
    335344
    336345  // 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.