- Timestamp:
- Aug 21, 2011, 10:44:17 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/psphot/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psphotRadiusChecks.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/psphot/src
- Property svn:ignore
-
old new 22 22 psphotMakePSF 23 23 psphotStack 24 psphotModelTest
-
- Property svn:ignore
-
branches/eam_branches/ipp-20110710/psphot/src/psphotRadiusChecks.c
r31990 r32157 144 144 # define MIN_WINDOW 5.0 145 145 # define SCALE1 5.0 146 # define SCALE2 12. 5146 # define SCALE2 12.0 147 147 148 148 // call this function whenever you (re)-define the EXT model 149 // XXX this function does not shrink the window 149 150 bool psphotSetRadiusMoments (float *fitRadius, float *windowRadius, pmReadout *readout, pmSource *source, psImageMaskType markVal) { 150 151 … … 160 161 // redefine the pixels if needed 161 162 pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, *windowRadius); 163 164 // set the mask to flag the excluded pixels 165 psImageKeepCircle (source->maskObj, source->peak->xf, source->peak->yf, *fitRadius, "OR", markVal); 166 167 return true; 168 } 169 # undef SCALE1 170 # undef SCALE2 171 # undef MIN_WINDOW 172 173 # define MIN_WINDOW 5.0 174 # define SCALE1 5.0 175 # define PAD_WINDOW 3.0 176 177 // call this function whenever you (re)-define the EXT model 178 // XXX alternate function to set exactly the desired window size 179 bool psphotSetRadiusMomentsExact (float *fitRadius, float *windowRadius, pmReadout *readout, pmSource *source, psImageMaskType markVal) { 180 181 psRegion newRegion; 182 183 psAssert (source, "source not defined??"); 184 psAssert (source->moments, "moments not defined??"); 185 186 *fitRadius = SCALE1 * source->moments->Mrf; 187 *fitRadius = PS_MIN (PS_MAX(*fitRadius, MIN_WINDOW), EXT_FIT_MAX_RADIUS); 188 189 *windowRadius = *fitRadius + PAD_WINDOW; 190 191 // check to see if new region is completely contained within old region 192 newRegion = psRegionForSquare (source->peak->xf, source->peak->yf, *windowRadius); 193 newRegion = psRegionForImage (readout->image, newRegion); 194 195 // redefine the pixels to match 196 pmSourceRedefinePixelsByRegion (source, readout, newRegion); 162 197 163 198 // set the mask to flag the excluded pixels
Note:
See TracChangeset
for help on using the changeset viewer.
