Changeset 35038 for trunk/psphot/src
- Timestamp:
- Jan 23, 2013, 3:08:32 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSourceSize.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSourceSize.c
r34769 r35038 13 13 bool altDiffExt; 14 14 float altDiffExtThresh; 15 bool extFitAll; 16 bool extFitAllReadout; 17 float extFitAllThresh; 15 18 float soft; 16 19 int grow; … … 127 130 // Threshold for this alternate method 128 131 options.altDiffExtThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.DIFF.ALTERNATE.THRESH"); 132 assert (status); 133 // Option to enable fitting of all objects with extended model. 134 options.extFitAll = psMetadataLookupBool(&status, recipe, "PSPHOT.EXT.FIT.ALL.SOURCES"); 135 assert (status); 136 // Fitting everything is fine, but if the source density is high, we probably shouldn't. 137 options.extFitAllThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.FIT.ALL.THRESH"); 129 138 assert (status); 130 139 … … 413 422 414 423 psLogMsg("psModules.objects", PS_LOG_INFO, "Source Size classifications: %4s %4s %4s %4s %4s", "Npsf", "Next", "Nsat", "Ncr", "Nskip"); 415 424 // Determine if this readout is above the threshold to ext fit all sources 425 if (options->extFitAll) { 426 float maskFrac = psMetadataLookupF32(&status,readout->analysis,"READOUT.MASK.FRAC"); 427 if (status) { 428 maskFrac = 0.0; 429 } 430 if (sources->n * (1.0 - maskFrac) > options->extFitAllThresh) { 431 options->extFitAllReadout = false; 432 } 433 else { 434 options->extFitAllReadout = true; 435 } 436 } 437 416 438 if (!psphotSourceClassRegion (NULL, &psfClump, sources, recipe, psf, options)) { 417 439 psLogMsg ("psphot", 4, "Failed to determine source classification for full image\n"); … … 420 442 } 421 443 return true; 422 444 423 445 int nRegions = psMetadataLookupS32 (&status, readout->analysis, "PSF.CLUMP.NREGIONS"); 424 446 for (int i = 0; i < nRegions; i ++) { … … 426 448 psMetadata *regionMD = psMetadataLookupPtr (&status, readout->analysis, regionName); 427 449 psAssert (regionMD, "regions must be defined by earlier call to psphotRoughClassRegion"); 428 450 429 451 psRegion *region = psMetadataLookupPtr (&status, regionMD, "REGION"); 430 452 psAssert (region, "regions must be defined by earlier call to psphotRoughClassRegion"); 431 453 432 454 // pull FWHM_X,Y from the recipe, use to define psfClump.X,Y 433 455 psfClump.X = psMetadataLookupF32 (&status, regionMD, "PSF.CLUMP.X"); psAssert (status, "missing PSF.CLUMP.X"); … … 559 581 // * SAT stars should not be faint, but defects may? 560 582 583 // If the recipe requests we do extended source fits to everything, set 584 // the EXT_LIMIT flag 585 if (options->extFitAllReadout) { 586 source->mode |= PM_SOURCE_MODE_EXT_LIMIT; 587 } 561 588 // Defects may not always match CRs from peak curvature analysis 562 589 // Defects may also be marked as SATSTAR -- XXX deactivate this flag?
Note:
See TracChangeset
for help on using the changeset viewer.
