IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2011, 11:39:04 AM (15 years ago)
Author:
eugene
Message:

unify code for model guesses (Io; Xo,Yo; Sxx,Sxy,Syy); use the moment peak if the peak flux is nan; skip sources without a valid Io guess

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_SERSIC.c

    r31031 r31034  
    222222{
    223223    pmMoments *moments = source->moments;
    224     pmPeak    *peak    = source->peak;
    225224    psF32     *PAR  = model->params->data.F32;
     225
     226    // sky is set to 0.0
     227    PAR[PM_PAR_SKY]  = 0.0;
    226228
    227229    // the other parameters depend on the guess for PAR_7
     
    236238    float Zero  = 1.16 - 0.615 * PAR[PM_PAR_7];
    237239
     240    // Sersic shape is a bit special
    238241    psEllipseMoments emoments;
    239242    emoments.x2 = moments->Mxx;
     
    273276    float Syy = PS_MAX(0.5, shape.sy);
    274277
    275     PAR[PM_PAR_SKY]  = 0.0;
    276     PAR[PM_PAR_I0]   = peak->rawFlux / Io;
    277     PAR[PM_PAR_XPOS] = peak->xf;
    278     PAR[PM_PAR_YPOS] = peak->yf;
    279278    PAR[PM_PAR_SXX]  = Sxx;
    280279    PAR[PM_PAR_SYY]  = Syy;
    281280    PAR[PM_PAR_SXY]  = shape.sxy;
     281
     282    // set the model normalization (adjust for Sersic best guess)
     283    if (!pmModelSetNorm(&PAR[PM_PAR_I0], source)) {
     284      return false;
     285    }
     286    PAR[PM_PAR_I0] /= Io;
     287
     288    // set the model position
     289    if (!pmModelSetPosition(&PAR[PM_PAR_XPOS], &PAR[PM_PAR_YPOS], source)) {
     290      return false;
     291    }
    282292
    283293    return(true);
Note: See TracChangeset for help on using the changeset viewer.