IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16131


Ignore:
Timestamp:
Jan 17, 2008, 5:37:50 PM (18 years ago)
Author:
Paul Price
Message:

Renaming STDEV_LOWER, STDEV_UPPER, STDEV_MIDDLE --> STDEV_POSITIVE, STDEV_NEGATIVE, STDEV_BOTH. This indicates the kind of image directly, rather than a technical property of the image.

Location:
branches/pap_branch_080117/psLib/src/fits
Files:
3 edited

Legend:

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

    r16122 r16131  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.76.2.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-01-18 01:04:21 $
     9 *  @version $Revision: 1.76.2.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-01-18 03:37:50 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    174174    fits->mean = NAN;
    175175    fits->stdev = NAN;
    176     fits->stdevBits = 8;
     176    fits->stdevBits = 4;
    177177    fits->stdevNum = 5.0;
    178178
  • branches/pap_branch_080117/psLib/src/fits/psFits.h

    r16122 r16131  
    44 * @author Robert DeSonia, MHPCC
    55 *
    6  * @version $Revision: 1.35.2.1 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-01-18 01:04:21 $
     6 * @version $Revision: 1.35.2.2 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2008-01-18 03:37:50 $
    88 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    99 */
     
    4747    PS_FITS_SCALE_NONE,                 ///< No auto-scaling to be applied (BSCALE = 1, BZERO = 0)
    4848    PS_FITS_SCALE_RANGE,                ///< Auto-scale to preserve dynamic range
    49     PS_FITS_SCALE_STDEV_LOWER,          ///< Auto-scale to sample stdev, place mean at lower limit
    50     PS_FITS_SCALE_STDEV_UPPER,          ///< Auto-scale to sample stdev, place mean at upper limit
    51     PS_FITS_SCALE_STDEV_MIDDLE,         ///< Auto-scale to sample stdev, place mean at middle
     49    PS_FITS_SCALE_STDEV_POSITIVE,       ///< Auto-scale to sample stdev, place mean at lower limit
     50    PS_FITS_SCALE_STDEV_NEGATIVE,       ///< Auto-scale to sample stdev, place mean at upper limit
     51    PS_FITS_SCALE_STDEV_BOTH,           ///< Auto-scale to sample stdev, place mean at middle
    5252    PS_FITS_SCALE_MANUAL                ///< Manual scaling (use specified BSCALE and BZERO)
    5353} psFitsScaling;
  • branches/pap_branch_080117/psLib/src/fits/psFitsScale.c

    r16122 r16131  
    113113
    114114    long range = 1 << fits->stdevBits;  // Range of values to carry standard deviation
    115     *bscale = fits->stdev / (double) range;
     115    *bscale = stdev / (double) range;
    116116
    117117    int bitpix = fits->bitpix;          // Bits per pixel
     
    119119    long diskVal;                       // Corresponding value on disk
    120120    switch (fits->scaling) {
    121       case PS_FITS_SCALE_STDEV_LOWER:
     121      case PS_FITS_SCALE_STDEV_POSITIVE:
    122122        // Put (mean - N sigma) at the lowest possible value: predominantly positive images
    123123        imageVal = mean - fits->stdevNum * stdev;
    124124        diskVal = - (1 << (bitpix - 1));
    125125        break;
    126       case PS_FITS_SCALE_STDEV_UPPER:
     126      case PS_FITS_SCALE_STDEV_NEGATIVE:
    127127        // Put (mean + N sigma) at the highest possible value: predominantly negative images
    128128        imageVal = mean + fits->stdevNum * stdev;
    129129        diskVal = (1 << (bitpix - 1)) - 1;
    130130        break;
    131       case PS_FITS_SCALE_STDEV_MIDDLE:
     131      case PS_FITS_SCALE_STDEV_BOTH:
    132132        // Put mean right in the middle: images with an equal abundance of positive and negative values
    133133        imageVal = mean;
     
    165165    // If we don't have a RNG, we will allocate one
    166166
    167     if (fits->scaling != PS_FITS_SCALE_STDEV_LOWER &&
    168         fits->scaling != PS_FITS_SCALE_STDEV_UPPER &&
    169         fits->scaling != PS_FITS_SCALE_STDEV_MIDDLE) {
     167    if (fits->scaling != PS_FITS_SCALE_STDEV_POSITIVE &&
     168        fits->scaling != PS_FITS_SCALE_STDEV_NEGATIVE &&
     169        fits->scaling != PS_FITS_SCALE_STDEV_BOTH) {
    170170        // No need to do anything
    171171        return true;
     
    238238        }
    239239        break;
    240       case PS_FITS_SCALE_STDEV_LOWER:
    241       case PS_FITS_SCALE_STDEV_UPPER:
    242       case PS_FITS_SCALE_STDEV_MIDDLE:
     240      case PS_FITS_SCALE_STDEV_POSITIVE:
     241      case PS_FITS_SCALE_STDEV_NEGATIVE:
     242      case PS_FITS_SCALE_STDEV_BOTH:
    243243        if (!scaleStdev(bscale, bzero, image, fits)) {
    244244            psError(PS_ERR_UNKNOWN, false, "Unable to set BSCALE and BZERO from stdev");
Note: See TracChangeset for help on using the changeset viewer.