Changeset 6427 for trunk/psphot/src/psphotRadiusChecks.c
- Timestamp:
- Feb 14, 2006, 6:33:17 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotRadiusChecks.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotRadiusChecks.c
r6056 r6427 1 1 # include "psphot.h" 2 2 3 static float PSF_ OUTER_RADIUS;3 static float PSF_FIT_NSIGMA; 4 4 static float PSF_FIT_PADDING; 5 static float PSF_FLUX_LIMIT;6 5 static pmModelRadius modelRadiusPSF; 7 6 8 bool psphotInitRadiusPSF (psMetadata *config, p sStats *sky, pmModelType type) {7 bool psphotInitRadiusPSF (psMetadata *config, pmModelType type) { 9 8 10 9 bool status; 11 10 12 float PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA"); 13 PSF_OUTER_RADIUS = psMetadataLookupF32 (&status, config, "PSF_OUTER_RADIUS"); 14 PSF_FIT_PADDING = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING"); 15 PSF_FLUX_LIMIT = PSF_FIT_NSIGMA * sky->sampleStdev; 11 PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA"); 12 PSF_FIT_PADDING = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING"); 16 13 17 14 // this function specifies the radius at this the model hits the given flux … … 22 19 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model) { 23 20 21 pmMoments *moments = source->moments; 22 if (moments == NULL) return false; 23 24 24 // set the fit radius based on the object flux limit and the model 25 // XXX EAM : FLUX_LIMIT should be set based on local sky model (not global median) 26 model->radius = modelRadiusPSF (model->params, PSF_FLUX_LIMIT) + PSF_FIT_PADDING; 25 model->radius = modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + PSF_FIT_PADDING; 27 26 if (isnan(model->radius)) psAbort ("apply_psf_model", "error in radius"); 28 27 … … 35 34 } 36 35 37 static float EXT_ OUTER_RADIUS;36 static float EXT_FIT_NSIGMA; 38 37 static float EXT_FIT_PADDING; 39 static float EXT_FLUX_LIMIT;40 38 static pmModelRadius modelRadiusEXT; 41 39 42 bool psphotInitRadiusEXT (psMetadata *config, p sStats *sky, pmModelType type) {40 bool psphotInitRadiusEXT (psMetadata *config, pmModelType type) { 43 41 44 42 bool status; 45 43 46 float EXT_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "EXT_FIT_NSIGMA"); 47 EXT_OUTER_RADIUS = psMetadataLookupF32 (&status, config, "EXT_OUTER_RADIUS"); 48 EXT_FIT_PADDING = psMetadataLookupF32 (&status, config, "EXT_FIT_PADDING"); 49 EXT_FLUX_LIMIT = EXT_FIT_NSIGMA * sky->sampleStdev; 44 EXT_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "EXT_FIT_NSIGMA"); 45 EXT_FIT_PADDING = psMetadataLookupF32 (&status, config, "EXT_FIT_PADDING"); 50 46 51 47 // this function specifies the radius at this the model hits the given flux … … 56 52 bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model) { 57 53 54 pmMoments *moments = source->moments; 55 if (moments == NULL) return false; 56 58 57 // set the fit radius based on the object flux limit and the model 59 model->radius = modelRadiusEXT (model->params, EXT_F LUX_LIMIT) + EXT_FIT_PADDING;58 model->radius = modelRadiusEXT (model->params, EXT_FIT_NSIGMA*moments->dSky) + EXT_FIT_PADDING; 60 59 if (isnan(model->radius)) psAbort (__func__, "error in radius"); 61 60
Note:
See TracChangeset
for help on using the changeset viewer.
