Changeset 10137 for trunk/psphot/src/psphotRadiusChecks.c
- Timestamp:
- Nov 22, 2006, 4:27:14 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotRadiusChecks.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotRadiusChecks.c
r10053 r10137 4 4 static float PSF_FIT_NSIGMA; 5 5 static float PSF_FIT_PADDING; 6 static float PSF_FIT_RADIUS = 0; // radius to use in fitting (ignored if <= 0, 7 // and a per-object radius is calculated) 6 8 static pmModelRadius modelRadiusPSF; 7 9 8 bool psphotInitRadiusPSF (psMetadata *recipe, pmModelType type) { 10 bool psphotInitRadiusPSF(const psMetadata *recipe, 11 const pmModelType type) 12 { 13 bool status = true; 9 14 10 bool status; 11 12 PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, recipe, "PSF_FIT_NSIGMA"); 13 PSF_FIT_PADDING = psMetadataLookupF32 (&status, recipe, "PSF_FIT_PADDING"); 15 PSF_FIT_NSIGMA = psMetadataLookupF32(&status, recipe, "PSF_FIT_NSIGMA"); 16 PSF_FIT_PADDING = psMetadataLookupF32(&status, recipe, "PSF_FIT_PADDING"); 17 PSF_FIT_RADIUS = psMetadataLookupF32(&status, recipe, "PSF_FIT_RADIUS"); 14 18 15 19 // this function specifies the radius at this the model hits the given flux … … 19 23 20 24 // call this function whenever you (re)-define the PSF model 21 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model) {22 25 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model) 26 { 23 27 pmMoments *moments = source->moments; 24 28 if (moments == NULL) return false; 25 29 26 30 // set the fit radius based on the object flux limit and the model 27 model->radiusFit = (RADIUS_TYPE) (modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + PSF_FIT_PADDING); 31 float radiusFit = PSF_FIT_RADIUS; 32 if (radiusFit <= 0) { // use fixed radius 33 radiusFit = modelRadiusPSF(model->params, PSF_FIT_NSIGMA*moments->dSky); 34 } 35 model->radiusFit = (RADIUS_TYPE)(RadiusFit + PSF_FIT_PADDING); 36 28 37 if (isnan(model->radiusFit)) psAbort ("apply_psf_model", "error in radius"); 29 38
Note:
See TracChangeset
for help on using the changeset viewer.
