Changeset 42710
- Timestamp:
- Jul 5, 2024, 12:29:41 PM (2 years ago)
- Location:
- branches/eam_branches/ipp-20230313/psModules/src/objects
- Files:
-
- 6 edited
-
pmPSF.h (modified) (1 diff)
-
pmPSFtryFitEXT.c (modified) (1 diff)
-
pmSource.c (modified) (4 diffs)
-
pmSource.h (modified) (1 diff)
-
pmSourceFitModel.c (modified) (2 diffs)
-
pmSourceFitModel.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/psModules/src/objects/pmPSF.h
r36858 r42710 79 79 bool poissonErrorsParams; ///< use poission errors for model parameter fitting 80 80 81 bool fitPSFstarCoords; // Allow the PSF star positions to fit in the full fit? (pmPSFtryFitEXT) 81 82 bool chiFluxTrend; // Fit a trend in Chi2 as a function of flux? 82 83 pmSourceFitOptions *fitOptions; -
branches/eam_branches/ipp-20230313/psModules/src/objects/pmPSFtryFitEXT.c
r36856 r42710 73 73 74 74 // in this segment, we are fitting the full PSF model class (shape unconstrained) 75 options->fitOptions->mode = PM_SOURCE_FIT_EXT; 76 75 if (options->fitPSFstarCoords) { 76 options->fitOptions->mode = PM_SOURCE_FIT_FULL; 77 } else { 78 options->fitOptions->mode = PM_SOURCE_FIT_EXT; 79 } 77 80 // maskVal is used to test for rejected pixels, and must include markVal 78 81 maskVal |= markVal; -
branches/eam_branches/ipp-20230313/psModules/src/objects/pmSource.c
r42439 r42710 407 407 *****************************************************************************/ 408 408 409 pmPSFClump pmSourcePSFClump(psImage **savedImage, psRegion *region, psArray *sources, float PSF_SN_LIM, float PSF_CLUMP_GRID_SCALE, psF32 SX_MAX, psF32 SY_MAX, psF32 SX_MIN, psF32 SY_MIN, psF32 AR_MAX )409 pmPSFClump pmSourcePSFClump(psImage **savedImage, psRegion *region, psArray *sources, float PSF_SN_LIM, float PSF_CLUMP_GRID_SCALE, psF32 SX_MAX, psF32 SY_MAX, psF32 SX_MIN, psF32 SY_MIN, psF32 AR_MAX, bool useClippedMean) 410 410 { 411 411 psTrace("psModules.objects", 10, "---- begin ----\n"); … … 601 601 } 602 602 603 // measures stats of Sx, Sy 604 stats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV); 605 606 if (!psVectorStats (stats, tmpSx, NULL, NULL, 0)) { 607 psError(PS_ERR_UNKNOWN, false, "failed to measure Sx stats"); 608 return (emptyClump); 609 } 610 psfClump.X = stats->clippedMean; 611 psfClump.dX = hypot(stats->clippedStdev, PSF_CLUMP_GRID_SCALE); 612 613 if (!psVectorStats (stats, tmpSy, NULL, NULL, 0)) { 614 psError(PS_ERR_UNKNOWN, false, "failed to measure Sy stats"); 615 return (emptyClump); 616 } 617 psfClump.Y = stats->clippedMean; 618 psfClump.dY = hypot(stats->clippedStdev, PSF_CLUMP_GRID_SCALE); 603 // measures stats of Sx, Sy 604 if (useClippedMean) { 605 stats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV); 606 } else { 607 stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 608 } 609 610 if (!psVectorStats (stats, tmpSx, NULL, NULL, 0)) { 611 psError(PS_ERR_UNKNOWN, false, "failed to measure Sx stats"); 612 return (emptyClump); 613 } 614 psfClump.X = psStatsGetValue (stats, psStatsMeanOption (stats->options)); 615 psfClump.dX = psStatsGetValue (stats, psStatsStdevOption (stats->options)); 616 psfClump.dX = hypot(psfClump.dX, PSF_CLUMP_GRID_SCALE); 617 618 if (!psVectorStats (stats, tmpSy, NULL, NULL, 0)) { 619 psError(PS_ERR_UNKNOWN, false, "failed to measure Sy stats"); 620 return (emptyClump); 621 } 622 psfClump.Y = psStatsGetValue (stats, psStatsMeanOption (stats->options)); 623 psfClump.dY = psStatsGetValue (stats, psStatsStdevOption (stats->options)); 624 psfClump.dY = hypot(psfClump.dX, PSF_CLUMP_GRID_SCALE); 619 625 620 626 psTrace ("psModules.objects", 2, "clump X, Y: %f, %f\n", psfClump.X, psfClump.Y); … … 749 755 } 750 756 757 psF32 radius = hypot ((sigX-clump.X)/clump.dX, (sigY-clump.Y)/clump.dY); 758 759 // XXX this is crude cut to avoid using extended sources in the PSF model 760 // psphot will update this analysis based on the PSF - Kron mags 751 761 // likely unsaturated extended source (too large to be stellar) 752 if (sigX > clump.X + 3*clump.dX || sigY > clump.Y + 3*clump.dY) { 762 // XXX old test: if (sigX > clump.X + 3*clump.dX || sigY > clump.Y + 3*clump.dY) { 763 764 if (radius > 2.0) { 753 765 source->type = PM_SOURCE_TYPE_EXTENDED; 754 766 Next ++; … … 768 780 769 781 // PSF star (within 1.5 sigma of clump center, S/N > limit) 770 psF32 radius = hypot ((sigX-clump.X)/clump.dX, (sigY-clump.Y)/clump.dY);771 782 if ((source->moments->SN > PSF_SN_LIM) && (radius < PSF_CLUMP_NSIGMA)) { 772 783 source->type = PM_SOURCE_TYPE_STAR; -
branches/eam_branches/ipp-20230313/psModules/src/objects/pmSource.h
r37321 r42710 245 245 psF32 SX_MIN, 246 246 psF32 SY_MIN, 247 psF32 AR_MAX 247 psF32 AR_MAX, 248 bool useClippedMean ///< use clipped mean & stdev to define clump, else robust 248 249 ); 249 250 -
branches/eam_branches/ipp-20230313/psModules/src/objects/pmSourceFitModel.c
r42093 r42710 189 189 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_XPOS] = 0; 190 190 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_YPOS] = 0; 191 break; 192 case PM_SOURCE_FIT_FULL: 193 // PSFstar Full model fits all shape params and Xo, Yo, Io (not sky) 194 nParams = params->n - 1; 195 psVectorInit (constraint->paramMask, 0); 196 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_SKY] = 1; 191 197 break; 192 198 case PM_SOURCE_FIT_EXT: … … 270 276 model->nPar = nParams; 271 277 272 psTrace ("psModules.objects", 4, "niter: %d, chisq: %f ", myMin->iter, myMin->value);278 psTrace ("psModules.objects", 4, "niter: %d, chisq: %f, status: %d", myMin->iter, myMin->value, fitStatus); 273 279 274 280 // save the resulting chisq, nDOF, nIter -
branches/eam_branches/ipp-20230313/psModules/src/objects/pmSourceFitModel.h
r42093 r42710 18 18 PM_SOURCE_FIT_PSF, 19 19 PM_SOURCE_FIT_EXT, 20 PM_SOURCE_FIT_FULL, 20 21 PM_SOURCE_FIT_PSF_AND_SKY, 21 22 PM_SOURCE_FIT_EXT_AND_SKY,
Note:
See TracChangeset
for help on using the changeset viewer.
