Changeset 25497
- Timestamp:
- Sep 23, 2009, 11:17:41 AM (17 years ago)
- Location:
- branches/eam_branches/20090715/psphot/src
- Files:
-
- 4 edited
-
psphotChoosePSF.c (modified) (2 diffs)
-
psphotFitSourcesLinear.c (modified) (1 diff)
-
psphotRadiusChecks.c (modified) (3 diffs)
-
psphotSourceFits.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src/psphotChoosePSF.c
r23989 r25497 73 73 // get the fixed PSF fit radius 74 74 // XXX check that PSF_FIT_RADIUS < SKY_OUTER_RADIUS 75 options->radius = psMetadataLookupF32 (&status, recipe, "PSF_FIT_RADIUS"); 76 assert (status); 75 // options->radius = psMetadataLookupF32 (&status, recipe, "PSF_FIT_RADIUS"); 76 // assert (status); 77 78 // XXX we have calculated a Gaussian window function, use that for both the PSF fit radius 79 // and the aperture radius (scaling SIGMA) 80 // XXX put the scale factors into the recipe 81 float gaussSigma = psMetadataLookupF32(&status, recipe, "MOMENTS_GAUSS_SIGMA"); 82 float fitScale = psMetadataLookupF32(&status, recipe, "PSF_FIT_RADIUS_SCALE"); 83 float apScale = psMetadataLookupF32(&status, recipe, "PSF_APERTURE_SCALE"); 84 options->fitRadius = (int)(fitScale*gaussSigma); 85 options->apRadius = (int)(apScale*gaussSigma); 77 86 78 87 // XXX ROBUST seems to be too agressive given the small numbers. … … 289 298 // XXX test dump of psf star data and psf-subtracted image 290 299 if (psTraceGetLevel("psphot.psfstars") > 5) { 291 psphotDumpPSFStars (readout, try, options-> radius, maskVal, markVal);300 psphotDumpPSFStars (readout, try, options->fitRadius, maskVal, markVal); 292 301 } 293 302 -
branches/eam_branches/20090715/psphot/src/psphotFitSourcesLinear.c
r25452 r25497 264 264 float x = model->params->data.F32[PM_PAR_XPOS]; 265 265 float y = model->params->data.F32[PM_PAR_YPOS]; 266 psImageMaskCircle (source->maskView, x, y, model-> radiusFit, "AND", PS_NOT_IMAGE_MASK(markVal));266 psImageMaskCircle (source->maskView, x, y, model->fitRadius, "AND", PS_NOT_IMAGE_MASK(markVal)); 267 267 } 268 268 -
branches/eam_branches/20090715/psphot/src/psphotRadiusChecks.c
r25433 r25497 35 35 } 36 36 } 37 model-> radiusFit= (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING);37 model->fitRadius = (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING); 38 38 39 if (isnan(model-> radiusFit)) psAbort("error in radius");39 if (isnan(model->fitRadius)) psAbort("error in radius"); 40 40 41 41 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 42 model-> radiusFit*= 2;42 model->fitRadius *= 2; 43 43 } 44 44 45 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->radiusFit); 45 source->apRadius = model->fitRadius; 46 // XXX for now, use the same radius for aperture and fit 47 // XXX to use different radii, we will need to set the apRadius mask with a call to 48 // psImageKeepCircle in the function psphotMagnitudes_Threaded 49 50 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius); 46 51 47 52 // set the mask to flag the excluded pixels 48 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit, "OR", markVal);53 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, "OR", markVal); 49 54 return status; 50 55 } … … 58 63 59 64 // set the fit radius based on the object flux limit and the model 60 model-> radiusFit= (RADIUS_TYPE) (model->modelRadius (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING);61 if (isnan(model-> radiusFit)) psAbort("error in radius");65 model->fitRadius = (RADIUS_TYPE) (model->modelRadius (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING); 66 if (isnan(model->fitRadius)) psAbort("error in radius"); 62 67 63 68 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 64 model-> radiusFit*= 2;69 model->fitRadius *= 2; 65 70 } 66 71 67 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->radiusFit); 72 source->apRadius = model->fitRadius; 73 // XXX for now, use the same radius for aperture and fit 74 // XXX to use different radii, we will need to set the apRadius mask with a call to 75 // psImageKeepCircle in the function psphotMagnitudes_Threaded 76 77 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius); 68 78 69 79 // set the mask to flag the excluded pixels 70 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit, "OR", markVal);80 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, "OR", markVal); 71 81 return status; 72 82 } … … 141 151 float rawRadius = model->modelRadius (model->params, EXT_FIT_NSIGMA*moments->dSky); 142 152 143 model->radiusFit = rawRadius + EXT_FIT_PADDING; 144 if (isnan(model->radiusFit)) psAbort("error in radius"); 153 model->fitRadius = rawRadius + EXT_FIT_PADDING; 154 if (isnan(model->fitRadius)) psAbort("error in radius"); 155 156 // XXX this make the psf photometry for extended sources inconsistent with the other psf sources 157 // XXX for now, use the same radius for aperture and fit 158 // XXX to use different radii, we will need to set the apRadius mask with a call to 159 // psImageKeepCircle in the function psphotMagnitudes_Threaded 145 160 146 161 // redefine the pixels if needed 147 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit);162 bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius); 148 163 149 164 // set the mask to flag the excluded pixels 150 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model-> radiusFit, "OR", markVal);165 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, "OR", markVal); 151 166 return status; 152 167 } -
branches/eam_branches/20090715/psphot/src/psphotSourceFits.c
r25433 r25497 294 294 // save new model 295 295 source->modelEXT = EXT; 296 source->modelEXT-> radiusFit= radius;296 source->modelEXT->fitRadius = radius; 297 297 source->type = PM_SOURCE_TYPE_EXTENDED; 298 298 source->mode |= PM_SOURCE_MODE_EXTMODEL; … … 324 324 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 325 325 source->mode |= PM_SOURCE_MODE_PAIR; 326 source->modelPSF-> radiusFit= radius;326 source->modelPSF->fitRadius = radius; 327 327 328 328 // copy most data from the primary source (modelEXT, blends stay NULL) 329 329 pmSource *newSrc = pmSourceCopy (source); 330 330 newSrc->modelPSF = psMemIncrRefCounter (DBL->data[1]); 331 newSrc->modelPSF-> radiusFit= radius;331 newSrc->modelPSF->fitRadius = radius; 332 332 333 333 // build cached models and subtract
Note:
See TracChangeset
for help on using the changeset viewer.
