Changeset 30931
- Timestamp:
- Mar 16, 2011, 1:32:43 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psModules/src/objects
- Files:
-
- 8 edited
-
pmSourceIO_CMF_PS1_DV1.c (modified) (1 diff)
-
pmSourceIO_CMF_PS1_DV2.c (modified) (1 diff)
-
pmSourceIO_CMF_PS1_SV1.c (modified) (2 diffs)
-
pmSourceIO_CMF_PS1_V1.c (modified) (1 diff)
-
pmSourceIO_CMF_PS1_V2.c (modified) (1 diff)
-
pmSourceIO_CMF_PS1_V3.c (modified) (1 diff)
-
pmSourceOutputs.c (modified) (3 diffs)
-
pmSourceOutputs.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.c
r30763 r30931 292 292 293 293 source->moments = pmMomentsAlloc (); 294 source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf 295 source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf 296 294 297 source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX"); 295 298 source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY"); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV2.c
r30763 r30931 311 311 312 312 source->moments = pmMomentsAlloc (); 313 source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf 314 source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf 315 313 316 source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX"); 314 317 source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY"); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_SV1.c
r30775 r30931 310 310 311 311 source->moments = pmMomentsAlloc (); 312 source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf 313 source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf 314 312 315 source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX"); 313 316 source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY"); … … 753 756 assert (radialAper); 754 757 755 bool useMoments = true; 756 useMoments = (useMoments && source->moments); // can't if there are no moments 757 useMoments = (useMoments && source->moments->nPixels); // can't if the moments were not measured 758 useMoments = (useMoments && !(source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE)); // can't if the moments failed... 759 760 if (useMoments) { 758 if (pmSourcePositionUseMoments(source)) { 761 759 xPos = source->moments->Mx; 762 760 yPos = source->moments->My; -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
r30763 r30931 277 277 278 278 source->moments = pmMomentsAlloc (); 279 source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf 280 source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf 281 279 282 source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX"); 280 283 source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY"); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c
r30763 r30931 283 283 284 284 source->moments = pmMomentsAlloc (); 285 source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf 286 source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf 287 285 288 source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX"); 286 289 source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY"); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c
r30865 r30931 307 307 308 308 source->moments = pmMomentsAlloc (); 309 source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf 310 source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf 311 309 312 source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX"); 310 313 source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY"); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c
r30865 r30931 77 77 } 78 78 79 // what is the correct postion? 80 // * if we have a PSF model fit, use PM_PAR_XPOS,YPOS for X_PSF,Y_PSF 81 // * if we do not have a model: 82 // ** if we have moments: 83 // *** if the star is saturated, use the moments 84 // *** if the moments and peak agree to < DR, use the moments 85 // *** otherwise, use the peak 86 79 87 bool pmSourceOutputsSetValues (pmSourceOutputs *outputs, pmSource *source, pmChip *chip, float fwhmMajor, float fwhmMinor, float magOffset) { 80 88 … … 112 120 outputs->apRadius = source->apRadius; 113 121 } else { 114 bool useMoments = true; 115 useMoments = (useMoments && source->moments); // can't if there are no moments 116 useMoments = (useMoments && source->moments->nPixels); // can't if the moments were not measured 117 useMoments = (useMoments && !(source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE)); // can't if the moments failed... 122 bool useMoments = pmSourcePositionUseMoments(source); 118 123 119 124 if (useMoments) { … … 175 180 return true; 176 181 } 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
r30865 r30931 60 60 bool pmSourceOutputsSetMoments (pmSourceOutputsMoments *moments, pmSource *source); 61 61 62 bool pmSourcePositionUseMoments(pmSource *source); 63 62 64 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
