Changeset 4216 for trunk/psphot/src/apply_psf_model.c
- Timestamp:
- Jun 12, 2005, 3:49:21 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/apply_psf_model.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/apply_psf_model.c
r4129 r4216 4 4 // PSFSTAR objects will be refitted 5 5 // run this function to a specific flux limit? 6 7 6 8 7 bool apply_psf_model (psImage *image, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky) … … 18 17 float FIT_NSIGMA = psMetadataLookupF32 (&status, config, "FIT_NSIGMA"); 19 18 float FIT_PADDING = psMetadataLookupF32 (&status, config, "FIT_PADDING"); 20 21 float XBORDER = psMetadataLookupF32 (&status, config, "XBORDER");22 float YBORDER = psMetadataLookupF32 (&status, config, "YBORDER");23 psRegion *keep = psRegionAlloc (XBORDER, -XBORDER, YBORDER, -YBORDER);24 keep = psRegionForImage (keep, image, keep);25 26 19 float shapeNsigma = psMetadataLookupF32 (&status, config, "PSF_SHAPE_NSIGMA"); 27 // float snFaint = psMetadataLookupF32 (&status, config, "FAINT_SN_LIM"); 20 float snFaint = psMetadataLookupF32 (&status, config, "FAINT_SN_LIM"); 21 float OUTER = psMetadataLookupF32 (&status, config, "OUTER_RADIUS"); 28 22 29 23 // set the object surface-brightness limit for fitted pixels … … 46 40 // set PSF parameters for this model 47 41 model = psModelFromPSF (model, psf); 42 x = model->params->data.F32[2]; 43 y = model->params->data.F32[3]; 48 44 49 45 // set the fit radius based on the object flux limit and the model … … 54 50 continue; 55 51 } 56 57 // set the valid/invalid pixel mask 58 pmSourceSetPixelCircle (source, image, model->radius); 59 pmSourceMaskRegion (source, keep); 52 53 // mask off saturated pixels (move this to setup?) 60 54 pmSourceMaskSaturated (source, SATURATE); 61 55 62 // fit as PSF, not FLT (skip poor fits) 63 if (!pmSourceFitModel (source, model, true)) continue; 56 // check if we need to redefine the pixels 57 if (model->radius > OUTER) { 58 // allocate image, noise, mask arrays for each peak (square of radius OUTER) 59 pmSourceDefinePixels (source, imdata, x, y, OUTER); 60 } 61 62 // set the valid/invalid pixel mask 63 psImageKeepCircle (source->mask, x, y, model->radius, OR, 0x80); 64 status = pmSourceFitModel (source, model, true); 65 psImageKeepCircle (source->mask, x, y, model->radius, AND, 0x7f); 66 if (!status) continue; 67 64 68 source->modelPSF = model; 65 69 Niter += model[0].nIter;
Note:
See TracChangeset
for help on using the changeset viewer.
