IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 17, 2008, 3:04:21 PM (19 years ago)
Author:
Paul Price
Message:

Updating FITS scaling capability (quantising floating-point images). See bug 1032. Moving scaling functions into their own file, and providing more flexibility.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080117/psLib/src/fits/psFits.c

    r15919 r16122  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.76 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-12-25 01:29:42 $
     9 *  @version $Revision: 1.76.2.1 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-01-18 01:04:21 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    165165    fits->conventions.compression = true;
    166166    fits->conventions.psBitpix = true;
     167
     168    fits->floatType = PS_FITS_FLOAT_NONE;
    167169    fits->bitpix = 0;
    168     fits->floatType = PS_FITS_FLOAT_NONE;
     170    fits->scaling = PS_FITS_SCALE_NONE;
     171    fits->fuzz = true;
     172    fits->bscale = 1.0;
     173    fits->bzero = 0.0;
     174    fits->mean = NAN;
     175    fits->stdev = NAN;
     176    fits->stdevBits = 8;
     177    fits->stdevNum = 5.0;
     178
    169179    psMemSetDeallocator(fits,(psFreeFunc)fitsFree);
    170180
     
    598608    // that is the restriction; data must be 32 or 64 bit for noise bits to be valid.
    599609    if (type != PS_FITS_COMPRESS_PLIO) {
    600         if (fits_set_noise_bits(fits->fd, noisebits, &status)) {
    601             fits_set_compression_type(fits->fd, 0x0, &status);
    602             char fitsErr[MAX_STRING_LENGTH];
    603             fits_get_errstatus(status, fitsErr);
    604             psError(PS_ERR_BAD_FITS, true,
    605                     "Error while configuring compression. CFITSIO error: %s", fitsErr);
    606             return false;
    607         }
     610        if (fits_set_noise_bits(fits->fd, noisebits, &status)) {
     611            fits_set_compression_type(fits->fd, 0x0, &status);
     612            char fitsErr[MAX_STRING_LENGTH];
     613            fits_get_errstatus(status, fitsErr);
     614            psError(PS_ERR_BAD_FITS, true,
     615                    "Error while configuring compression. CFITSIO error: %s", fitsErr);
     616            return false;
     617        }
    608618    }
    609619
Note: See TracChangeset for help on using the changeset viewer.