Changeset 16672
- Timestamp:
- Feb 26, 2008, 2:35:41 PM (18 years ago)
- Location:
- trunk/psLib/src/fits
- Files:
-
- 2 edited
-
psFitsImage.c (modified) (2 diffs)
-
psFitsScale.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsImage.c
r16185 r16672 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-0 1-23 03:08:03$9 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-02-27 00:35:41 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 285 285 // Choose an appropriate BSCALE and BZERO 286 286 if (!psFitsScaleDetermine(bscale, bzero, image, fits)) { 287 psError(PS_ERR_UNKNOWN, false, "Unable to determine BSCALE and BZERO for image."); 288 return NULL; 287 // We can't have the write dying for this reason --- try to save it somehow! 288 psWarning("Unable to determine BSCALE and BZERO for image --- setting to 1.0, 0.0"); 289 psErrorStackClear(); 289 290 } 290 291 } else { -
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.
