Changeset 25045 for trunk/ppStack/src/ppStackMatch.c
- Timestamp:
- Aug 10, 2009, 5:02:43 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r24846 r25045 222 222 } 223 223 psFitsClose(fits); 224 225 // Add in variance factor226 pmSubtractionKernels *kernels = psMetadataLookupPtr(NULL, conv->analysis,227 PM_SUBTRACTION_ANALYSIS_KERNEL); // Kernels228 float vf = pmSubtractionVarianceFactor(kernels, 0.0, 0.0, false); // Variance factor229 psMetadataItem *vfItem = psMetadataLookup(readout->parent->concepts, "CELL.VARFACTOR");230 if (!isfinite(vf)) {231 vf = 1.0;232 }233 if (isfinite(vfItem->data.F32)) {234 vfItem->data.F32 *= vf;235 } else {236 vfItem->data.F32 = vf;237 }238 224 239 225 if (!readImage(&readout->image, options->imageNames->data[index], config) || … … 413 399 } 414 400 415 // Set the variance factor416 psMetadataItem *vfItem = psMetadataLookup(readout->parent->concepts, "CELL.VARFACTOR");417 float vf = psMetadataLookupF32(NULL, conv->analysis, PM_SUBTRACTION_ANALYSIS_VARFACTOR_1);418 if (!isfinite(vf)) {419 vf = 1.0;420 }421 if (isfinite(vfItem->data.F32)) {422 vfItem->data.F32 *= vf;423 } else {424 vfItem->data.F32 = vf;425 }426 427 401 // Replace original images with convolved 428 402 psFree(readout->image); … … 512 486 psBinaryOp(readout->variance, readout->variance, "*", psScalarAlloc(PS_SQR(norm), PS_TYPE_F32)); 513 487 } 514 488 515 489 // Ensure the background value is zero 516 490 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background … … 521 495 } else { 522 496 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));497 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 498 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 499 (void)psBinaryOp(readout->image, readout->image, "-", 500 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 527 501 } 528 502 } 529 503 530 504 531 505 // Measure the variance level for the weighting
Note:
See TracChangeset
for help on using the changeset viewer.
