Changeset 5993 for trunk/psphot/src/psphotRadiusChecks.c
- Timestamp:
- Jan 15, 2006, 8:30:16 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotRadiusChecks.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotRadiusChecks.c
r5980 r5993 31 31 } 32 32 33 # if (1)34 33 bool status = psphotRedefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius); 35 34 return status; 36 37 # else38 39 if (model->radius > PSF_OUTER_RADIUS) {40 // (re)-allocate image, weight, mask arrays for each peak (square of radius OUTER)41 psphotDefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius);42 return true;43 } else {44 fprintf (stderr, "skipping %f,%f\n", model->params->data.F32[2], model->params->data.F32[3]);45 }46 return false;47 # endif48 35 } 49 36 37 static float EXT_OUTER_RADIUS; 38 static float EXT_FIT_PADDING; 39 static float EXT_FLUX_LIMIT; 40 static pmModelRadius modelRadiusEXT; 50 41 51 static float GAL_OUTER_RADIUS; 52 static float GAL_FIT_PADDING; 53 static float GAL_FLUX_LIMIT; 54 static pmModelRadius modelRadiusGAL; 55 56 bool psphotInitRadiusFLT (psMetadata *config, psStats *sky, pmModelType type) { 42 bool psphotInitRadiusEXT (psMetadata *config, psStats *sky, pmModelType type) { 57 43 58 44 bool status; 59 45 60 float GAL_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "GAL_FIT_NSIGMA");61 GAL_OUTER_RADIUS = psMetadataLookupF32 (&status, config, "GAL_OUTER_RADIUS");62 GAL_FIT_PADDING = psMetadataLookupF32 (&status, config, "GAL_FIT_PADDING");63 GAL_FLUX_LIMIT = GAL_FIT_NSIGMA * sky->sampleStdev;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; 64 50 65 51 // this function specifies the radius at this the model hits the given flux 66 modelRadius GAL= pmModelRadius_GetFunction (type);52 modelRadiusEXT = pmModelRadius_GetFunction (type); 67 53 return true; 68 54 } 69 55 70 bool psphotCheckRadius FLT (eamReadout *imdata, pmSource *source, pmModel *model) {56 bool psphotCheckRadiusEXT (eamReadout *imdata, pmSource *source, pmModel *model) { 71 57 72 58 // set the fit radius based on the object flux limit and the model 73 model->radius = modelRadius GAL (model->params, GAL_FLUX_LIMIT) + GAL_FIT_PADDING;74 if (isnan(model->radius)) psAbort ( "fit_galaxies", "error in radius");59 model->radius = modelRadiusEXT (model->params, EXT_FLUX_LIMIT) + EXT_FIT_PADDING; 60 if (isnan(model->radius)) psAbort (__func__, "error in radius"); 75 61 76 # if (1)77 62 // redefine the pixels if needed 78 63 bool status = psphotRedefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius); 79 64 return status; 80 81 # else82 83 // check if we need to redefine the pixels84 if (model->radius > GAL_OUTER_RADIUS) {85 // (re)-allocate image, weight, mask arrays for each peak (square of radius OUTER)86 // do I need to save the old pixel and mask data?87 psphotDefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius);88 return true;89 }90 return false;91 # endif92 65 }
Note:
See TracChangeset
for help on using the changeset viewer.
