Changeset 30932
- Timestamp:
- Mar 16, 2011, 1:34:32 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psphot/src
- Files:
-
- 3 edited
-
psphotCullPeaks.c (modified) (3 diffs)
-
psphotGuessModels.c (modified) (1 diff)
-
psphotRadialApertures.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psphot/src/psphotCullPeaks.c
r30903 r30932 1 1 # include "psphotInternal.h" 2 3 # define CULL_WITH_SMOOTHED_IMAGE 1 2 4 3 5 /* … … 61 63 float SAT_THRESHOLD = 0.05*SATURATION; 62 64 65 # if (CULL_WITH_SMOOTHED_IMAGE) 66 psLogMsg ("psphot", PS_LOG_INFO, "Culling peaks from footprints using the smoothed image"); 67 # else 68 psLogMsg ("psphot", PS_LOG_INFO, "Culling peaks from footprints using the raw (unsmoothed) image"); 69 # endif 70 63 71 for (int i = 0; i < footprints->n; i++) { 64 72 pmFootprint *fp = footprints->data[i]; … … 78 86 } 79 87 80 // if we cull using the significance image, then the thresholds are different 88 # if (CULL_WITH_SMOOTHED_IMAGE) 89 // New (post r30869) style of culling using the smoothed image and variance (S/N) 90 // if we cull using the significance image, then the definition of variance is different (thus the bool in arg 8) 91 if (pmFootprintCullPeaks(signifR->image, signifR->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, false) != PS_ERR_NONE) { 92 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 93 } 94 # else 95 // Old (pre r30869) style of culling using the raw image and variance 96 if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) { 97 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 98 } 99 # endif 100 101 // Alternate style of culling using the smoothed image and raw variance (probably a bad idea) 81 102 # if (0) 82 103 if (pmFootprintCullPeaks(signifR->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) { 83 104 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 84 }85 # endif86 # if (1)87 if (pmFootprintCullPeaks(signifR->image, signifR->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, false) != PS_ERR_NONE) {88 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);89 }90 # endif91 # if (0)92 if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) {93 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);94 105 } 95 106 # endif -
branches/eam_branches/ipp-20110213/psphot/src/psphotGuessModels.c
r30867 r30932 182 182 // moments 183 183 184 # if (1) 185 bool useMoments = true; 186 # else 187 bool useMoments = false; 188 useMoments = (source->mode & PM_SOURCE_MODE_SATSTAR); // we only want to try if SATSTAR is set, but.. 189 # endif 190 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 184 bool useMoments = pmSourcePositionUseMoments(source); 200 185 201 186 float Xo, Yo; -
branches/eam_branches/ipp-20110213/psphot/src/psphotRadialApertures.c
r30720 r30932 176 176 } 177 177 178 // center of the apertures 179 float xCM = source->moments->Mx - 0.5 - source->pixels->col0; // coord of peak in subimage 180 float yCM = source->moments->My - 0.5 - source->pixels->row0; // coord of peak in subimage 178 float xCM = NAN, yCM = NAN; 179 if (pmSourcePositionUseMoments(source)) { 180 xCM = source->moments->Mx - 0.5 - source->pixels->col0; // coord of peak in subimage 181 yCM = source->moments->My - 0.5 - source->pixels->row0; // coord of peak in subimage 182 } else { 183 xCM = source->peak->xf - 0.5 - source->pixels->col0; // coord of peak in subimage 184 yCM = source->peak->yf - 0.5 - source->pixels->row0; // coord of peak in subimage 185 } 181 186 182 187 // one pass through the pixels to select the valid pixels and calculate R^2
Note:
See TracChangeset
for help on using the changeset viewer.
