Changeset 16672 for trunk/psLib/src/fits/psFitsScale.c
- Timestamp:
- Feb 26, 2008, 2:35:41 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsScale.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsScale.c
r16197 r16672 288 288 for (int y = 0; y < numRows; y++) { \ 289 289 for (int x = 0; x < numCols; x++) { \ 290 ps##INTYPE value = ((IN)->data.INTYPE[y][x] - zero) * scale; \ 291 if (options->fuzz) { \ 292 /* Add random factor [0,1): adds a variance of 1/12, */ \ 293 /* but preserves the expectation value */ \ 294 value += psRandomUniform(rng); \ 290 ps##INTYPE value = (IN)->data.INTYPE[y][x]; \ 291 if (!isfinite(value)) { \ 292 /* This choice of "max" for non-finite pixels is mainly cosmetic --- it has to be */ \ 293 /* something, and "min" would produce holes in the cores of bright stars. */ \ 294 (OUT)->data.OUTTYPE[y][x] = max; \ 295 } else { \ 296 value = (value - zero) * scale; \ 297 if (options->fuzz) { \ 298 /* Add random factor [0,1): adds a variance of 1/12, */ \ 299 /* but preserves the expectation value */ \ 300 value += psRandomUniform(rng); \ 301 } \ 302 /* Check for underflow and overflow */ \ 303 (OUT)->data.OUTTYPE[y][x] = (value < min ? min : (value > max ? max : value)); \ 295 304 } \ 296 /* Check for underflow and overflow */ \297 (OUT)->data.OUTTYPE[y][x] = (value < min ? min : (value > max ? max : value)); \298 305 } \ 299 306 } \
Note:
See TracChangeset
for help on using the changeset viewer.
