Changeset 25027 for branches/pap/ppStack/src/ppStackMatch.c
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ppStack
- Property svn:mergeinfo deleted
-
branches/pap/ppStack/src/ppStackMatch.c
r23573 r25027 209 209 pmFPAview *view = pmFPAviewAlloc(0); // View to readout of interest 210 210 view->chip = view->cell = view->readout = 0; 211 psString filename = pmFPAfileNameFromRule(file rule->rule, file, view); // Filename of interest211 psString filename = pmFPAfileNameFromRule(file->filerule, file, view); // Filename of interest 212 212 213 213 // Read convolution kernel … … 241 241 !readImage(&readout->variance, options->varianceNames->data[index], config)) { 242 242 psError(PS_ERR_IO, false, "Unable to read previously produced image."); 243 psFree(imageName);244 psFree(maskName);245 psFree(varianceName);246 243 return false; 247 244 } 248 psFree(imageName);249 psFree(maskName);250 psFree(varianceName);251 245 252 246 psRegion *region = psMetadataLookupPtr(NULL, conv->analysis, … … 317 311 } 318 312 313 fake->mask = psImageCopy(NULL, readout->mask, PS_TYPE_IMAGE_MASK); 314 319 315 // Add the background into the target image 320 316 psImage *bgImage = stackBackgroundModel(readout, config); // Image of background … … 361 357 psFree(stampSources); 362 358 psFree(conv); 359 if (threads > 0) { 360 pmSubtractionThreadsFinalize(readout, fake); 361 } 363 362 return false; 364 363 } … … 375 374 psFree(stampSources); 376 375 psFree(conv); 376 if (threads > 0) { 377 pmSubtractionThreadsFinalize(readout, fake); 378 } 377 379 return false; 378 380 } … … 510 512 psBinaryOp(readout->variance, readout->variance, "*", psScalarAlloc(PS_SQR(norm), PS_TYPE_F32)); 511 513 } 512 514 513 515 // Ensure the background value is zero 514 516 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background 515 517 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 516 518 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) { 517 psWarning("Can't measure background for image.");518 psErrorClear();519 psWarning("Can't measure background for image."); 520 psErrorClear(); 519 521 } else { 520 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 521 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 522 (void)psBinaryOp(readout->image, readout->image, "-", 523 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 524 } 522 if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) { 523 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 524 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 525 (void)psBinaryOp(readout->image, readout->image, "-", 526 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 527 } 528 } 529 525 530 526 531 // Measure the variance level for the weighting
Note:
See TracChangeset
for help on using the changeset viewer.
