Changeset 16131
- Timestamp:
- Jan 17, 2008, 5:37:50 PM (18 years ago)
- 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 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.76.2. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-01-18 0 1:04:21$9 * @version $Revision: 1.76.2.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-01-18 03:37:50 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 174 174 fits->mean = NAN; 175 175 fits->stdev = NAN; 176 fits->stdevBits = 8;176 fits->stdevBits = 4; 177 177 fits->stdevNum = 5.0; 178 178 -
branches/pap_branch_080117/psLib/src/fits/psFits.h
r16122 r16131 4 4 * @author Robert DeSonia, MHPCC 5 5 * 6 * @version $Revision: 1.35.2. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2008-01-18 0 1:04:21$6 * @version $Revision: 1.35.2.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-01-18 03:37:50 $ 8 8 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 9 9 */ … … 47 47 PS_FITS_SCALE_NONE, ///< No auto-scaling to be applied (BSCALE = 1, BZERO = 0) 48 48 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 limit50 PS_FITS_SCALE_STDEV_ UPPER,///< Auto-scale to sample stdev, place mean at upper limit51 PS_FITS_SCALE_STDEV_ MIDDLE,///< Auto-scale to sample stdev, place mean at middle49 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 52 52 PS_FITS_SCALE_MANUAL ///< Manual scaling (use specified BSCALE and BZERO) 53 53 } psFitsScaling; -
branches/pap_branch_080117/psLib/src/fits/psFitsScale.c
r16122 r16131 113 113 114 114 long range = 1 << fits->stdevBits; // Range of values to carry standard deviation 115 *bscale = fits->stdev / (double) range;115 *bscale = stdev / (double) range; 116 116 117 117 int bitpix = fits->bitpix; // Bits per pixel … … 119 119 long diskVal; // Corresponding value on disk 120 120 switch (fits->scaling) { 121 case PS_FITS_SCALE_STDEV_ LOWER:121 case PS_FITS_SCALE_STDEV_POSITIVE: 122 122 // Put (mean - N sigma) at the lowest possible value: predominantly positive images 123 123 imageVal = mean - fits->stdevNum * stdev; 124 124 diskVal = - (1 << (bitpix - 1)); 125 125 break; 126 case PS_FITS_SCALE_STDEV_ UPPER:126 case PS_FITS_SCALE_STDEV_NEGATIVE: 127 127 // Put (mean + N sigma) at the highest possible value: predominantly negative images 128 128 imageVal = mean + fits->stdevNum * stdev; 129 129 diskVal = (1 << (bitpix - 1)) - 1; 130 130 break; 131 case PS_FITS_SCALE_STDEV_ MIDDLE:131 case PS_FITS_SCALE_STDEV_BOTH: 132 132 // Put mean right in the middle: images with an equal abundance of positive and negative values 133 133 imageVal = mean; … … 165 165 // If we don't have a RNG, we will allocate one 166 166 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) { 170 170 // No need to do anything 171 171 return true; … … 238 238 } 239 239 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: 243 243 if (!scaleStdev(bscale, bzero, image, fits)) { 244 244 psError(PS_ERR_UNKNOWN, false, "Unable to set BSCALE and BZERO from stdev");
Note:
See TracChangeset
for help on using the changeset viewer.
