Changeset 23937 for trunk/psModules/src/imcombine/pmSubtractionMatch.c
- Timestamp:
- Apr 20, 2009, 2:48:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r23851 r23937 64 64 psImage *variance, // Variance map 65 65 const psRegion *region, // Region of interest, or NULL 66 float threshold, // Threshold for stamp finding 66 float thresh1, // Threshold for stamp finding on readout 1 67 float thresh2, // Threshold for stamp finding on readout 2 67 68 float stampSpacing, // Spacing between stamps 68 69 int size, // Kernel half-size … … 72 73 { 73 74 psTrace("psModules.imcombine", 3, "Finding stamps...\n"); 74 *stamps = pmSubtractionStampsFind(*stamps, ro1->image, subMask, region, threshold, size, footprint, 75 stampSpacing, mode); 75 76 psImage *image1 = ro1 ? ro1->image : NULL, *image2 = ro2 ? ro2->image : NULL; // Images of interest 77 78 *stamps = pmSubtractionStampsFind(*stamps, image1, image2, subMask, region, thresh1, thresh2, 79 size, footprint, stampSpacing, mode); 76 80 if (!*stamps) { 77 81 psError(psErrorCodeLast(), false, "Unable to find stamps."); … … 392 396 } 393 397 398 float stampThresh1 = NAN, stampThresh2 = NAN; // Stamp thresholds for images 394 399 { 395 400 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for backgroun 396 if (!psImageBackground(bg, NULL, ro1->image, ro1->mask, maskVal, rng)) { 397 psError(PS_ERR_UNKNOWN, false, "Unable to measure background statistics."); 398 psFree(bg); 399 psFree(rng); 400 goto MATCH_ERROR; 401 } 402 threshold = bg->robustMedian + threshold * bg->robustStdev; 401 if (ro1) { 402 if (!psImageBackground(bg, NULL, ro1->image, ro1->mask, maskVal, rng)) { 403 psError(PS_ERR_UNKNOWN, false, "Unable to measure background statistics."); 404 psFree(bg); 405 psFree(rng); 406 goto MATCH_ERROR; 407 } 408 stampThresh1 = bg->robustMedian + threshold * bg->robustStdev; 409 } 410 if (ro2) { 411 if (!psImageBackground(bg, NULL, ro2->image, ro2->mask, maskVal, rng)) { 412 psError(PS_ERR_UNKNOWN, false, "Unable to measure background statistics."); 413 psFree(bg); 414 psFree(rng); 415 goto MATCH_ERROR; 416 } 417 stampThresh2 = bg->robustMedian + threshold * bg->robustStdev; 418 } 403 419 psFree(bg); 404 420 } … … 428 444 // We get the stamps here; we will also attempt to get stamps at the first iteration, but it 429 445 // doesn't matter. 430 if (!getStamps(&stamps, ro1, ro2, subMask, variance, NULL, threshold, stampSpacing,431 s ize, footprint, subMode)) {446 if (!getStamps(&stamps, ro1, ro2, subMask, variance, NULL, stampThresh1, stampThresh2, 447 stampSpacing, size, footprint, subMode)) { 432 448 goto MATCH_ERROR; 433 449 } … … 490 506 psLogMsg("psModules.imcombine", PS_LOG_INFO, "Iteration %d.", k); 491 507 492 if (!getStamps(&stamps, ro1, ro2, subMask, variance, region, threshold, stampSpacing,493 s ize, footprint, subMode)) {508 if (!getStamps(&stamps, ro1, ro2, subMask, variance, region, stampThresh1, stampThresh2, 509 stampSpacing, size, footprint, subMode)) { 494 510 goto MATCH_ERROR; 495 511 }
Note:
See TracChangeset
for help on using the changeset viewer.
