- Timestamp:
- Mar 29, 2010, 3:55:49 PM (16 years ago)
- Location:
- branches/eam_branches/20100225
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppStack/src/ppStackMatch.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225
- Property svn:mergeinfo changed
-
branches/eam_branches/20100225/ppStack/src/ppStackMatch.c
r27004 r27517 18 18 #define COVAR_FRAC 0.01 // Truncation fraction for covariance matrix 19 19 20 // #define TESTING // Enable debugging output20 // #define TESTING // Enable debugging output 21 21 22 22 #ifdef TESTING … … 115 115 psFree(coords); 116 116 psFree(tree); 117 psFree(x); 118 psFree(y); 117 119 118 120 psLogMsg("ppStack", PS_LOG_INFO, "Filtered out %d of %d sources", numFiltered, numGood); … … 151 153 if (!psImageUnbin(unbinned, binned, binning)) { 152 154 psError(PPSTACK_ERR_DATA, false, "Unable to unbin background model"); 155 psFree(binned); 153 156 psFree(unbinned); 154 157 return NULL; 155 158 } 156 157 // XXX should these really be here?? (probably not...) 158 // pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL"); 159 // pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL.STDEV"); 160 161 return unbinned; 159 psFree(binned); 160 161 return unbinned; 162 162 } 163 163 … … 407 407 408 408 if (threads > 0) { 409 pmSubtractionThreadsInit( readout, fake);409 pmSubtractionThreadsInit(); 410 410 } 411 411 … … 423 423 psFree(conv); 424 424 if (threads > 0) { 425 pmSubtractionThreadsFinalize( readout, fake);425 pmSubtractionThreadsFinalize(); 426 426 } 427 427 return false; … … 440 440 psFree(widthsCopy); 441 441 if (threads > 0) { 442 pmSubtractionThreadsFinalize( readout, fake);442 pmSubtractionThreadsFinalize(); 443 443 } 444 444 return false; … … 458 458 psFree(widthsCopy); 459 459 if (threads > 0) { 460 pmSubtractionThreadsFinalize( readout, fake);460 pmSubtractionThreadsFinalize(); 461 461 } 462 462 return false; … … 495 495 496 496 if (threads > 0) { 497 pmSubtractionThreadsFinalize( readout, fake);497 pmSubtractionThreadsFinalize(); 498 498 } 499 499 … … 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.
