IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 17, 2008, 5:37:50 PM (19 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.