Changeset 25618
- Timestamp:
- Sep 27, 2009, 11:18:40 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src/psphotSourceFits.c
r25497 r25618 90 90 psphotCheckRadiusPSFBlend (readout, source, PSF, markVal, dR); 91 91 92 // fit PSF model (set/unset the pixel mask)92 // fit PSF model 93 93 pmSourceFitSet (source, modelSet, PM_SOURCE_FIT_PSF, maskVal); 94 95 // clear the circular mask 96 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 94 97 95 98 // correct model chisq for flux trend … … 120 123 pmSourceCacheModel (blend, maskVal); 121 124 pmSourceSub (blend, PM_MODEL_OP_FULL, maskVal); 122 blend->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;123 125 blend->mode |= PM_SOURCE_MODE_BLEND_FIT; 124 126 } … … 144 146 pmSourceCacheModel (source, maskVal); 145 147 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 146 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;147 148 source->mode |= PM_SOURCE_MODE_BLEND_FIT; 148 149 return true; … … 167 168 // fit PSF model (set/unset the pixel mask) 168 169 pmSourceFitModel (source, PSF, PM_SOURCE_FIT_PSF, maskVal); 170 171 // clear the circular mask 172 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 169 173 170 174 // correct model chisq for flux trend … … 186 190 pmSourceCacheModel (source, maskVal); 187 191 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 188 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;189 192 return true; 190 193 } … … 223 226 if (source->peak->SN < EXT_MIN_SN) return false; 224 227 228 // set the radius based on the footprint (also sets the mask pixels) 225 229 float radius = psphotSetRadiusEXT (readout, source, markVal); 226 230 … … 228 232 // recalculate the source moments using the larger extended-source moments radius 229 233 // at this stage, skip Gaussian windowing, and do not clip pixels by S/N 230 // XXX use the deteremined value of PSF_MOMENTS_RADIUS and SIGMA and scale up? 231 // XXX increase the moments radius iteratively until the measured sigma / input < f? 232 // XXX use the footprint somehow to judge both radius and aperture? 234 // this uses the footprint to judge both radius and aperture? 233 235 if (!pmSourceMoments (source, radius, 0.0, 0.0)) return false; 234 236 … … 251 253 okDBL &= psphotEvalDBL (tmpSrc, DBL->data[1]); 252 254 // XXX should I keep / save the flags set in the eval functions? 255 256 // clear the circular mask 257 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 253 258 254 259 // correct first model chisqs for flux trend … … 301 306 pmSourceCacheModel (source, maskVal); 302 307 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 303 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;304 308 305 309 # if (PS_TRACE_ON) … … 322 326 psFree (source->modelPSF); 323 327 source->modelPSF = psMemIncrRefCounter (DBL->data[0]); 324 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;325 328 source->mode |= PM_SOURCE_MODE_PAIR; 326 329 source->modelPSF->fitRadius = radius; … … 389 392 // save the PSF model from the Ensemble fit 390 393 PSF = source->modelPSF; 391 // psphotCheckRadiusPSFBlend (readout, source, PSF, markVal, 8.0);392 394 if (isnan(PSF->params->data.F32[1])) psAbort("nan in dbl fit"); 393 395 … … 422 424 PS_ASSERT (EXT, NULL); 423 425 424 // if (isnan(EXT->params->data.F32[1])) psAbort("nan in ext fit");425 // psphotCheckRadiusEXT (readout, source, EXT, markVal);426 427 426 if ((source->moments->Mxx < 1e-3) || (source->moments->Myy < 1e-3)) { 428 427 psTrace ("psphot", 5, "problem source: moments: %f %f\n", source->moments->Mxx, source->moments->Myy);
Note:
See TracChangeset
for help on using the changeset viewer.
