IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30935


Ignore:
Timestamp:
Mar 16, 2011, 3:41:54 PM (15 years ago)
Author:
eugene
Message:

fix build errors for pmSourcePosition...

Location:
branches/eam_branches/ipp-20110213/psModules/src/objects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c

    r30882 r30935  
    11621162    }
    11631163    return NULL;
     1164}
     1165
     1166// this function decides if the source position should be based on the peak or the moments.
     1167// this is only used if we know we should not use a model fit position (eg, no model, or no
     1168// model yet)
     1169bool pmSourcePositionUseMoments(pmSource *source) {
     1170
     1171    if (!source->moments) return false;          // can't if there are no moments
     1172    if (!source->moments->nPixels) return false; // can't if the moments were not measured
     1173    if (source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE) return false; // can't if the moments failed...
     1174
     1175    if (source->mode & PM_SOURCE_MODE_SATSTAR) return true; // moments are best for SATSTARs
     1176
     1177    float dX = source->moments->Mx - source->peak->xf;
     1178    float dY = source->moments->My - source->peak->yf;
     1179    float dR = hypot(dX, dY);
     1180   
     1181    // only use the moments position if the moment-peak offset is small or the star is saturated
     1182    if (dR > 1.5) return false;
     1183
     1184    return true;
    11641185}
    11651186
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.h

    r30882 r30935  
    287287bool pmSourceCachePSF (pmSource *source, psImageMaskType maskVal);
    288288
     289bool pmSourcePositionUseMoments(pmSource *source);
     290
    289291int  pmSourceSortByY (const void **a, const void **b);
    290292int  pmSourceSortByX (const void **a, const void **b);
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c

    r30931 r30935  
    180180    return true;
    181181}
    182 
    183 // this function decides if the source position should be based on the peak or the moments.
    184 // this is only used if we know we should not use a model fit position (eg, no model, or no
    185 // model yet)
    186 bool pmSourcePositionUseMoments(pmSource *source) {
    187 
    188     if (!source->moments) return false;          // can't if there are no moments
    189     if (!source->moments->nPixels) return false; // can't if the moments were not measured
    190     if (source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE) return false; // can't if the moments failed...
    191 
    192     if (source->mode & PM_SOURCE_MODE_SATSTAR) return true; // moments are best for SATSTARs
    193 
    194     float dX = source->moments->Mx - source->peak->xf;
    195     float dY = source->moments->My - source->peak->yf;
    196     float dR = hypot(dX, dY);
    197    
    198     // only use the moments position if the moment-peak offset is small or the star is saturated
    199     if (dR > 1.5) return false
    200 
    201     return true;
    202 }
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.h

    r30931 r30935  
    6060bool pmSourceOutputsSetMoments (pmSourceOutputsMoments *moments, pmSource *source);
    6161
    62 bool pmSourcePositionUseMoments(pmSource *source);
    63 
    6462# endif
Note: See TracChangeset for help on using the changeset viewer.