Changeset 4630 for trunk/psphot/src/apply_psf_model.c
- Timestamp:
- Jul 27, 2005, 3:26:57 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/apply_psf_model.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/apply_psf_model.c
r4582 r4630 22 22 float shapeNsigma = psMetadataLookupF32 (&status, config, "PSF_SHAPE_NSIGMA"); 23 23 float OUTER = psMetadataLookupF32 (&status, config, "OUTER_RADIUS"); 24 float FIT_MIN_SN = psMetadataLookupF32 (&status, config, "FIT_MIN_SN"); 25 float FIT_MAX_CHI = psMetadataLookupF32 (&status, config, "FIT_MAX_CHI"); 24 26 25 27 // set the object surface-brightness limit for fitted pixels … … 34 36 35 37 // skip non-astronomical objects (very likely defects) 36 if (source->type == PS_SOURCE_DEFECT) continue; 38 if (source->type == PS_SOURCE_DEFECT) continue; // XX should I try these anyway? 37 39 if (source->type == PS_SOURCE_SATURATED) continue; 38 40 41 source->modelPSF = NULL; 42 39 43 // use the source moments, etc to guess basic model parameters 40 psModel *model = pmSourceModelGuess (source, psf->type);44 psModel *model = pmSourceModelGuess (source, psf->type); 41 45 42 46 // set PSF parameters for this model … … 44 48 x = model->params->data.F32[2]; 45 49 y = model->params->data.F32[3]; 46 // XXX I need to check if the model center has moved too much relative to the peak47 50 48 51 // set the fit radius based on the object flux limit and the model … … 50 53 model->radius = modelRadius (model->params, FLUX_LIMIT) + FIT_PADDING; 51 54 if (isnan(model->radius)) { 52 fprintf (stderr, "error in radius\n"); 53 continue; 55 psAbort ("apply_psf_model", "error in radius"); 54 56 } 55 57 … … 65 67 psImageKeepCircle (source->mask, x, y, model->radius, AND, 0x7f); 66 68 if (!status || (model->params->data.F32[1] < 0)) { 67 // if the fit fails, we need to change the classification68 69 psLogMsg ("psphot", 3, "PSF fit failed for %f, %f (%d iterations)\n", x, y, model->nIter); 69 source->type = PS_SOURCE_ OTHER; // better choice?70 source->type = PS_SOURCE_FAIL_FIT_PSF; // better choice? 70 71 continue; 71 72 } … … 75 76 Nfit ++; 76 77 77 mark_psf_source (source, shapeNsigma, SATURATE);78 mark_psf_source (source, shapeNsigma, FIT_MIN_SN, FIT_MAX_CHI, SATURATE); 78 79 if (subtract_psf_source (source)) { 79 80 Nsub ++;
Note:
See TracChangeset
for help on using the changeset viewer.
