Changeset 24901
- Timestamp:
- Jul 22, 2009, 4:05:27 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsScale.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsScale.c
r23259 r24901 46 46 psAssert(image, "impossible"); 47 47 psAssert(options, "impossible"); 48 49 psTrace("psLib.fits", 3, "Scaling image to preserve dynamic range"); 48 50 49 51 double range = pow(2.0, options->bitpix) - 1.0; // Range of values for target BITPIX, reduced by the BLANK … … 109 111 psAssert(options, "impossible"); 110 112 113 psTrace("psLib.fits", 3, "Scaling image by statistics"); 114 111 115 // Measure the mean and stdev 112 116 // psImageBackground automatically excludes pixels that are non-finite, so we don't need to bother about a … … 131 135 } 132 136 137 psTrace("psLib.fits", 5, "Mean: %lf Stdev: %lf", mean, stdev); 138 133 139 long range = 1 << options->stdevBits; // Range of values to carry standard deviation 134 140 *bscale = stdev / (double) range; 141 142 psTrace("psLib.fits", 5, "Number of bits: %ld BSCALE: %lf", range, *bscale); 135 143 136 144 double imageVal; // Value on image … … 157 165 158 166 *bzero = imageVal - *bscale * diskVal; 167 168 psTrace("psLib.fits", 5, "Image %lf corresponds to disk %ld --> BZERO: %lf", imageVal, diskVal, *bzero); 159 169 160 170 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
