IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30867


Ignore:
Timestamp:
Mar 10, 2011, 5:25:59 PM (15 years ago)
Author:
eugene
Message:

only use the moments-centroid for the source position guess if the moments and peak agree by 1.5 pixels or if the object is saturated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psphot/src/psphotGuessModels.c

    r30753 r30867  
    189189# endif
    190190
    191         useMoments = (useMoments && source->moments);          // can't if there are no moments
    192         useMoments = (useMoments && source->moments->nPixels); // can't if the moments were not measured
    193         useMoments = (useMoments && !(source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE)); // can't if the moments failed...
     191        float dX = source->moments->Mx - source->peak->xf;
     192        float dY = source->moments->My - source->peak->yf;
     193        float dR = hypot(dX, dY);
     194
     195        useMoments = useMoments && source->moments;          // can't if there are no moments
     196        useMoments = useMoments && source->moments->nPixels; // can't if the moments were not measured
     197        useMoments = useMoments && !(source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE); // can't if the moments failed...
     198        useMoments = useMoments && ((dR < 1.5) || (source->mode & PM_SOURCE_MODE_SATSTAR));
     199        // only use the moments position if the moment-peak offset is small or the star is saturated
    194200
    195201        float Xo, Yo;
Note: See TracChangeset for help on using the changeset viewer.