IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 9, 2025, 11:28:49 AM (12 months ago)
Author:
eugene
Message:

optionally allow PSF star positions to be fitted during PSF model construction (default false); option to allow PSF clump analysis to use clipped stats (default) or robust stats; use select circular region of 2nd moment space, not square region; for bright (S/N > 25) externally-supplied sources, use the centroid (Mx,My) value instead of the peak

Location:
trunk/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

  • trunk/psModules/src/objects/pmSource.c

    r40810 r42843  
    407407*****************************************************************************/
    408408
    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)
     409pmPSFClump 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)
    410410{
    411411    psTrace("psModules.objects", 10, "---- begin ----\n");
     
    455455                continue;
    456456            }
     457
     458            // skip sources associated with possible detector features
     459            if (source->mode2 & PM_SOURCE_MODE2_ON_LINE) continue;
    457460
    458461            float Mxx = source->moments->Mxx, Myy = source->moments->Myy; // Second moments
     
    598601        }
    599602
    600         // measures stats of Sx, Sy
    601         stats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV);
    602 
    603         if (!psVectorStats (stats, tmpSx, NULL, NULL, 0)) {
    604             psError(PS_ERR_UNKNOWN, false, "failed to measure Sx stats");
    605             return (emptyClump);
    606         }
    607         psfClump.X  = stats->clippedMean;
    608         psfClump.dX = hypot(stats->clippedStdev, PSF_CLUMP_GRID_SCALE);
    609 
    610         if (!psVectorStats (stats, tmpSy, NULL, NULL, 0)) {
    611             psError(PS_ERR_UNKNOWN, false, "failed to measure Sy stats");
    612             return (emptyClump);
    613         }
    614         psfClump.Y  = stats->clippedMean;
    615         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);             
    616625
    617626        psTrace ("psModules.objects", 2, "clump  X,  Y: %f, %f\n", psfClump.X, psfClump.Y);
     
    746755            }
    747756
     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
    748761            // likely unsaturated extended source (too large to be stellar)
    749             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) {
    750765                source->type = PM_SOURCE_TYPE_EXTENDED;
    751766                Next ++;
    752767                continue;
    753768            }
     769
     770            // skip sources associated with possible detector features
     771            if (source->mode2 & PM_SOURCE_MODE2_ON_LINE) continue;
    754772
    755773            // the rest are probable stellar objects
     
    762780
    763781            // PSF star (within 1.5 sigma of clump center, S/N > limit)
    764             psF32 radius = hypot ((sigX-clump.X)/clump.dX, (sigY-clump.Y)/clump.dY);
    765782            if ((source->moments->SN > PSF_SN_LIM) && (radius < PSF_CLUMP_NSIGMA)) {
    766783                source->type = PM_SOURCE_TYPE_STAR;
Note: See TracChangeset for help on using the changeset viewer.