- Timestamp:
- Sep 23, 2009, 11:17:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src/psphotRadiusChecks.c
r25433 r25497 35 35 } 36 36 } 37 model-> radiusFit= (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING);37 model->fitRadius = (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING); 38 38 39 if (isnan(model-> radiusFit)) psAbort("error in radius");39 if (isnan(model->fitRadius)) psAbort("error in radius"); 40 40 41 41 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 42 model-> radiusFit*= 2;42 model->fitRadius *= 2; 43 43 } 44 44 45 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->radiusFit); 45 source->apRadius = model->fitRadius; 46 // XXX for now, use the same radius for aperture and fit 47 // XXX to use different radii, we will need to set the apRadius mask with a call to 48 // psImageKeepCircle in the function psphotMagnitudes_Threaded 49 50 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius); 46 51 47 52 // set the mask to flag the excluded pixels 48 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit, "OR", markVal);53 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, "OR", markVal); 49 54 return status; 50 55 } … … 58 63 59 64 // set the fit radius based on the object flux limit and the model 60 model-> radiusFit= (RADIUS_TYPE) (model->modelRadius (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING);61 if (isnan(model-> radiusFit)) psAbort("error in radius");65 model->fitRadius = (RADIUS_TYPE) (model->modelRadius (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING); 66 if (isnan(model->fitRadius)) psAbort("error in radius"); 62 67 63 68 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 64 model-> radiusFit*= 2;69 model->fitRadius *= 2; 65 70 } 66 71 67 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->radiusFit); 72 source->apRadius = model->fitRadius; 73 // XXX for now, use the same radius for aperture and fit 74 // XXX to use different radii, we will need to set the apRadius mask with a call to 75 // psImageKeepCircle in the function psphotMagnitudes_Threaded 76 77 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius); 68 78 69 79 // set the mask to flag the excluded pixels 70 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit, "OR", markVal);80 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, "OR", markVal); 71 81 return status; 72 82 } … … 141 151 float rawRadius = model->modelRadius (model->params, EXT_FIT_NSIGMA*moments->dSky); 142 152 143 model->radiusFit = rawRadius + EXT_FIT_PADDING; 144 if (isnan(model->radiusFit)) psAbort("error in radius"); 153 model->fitRadius = rawRadius + EXT_FIT_PADDING; 154 if (isnan(model->fitRadius)) psAbort("error in radius"); 155 156 // XXX this make the psf photometry for extended sources inconsistent with the other psf sources 157 // XXX for now, use the same radius for aperture and fit 158 // XXX to use different radii, we will need to set the apRadius mask with a call to 159 // psImageKeepCircle in the function psphotMagnitudes_Threaded 145 160 146 161 // redefine the pixels if needed 147 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit);162 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius); 148 163 149 164 // set the mask to flag the excluded pixels 150 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit, "OR", markVal);165 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, "OR", markVal); 151 166 return status; 152 167 }
Note:
See TracChangeset
for help on using the changeset viewer.
