IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31244


Ignore:
Timestamp:
Apr 8, 2011, 2:09:11 PM (15 years ago)
Author:
watersc1
Message:

Fixes bug between writing covariance extension and the log scaled/compressed stack images.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAWrite.c

    r27992 r31244  
    690690    pmHDU *hdu = pmHDUFromCell(cell);   // HDU for cell
    691691    psMetadata *header = psMetadataCopy(NULL, hdu->header); // Header to write
     692
    692693    psMetadataAddS32(header, PS_LIST_TAIL, "COVARIANCE.CENTRE.X", PS_META_REPLACE,
    693694                     "Centre of covariance matrix in x", -xMinCovar);
     
    697698    // Turn off compression
    698699    int bitpix = fits->options ? fits->options->bitpix : 0; // Desired bits per pixel
     700    psFitsScaling scaling = fits->options ? fits->options->scaling : 0; // Current scaling method.
    699701    psFitsCompression *compress = psFitsCompressionGet(fits); // Current compression options
     702   
     703/*     fprintf(stderr,"Attempting to write chip %s cell %s extension %s with scaling %d\n", */
     704/*          chipName,cellName,extname,fits->options->scaling); */
    700705    if (!psFitsSetCompression(fits, PS_FITS_COMPRESS_NONE, NULL, 0, 0, 0)) {
    701706        psError(PS_ERR_UNKNOWN, false, "Unable to set FITS compression to NONE");
     
    708713    if (fits->options) {
    709714        fits->options->bitpix = 0;
     715    }
     716    if (fits->options) {
     717        fits->options->scaling = psFitsScalingFromString("STDEV_POSITIVE"); // This is a bit of a hack. We don't really have a default value.
    710718    }
    711719
     
    732740        fits->options->bitpix = bitpix;
    733741    }
     742    if (fits->options) {
     743        fits->options->scaling = scaling;
     744    }
    734745    if (!psFitsCompressionApply(fits, compress)) {
    735746        psError(PS_ERR_UNKNOWN, false, "Unable to restore FITS compression");
Note: See TracChangeset for help on using the changeset viewer.