Changeset 26076 for trunk/ppStack/src/ppStackMatch.c
- Timestamp:
- Nov 9, 2009, 2:53:12 PM (17 years ago)
- Location:
- trunk/ppStack
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/ppStackMatch.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/czw_branch/cleanup/ppStack merged eligible /branches/eam_branches/20090522/ppStack merged eligible /branches/eam_branches/20090715/ppStack merged eligible /branches/eam_branches/20090820/ppStack merged eligible /branches/pap/ppStack merged eligible /branches/pap_mops/ppStack 25137-25255
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/ppStack/src/ppStackMatch.c
r26074 r26076 167 167 ) 168 168 { 169 #if 1 169 170 bool mdok; // Status of metadata lookups 170 171 … … 192 193 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask 193 194 195 psImageCovarianceTransfer(readout->variance, readout->covariance); 194 196 return pmReadoutVarianceRenormalise(readout, maskBad, num, minValid, maxValid); 197 #else 198 return true; 199 #endif 195 200 } 196 201 … … 212 217 int size = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size 213 218 214 psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in219 psString maskValStr = psMetadataLookupStr(NULL, ppsub, "MASK.VAL"); // Name of bits to mask going in 215 220 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch 216 221 psString maskPoorStr = psMetadataLookupStr(NULL, recipe, "MASK.POOR"); // Name of bits to mask for poor … … 257 262 psFitsClose(fits); 258 263 259 if (!readImage(&readout->image, options-> imageNames->data[index], config) ||260 !readImage(&readout->mask, options-> maskNames->data[index], config) ||261 !readImage(&readout->variance, options-> varianceNames->data[index], config)) {264 if (!readImage(&readout->image, options->convImages->data[index], config) || 265 !readImage(&readout->mask, options->convMasks->data[index], config) || 266 !readImage(&readout->variance, options->convVariances->data[index], config)) { 262 267 psError(PS_ERR_IO, false, "Unable to read previously produced image."); 263 268 return false; … … 378 383 } 379 384 #endif 385 386 fprintf(stderr, "vf = %f\n", psImageCovarianceFactor(readout->covariance)); 387 380 388 381 389 if (threads > 0) { … … 517 525 psFree(iter); 518 526 options->matchChi2->data.F32[index] = sum / (psImageCovarianceFactor(readout->covariance) * num); 527 fprintf(stderr, "chi2 = %f ; vf = %f\n", sum/num, psImageCovarianceFactor(readout->covariance)); 519 528 } 520 529 … … 543 552 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 544 553 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) { 545 psWarning("Can't measure background for image.");546 psErrorClear();554 psWarning("Can't measure background for image."); 555 psErrorClear(); 547 556 } else { 548 if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) {549 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",550 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));551 (void)psBinaryOp(readout->image, readout->image, "-",552 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));553 }557 if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) { 558 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 559 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 560 (void)psBinaryOp(readout->image, readout->image, "-", 561 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 562 } 554 563 } 555 564 … … 569 578 options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) * 570 579 psImageCovarianceFactor(readout->covariance)); 580 psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f\n", 581 index, options->weightings->data.F32[index]); 571 582 psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "PPSTACK.WEIGHTING", 0, 572 583 "Weighting by 1/noise^2 for stack", options->weightings->data.F32[index]);
Note:
See TracChangeset
for help on using the changeset viewer.
