Changeset 30255
- Timestamp:
- Jan 12, 2011, 4:31:04 PM (15 years ago)
- Location:
- branches/czw_branch/20101203
- Files:
-
- 2 edited
-
psLib/src/fits/psFitsScale.c (modified) (9 diffs)
-
psModules/src/camera/pmFPAfileDefine.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20101203/psLib/src/fits/psFitsScale.c
r30119 r30255 213 213 switch (options->scaling) { 214 214 case PS_FITS_SCALE_STDEV_POSITIVE: 215 case PS_FITS_SCALE_LOG_STDEV_POSITIVE: 215 216 // Put (mean - N sigma) at the lowest possible value: predominantly positive images 216 217 imageVal = mean - options->stdevNum * stdev; … … 218 219 break; 219 220 case PS_FITS_SCALE_STDEV_NEGATIVE: 221 case PS_FITS_SCALE_LOG_STDEV_NEGATIVE: 220 222 // Put (mean + N sigma) at the highest possible value: predominantly negative images 221 223 imageVal = mean + options->stdevNum * stdev; … … 223 225 break; 224 226 case PS_FITS_SCALE_STDEV_BOTH: 227 case PS_FITS_SCALE_LOG_STDEV_BOTH: 225 228 // Put mean right in the middle: images with an equal abundance of positive and negative values 226 229 imageVal = mean; … … 263 266 for (int x = 0; x < numCols; x++) { 264 267 psF32 value = image->data.F32[y][x]; 265 if ( !isfinite(value)) {268 if (isfinite(value)) { 266 269 if (value < offset) { 267 270 offset = value; … … 275 278 for (int x = 0; x < numCols; x++) { 276 279 psF64 value = image->data.F64[y][x]; 277 if ( !isfinite(value)) {280 if (isfinite(value)) { 278 281 if (value < offset) { 279 282 offset = value; … … 289 292 } 290 293 // We only need to offset images that go negative. 291 if (offset > 0.0) { 292 offset = 0.0; 293 } 294 /* if (offset > 0.0) { */ 295 /* offset = 0.0; */ 296 /* } */ 294 297 // Write offset to header 295 298 // How? … … 300 303 for (int y = 0; y < numRows; y++) { 301 304 for (int x = 0; x < numCols; x++) { 305 if (x == 2331 && y == 2843) { 306 fprintf(stderr,"psFS32: %d %d %g %g %g\n",x,y,offset,image->data.F32[y][x],log10(image->data.F32[y][x] - offset)); 307 } 302 308 image->data.F32[y][x] = (log10( image->data.F32[y][x] - offset)); 303 309 } … … 307 313 for (int y = 0; y < numRows; y++) { 308 314 for (int x = 0; x < numCols; x++) { 315 // fprintf(stderr,"psFS64: %d %d %g %g %g\n",x,y,offset,image->data.F64[y][x],log10(image->data.F64[y][x] - offset)); 309 316 image->data.F64[y][x] = (log10( image->data.F64[y][x] - offset)); 310 317 } … … 704 711 if (strcasecmp(string, "STDEV_NEGATIVE") == 0) return PS_FITS_SCALE_STDEV_NEGATIVE; 705 712 if (strcasecmp(string, "STDEV_BOTH") == 0) return PS_FITS_SCALE_STDEV_BOTH; 713 if (strcasecmp(string, "LOG_RANGE") == 0) return PS_FITS_SCALE_LOG_RANGE; 714 if (strcasecmp(string, "LOG_STDEV_POSITIVE") == 0) return PS_FITS_SCALE_LOG_STDEV_POSITIVE; 715 if (strcasecmp(string, "LOG_STDEV_NEGATIVE") == 0) return PS_FITS_SCALE_LOG_STDEV_NEGATIVE; 716 if (strcasecmp(string, "LOG_STDEV_BOTH") == 0) return PS_FITS_SCALE_LOG_STDEV_BOTH; 706 717 if (strcasecmp(string, "MANUAL") == 0) return PS_FITS_SCALE_MANUAL; 707 718 -
branches/czw_branch/20101203/psModules/src/camera/pmFPAfileDefine.c
r27657 r30255 282 282 case PS_FITS_SCALE_NONE: 283 283 case PS_FITS_SCALE_RANGE: 284 case PS_FITS_SCALE_LOG_RANGE: 284 285 // No options required 285 286 break; 286 287 case PS_FITS_SCALE_STDEV_POSITIVE: 287 288 case PS_FITS_SCALE_STDEV_NEGATIVE: 289 case PS_FITS_SCALE_LOG_STDEV_POSITIVE: 290 case PS_FITS_SCALE_LOG_STDEV_NEGATIVE: 288 291 options->stdevNum = parseOptionFloat(scheme, "STDEV.NUM", source); // Padding to edge 289 292 if (!isfinite(options->stdevNum)) { … … 295 298 // Flow through 296 299 case PS_FITS_SCALE_STDEV_BOTH: 300 case PS_FITS_SCALE_LOG_STDEV_BOTH: 297 301 options->stdevBits = parseOptionInt(scheme, "STDEV.BITS", source, 0); // Bits for stdev 298 302 if (options->stdevBits <= 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
