- Timestamp:
- Jul 15, 2010, 6:31:24 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/psphot/src/psphotSourceFits.c
r28657 r28677 345 345 346 346 // copy most data from the primary source (modelEXT, blends stay NULL) 347 pmSource *newSrc = pmSourceCopy (source);347 pmSource *newSrc = pmSourceCopyData (source); 348 348 newSrc->modelPSF = psMemIncrRefCounter (DBL->data[1]); 349 349 newSrc->modelPSF->fitRadius = radius; … … 447 447 maskVal |= markVal; 448 448 449 psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5);449 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 450 450 451 451 // use the source moments, etc to guess basic model parameters … … 460 460 } 461 461 462 // for sersic models, get the initial guess more carefully462 // for sersic models, use a grid search to choose an index, then float the params there 463 463 if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) { 464 464 psphotFitSersicIndex (source, EXT, fitOptions, maskVal); 465 465 } 466 466 467 // fit EXT (not PSF) model (set/unset the pixel mask) 468 options.mode = PM_SOURCE_FIT_EXT; 467 if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) { 468 options.mode = PM_SOURCE_FIT_NO_INDEX; 469 } else { 470 options.mode = PM_SOURCE_FIT_EXT; 471 } 469 472 pmSourceFitModel (source, EXT, &options, maskVal); 470 473 471 psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0);474 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0); 472 475 return (EXT); 473 476 } 474 477 475 float indexGuess[] = {0.5, 0.25, 0.125}; 478 // note that these should be 1/2n of the standard sersic index 479 float indexGuess[] = {0.5, 0.33, 0.25, 0.167, 0.125, 0.083}; 476 480 477 481 // A sersic model is very sensitive to the index. attempt to find the index first by grid search in just the index
Note:
See TracChangeset
for help on using the changeset viewer.
