Changeset 20505 for trunk/psModules/src/imcombine/pmSubtraction.c
- Timestamp:
- Oct 31, 2008, 5:36:01 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r20466 r20505 29 29 #define PIXEL_LIST_BUFFER 100 // Number of entries to add to pixel list at a time 30 30 #define MIN_SAMPLE_STATS 7 // Minimum number to use sample statistics; otherwise use quartiles 31 32 //#define SYS_ERROR 0.00 // Relative error in derived convolution kernel pixels33 31 34 32 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 459 457 460 458 // Generate an image that can be used to track systematic errors 461 static psImage *subtractionSysErrImage(const psImage *image // Image from which to make sys err image 459 static psImage *subtractionSysErrImage(const psImage *image, // Image from which to make sys err image 460 float sysError // Relative systematic error 462 461 ) 463 462 { 464 #ifndef SYS_ERROR 465 return NULL; 466 #else 463 if (!isfinite(sysError) || sysError == 0.0) { 464 return NULL; 465 } 466 467 467 int numCols = image->numCols, numRows = image->numRows; // Size of image 468 468 psImage *sys = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Systematic error image 469 469 470 float sysError2 = PS_SQR(sysError); // Square of the systematic error 470 471 for (int y = 0; y < numRows; y++) { 471 472 for (int x = 0; x < numCols; x++) { 472 sys->data.F32[y][x] = PS_SQR(image->data.F32[y][x]) * PS_SQR(SYS_ERROR);473 sys->data.F32[y][x] = PS_SQR(image->data.F32[y][x]) * sysError2; 473 474 } 474 475 } 475 476 476 477 return sys; 477 #endif478 478 } 479 479 … … 1089 1089 bool pmSubtractionConvolve(pmReadout *out1, pmReadout *out2, const pmReadout *ro1, const pmReadout *ro2, 1090 1090 psImage *subMask, psMaskType maskBad, psMaskType maskPoor, float poorFrac, 1091 const psRegion *region, const pmSubtractionKernels *kernels,1091 float sysError, const psRegion *region, const pmSubtractionKernels *kernels, 1092 1092 bool doBG, bool useFFT) 1093 1093 { … … 1197 1197 psImage *sys1 = NULL, *sys2 = NULL; // Systematic error images 1198 1198 if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1199 sys1 = subtractionSysErrImage(ro1->image );1199 sys1 = subtractionSysErrImage(ro1->image, sysError); 1200 1200 if (threaded && sys1) { 1201 1201 psMutexInit(sys1); … … 1203 1203 } 1204 1204 if (kernels->mode == PM_SUBTRACTION_MODE_2 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1205 sys2 = subtractionSysErrImage(ro2->image );1205 sys2 = subtractionSysErrImage(ro2->image, sysError); 1206 1206 if (threaded && sys2) { 1207 1207 psMutexInit(sys2);
Note:
See TracChangeset
for help on using the changeset viewer.
