Changeset 35769 for trunk/psphot/src/psphotSourceFits.c
- Timestamp:
- Jul 3, 2013, 2:43:13 PM (13 years ago)
- Location:
- trunk/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130509/psphot (added) merged: 35594,35614,35630-35634,35640-35641,35650-35652,35654-35655,35659,35661,35701,35751
- Property svn:mergeinfo changed
-
trunk/psphot/src
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130509/psphot/src (added) merged: 35594,35614,35630-35634,35640,35651,35654,35659,35661,35751
- Property svn:mergeinfo changed
-
trunk/psphot/src/psphotSourceFits.c
r35559 r35769 3 3 // given a source with an existing modelPSF, attempt a full PSF fit, subtract if successful 4 4 5 static int NfitBlend = 0; 6 5 7 static int NfitPSF = 0; 6 static int NfitBlend = 0; 8 static int NfitIterPSF = 0; 9 7 10 static int NfitDBL = 0; 11 static int NfitIterDBL = 0; 12 static int NfitPixDBL = 0; 13 8 14 static int NfitEXT = 0; 15 static int NfitIterEXT = 0; 16 static int NfitPixEXT = 0; 17 9 18 static int NfitPCM = 0; 19 static int NfitIterPCM = 0; 20 static int NfitPixPCM = 0; 10 21 11 22 bool psphotFitInit (int nThreads) { … … 17 28 bool psphotFitSummary () { 18 29 19 psLogMsg ("psphot.pspsf", PS_LOG_INFO, "fitted %5d psf, %5d blend, %5d ext, %5d dbl : %6.2f sec\n", 20 NfitPSF, NfitBlend, NfitEXT, NfitDBL, psTimerMark ("psphot.fits")); 30 psLogMsg ("psphot.pspsf", PS_LOG_INFO, "fitted %5d psf (%d iter), %5d blend: %5d ext (%d iter, %d pix), %5d dbl (%d iter, %d pix) : %6.2f sec\n", 31 NfitPSF, NfitIterPSF, NfitBlend, NfitEXT, NfitIterEXT, NfitPixEXT, NfitDBL, NfitIterDBL, NfitPixDBL, psTimerMark ("psphot.fits")); 32 return true; 33 } 34 35 bool psphotFitSummaryExtended () { 36 37 psLogMsg ("psphot.pspsf", PS_LOG_INFO, "fitted %5d ext (%d iter, %d pix), %5d pcm (%d iter, %d pix)\n", 38 NfitEXT, NfitIterEXT, NfitPixEXT, NfitPCM, NfitIterPCM, NfitPixPCM); 39 return true; 40 } 41 42 bool psphotFitInitExtended () { 43 NfitEXT = 0; 44 NfitIterEXT = 0; 45 NfitPixEXT = 0; 46 NfitPCM = 0; 47 NfitIterPCM = 0; 48 NfitPixPCM = 0; 21 49 return true; 22 50 } … … 169 197 options.mode = PM_SOURCE_FIT_PSF; 170 198 pmSourceFitModel (source, PSF, &options, maskVal); 199 NfitIterPSF += PSF->nIter; 171 200 172 201 if (!isfinite(PSF->params->data.F32[PM_PAR_I0])) psAbort("nan in fit"); … … 268 297 { 269 298 // XXX need to handle failures better here 270 EXT = psphotFitEXT ( readout, source, fitOptions, modelTypeEXT, maskVal, markVal);299 EXT = psphotFitEXT (NULL, readout, source, fitOptions, modelTypeEXT, maskVal, markVal); 271 300 if (!EXT) goto escape; 272 301 if (!isfinite(EXT->params->data.F32[PM_PAR_I0])) goto escape; … … 440 469 options.mode = PM_SOURCE_FIT_PSF; 441 470 pmSourceFitSet (source, modelSet, &options, maskVal); 471 NfitIterDBL += DBL->nIter; 472 NfitPixDBL += DBL->nDOF; 473 442 474 return (modelSet); 443 475 } 444 476 445 pmModel *psphotFitEXT (pm Readout *readout, pmSource *source, pmSourceFitOptions *fitOptions, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal) {477 pmModel *psphotFitEXT (pmModel *guessModel, pmReadout *readout, pmSource *source, pmSourceFitOptions *fitOptions, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal) { 446 478 447 479 if ((source->moments->Mxx < 1e-3) || (source->moments->Myy < 1e-3)) { … … 457 489 458 490 // use the source moments, etc to guess basic model parameters 459 pmModel *model = pmSourceModelGuess (source, modelType, maskVal, markVal);491 pmModel *model = guessModel ? guessModel : pmSourceModelGuess (source, modelType, maskVal, markVal); 460 492 if (!model) { 461 493 psTrace ("psphot", 5, "failed to generate a model for source: moments: %f %f\n", source->moments->Mxx, source->moments->Myy); … … 507 539 508 540 pmSourceFitModel (source, model, &options, maskVal); 541 NfitIterEXT += model->nIter; 542 NfitPixEXT += model->nDOF; 509 543 510 544 # if (PS_TRACE_ON) … … 587 621 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 588 622 pmSourceFitPCM (pcm, source, &options, maskVal, markVal, psfSize); // NOTE : 1687 allocs in here 623 NfitIterPCM += pcm->modelConv->nIter; 624 NfitPixPCM += pcm->modelConv->nDOF; 589 625 if (TIMING) { t5 = psTimerMark ("psphotFitPCM"); } 590 626
Note:
See TracChangeset
for help on using the changeset viewer.
