Changeset 26007 for branches/pap/ppStack/src/ppStackMatch.c
- Timestamp:
- Nov 2, 2009, 5:08:31 PM (17 years ago)
- File:
-
- 1 edited
-
branches/pap/ppStack/src/ppStackMatch.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppStack/src/ppStackMatch.c
r25959 r26007 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 … … 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 … … 377 382 } 378 383 #endif 384 385 fprintf(stderr, "vf = %f\n", psImageCovarianceFactor(readout->covariance)); 386 379 387 380 388 if (threads > 0) { … … 516 524 psFree(iter); 517 525 options->matchChi2->data.F32[index] = sum / (psImageCovarianceFactor(readout->covariance) * num); 526 fprintf(stderr, "chi2 = %f ; vf = %f\n", sum/num, psImageCovarianceFactor(readout->covariance)); 518 527 } 519 528 … … 542 551 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 543 552 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) { 544 psWarning("Can't measure background for image.");545 psErrorClear();553 psWarning("Can't measure background for image."); 554 psErrorClear(); 546 555 } else { 547 if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) {548 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",549 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));550 (void)psBinaryOp(readout->image, readout->image, "-",551 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));552 }556 if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) { 557 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 558 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 559 (void)psBinaryOp(readout->image, readout->image, "-", 560 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 561 } 553 562 } 554 563
Note:
See TracChangeset
for help on using the changeset viewer.
