Changeset 27838 for branches/tap_branches/psphot/src/psphotSourceFits.c
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotSourceFits.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/psphot
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psphot merged eligible /branches/eam_branches/stackphot.20100406/psphot 27622-27655 /branches/pap_delete/psphot 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/psphot/src
- Property svn:ignore
-
old new 19 19 psphotMomentsStudy 20 20 psphotPetrosianStudy 21 psphotForced 22 psphotMakePSF 23 psphotStack
-
- Property svn:ignore
-
branches/tap_branches/psphot/src/psphotSourceFits.c
r25755 r27838 219 219 double chiTrend; 220 220 pmModel *ONE = NULL; 221 pmSource *tmpSrc = NULL; 222 pmModel *EXT = NULL; 223 psArray *DBL = NULL; 221 224 222 225 // skip the source if we don't think it is extended … … 232 235 // at this stage, skip Gaussian windowing, and do not clip pixels by S/N 233 236 // this uses the footprint to judge both radius and aperture? 234 if (!pmSourceMoments (source, radius, 0.0, 0.0 )) return false;237 if (!pmSourceMoments (source, radius, 0.0, 0.0, maskVal)) return false; 235 238 236 239 psTrace ("psphot", 5, "trying blob...\n"); … … 240 243 241 244 // this temporary source is used as a place-holder by the psphotEval functions below 242 pmSource *tmpSrc = pmSourceAlloc ();245 tmpSrc = pmSourceAlloc (); 243 246 244 247 // XXX need to handle failures better here 245 pmModel *EXT = psphotFitEXT (readout, source, modelTypeEXT, maskVal, markVal); 246 if (!isfinite(EXT->params->data.F32[PM_PAR_I0])) psAbort("nan in fit"); 248 EXT = psphotFitEXT (readout, source, modelTypeEXT, maskVal, markVal); 249 if (!EXT) goto escape; 250 if (!isfinite(EXT->params->data.F32[PM_PAR_I0])) goto escape; 247 251 248 252 okEXT = psphotEvalEXT (tmpSrc, EXT); … … 250 254 251 255 // DBL will always be defined, but DBL->data[n] might not 252 psArray *DBL = psphotFitDBL (readout, source, maskVal, markVal); 256 DBL = psphotFitDBL (readout, source, maskVal, markVal); 257 if (!DBL) goto escape; 258 if (!DBL->n) goto escape; 259 253 260 okDBL = psphotEvalDBL (tmpSrc, DBL->data[0]); 254 261 okDBL &= psphotEvalDBL (tmpSrc, DBL->data[1]); … … 362 369 psFree (DBL); 363 370 return true; 371 372 escape: 373 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 374 psFree (tmpSrc); 375 psFree (EXT); 376 psFree (DBL); 377 return false; 364 378 } 365 379 … … 425 439 // use the source moments, etc to guess basic model parameters 426 440 pmModel *EXT = pmSourceModelGuess (source, modelType); 427 PS_ASSERT (EXT, NULL); 441 if (!EXT) { 442 psTrace ("psphot", 5, "failed to generate a model for source: moments: %f %f\n", source->moments->Mxx, source->moments->Myy); 443 return NULL; 444 } 428 445 429 446 if ((source->moments->Mxx < 1e-3) || (source->moments->Myy < 1e-3)) {
Note:
See TracChangeset
for help on using the changeset viewer.
