Changeset 27105 for trunk/ppStack/src/ppStackMatch.c
- Timestamp:
- Feb 26, 2010, 2:27:07 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r27004 r27105 628 628 629 629 // Measure the variance level for the weighting 630 if (!psImageBackground(bg, NULL, readout->variance, readout->mask, maskVal | maskBad, rng)) { 631 psError(PPSTACK_ERR_DATA, false, "Can't measure mean variance for image."); 632 psFree(rng); 633 psFree(bg); 634 return false; 635 } 636 options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) * 637 psImageCovarianceFactor(readout->covariance)); 630 if (psMetadataLookupBool(NULL, recipe, "WEIGHTS")) { 631 if (!psImageBackground(bg, NULL, readout->variance, readout->mask, maskVal | maskBad, rng)) { 632 psError(PPSTACK_ERR_DATA, false, "Can't measure mean variance for image."); 633 psFree(rng); 634 psFree(bg); 635 return false; 636 } 637 options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) * 638 psImageCovarianceFactor(readout->covariance)); 639 } else { 640 options->weightings->data.F32[index] = 1.0; 641 } 638 642 psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f\n", 639 643 index, options->weightings->data.F32[index]); 640 psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "PPSTACK.WEIGHTING", 0,641 "Weighting by 1/noise^2 for stack", options->weightings->data.F32[index]);642 644 643 645 psFree(rng);
Note:
See TracChangeset
for help on using the changeset viewer.
