IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 15, 2010, 6:31:24 AM (16 years ago)
Author:
eugene
Message:

correctly unmark unused PSF candidates using source id; grid search for sersic terms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/psphot/src/psphotSourceFits.c

    r28657 r28677  
    345345
    346346    // copy most data from the primary source (modelEXT, blends stay NULL)
    347     pmSource *newSrc = pmSourceCopy (source);
     347    pmSource *newSrc = pmSourceCopyData (source);
    348348    newSrc->modelPSF = psMemIncrRefCounter (DBL->data[1]);
    349349    newSrc->modelPSF->fitRadius = radius;
     
    447447    maskVal |= markVal;
    448448
    449     psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5);
     449    // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5);
    450450
    451451    // use the source moments, etc to guess basic model parameters
     
    460460    }
    461461
    462     // for sersic models, get the initial guess more carefully
     462    // for sersic models, use a grid search to choose an index, then float the params there
    463463    if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) {
    464464        psphotFitSersicIndex (source, EXT, fitOptions, maskVal);
    465465    }
    466466
    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    }
    469472    pmSourceFitModel (source, EXT, &options, maskVal);
    470473
    471     psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0);
     474    // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0);
    472475    return (EXT);
    473476}
    474477
    475 float indexGuess[] = {0.5, 0.25, 0.125};
     478// note that these should be 1/2n of the standard sersic index
     479float indexGuess[] = {0.5, 0.33, 0.25, 0.167, 0.125, 0.083};
    476480
    477481// 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.