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_GAUSS.c

    r31031 r31034  
    193193bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    194194{
    195     pmMoments *moments = source->moments;
    196     pmPeak    *peak    = source->peak;
    197     psF32     *PAR  = model->params->data.F32;
    198 
    199     psEllipseMoments emoments;
    200     emoments.x2 = moments->Mxx;
    201     emoments.y2 = moments->Myy;
    202     emoments.xy = moments->Mxy;
    203 
    204     // force the axis ratio to be < 20.0
    205     psEllipseAxes axes = psEllipseMomentsToAxes (emoments, 20.0);
    206     psEllipseShape shape = psEllipseAxesToShape (axes);
    207 
     195    psF32 *PAR  = model->params->data.F32;
     196
     197    // sky is set to 0.0
    208198    PAR[PM_PAR_SKY]  = 0.0;
    209     PAR[PM_PAR_I0]   = peak->rawFlux;
    210     PAR[PM_PAR_XPOS] = peak->xf;
    211     PAR[PM_PAR_YPOS] = peak->yf;
    212     PAR[PM_PAR_SXX] = PS_MAX(0.5, M_SQRT2*shape.sx);
    213     PAR[PM_PAR_SYY] = PS_MAX(0.5, M_SQRT2*shape.sy);
    214     PAR[PM_PAR_SXY] = shape.sxy;
     199
     200    // set the shape parameters
     201    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
     202      return false;
     203    }
     204
     205    // set the model normalization
     206    if (!pmModelSetNorm(&PAR[PM_PAR_I0], source)) {
     207      return false;
     208    }
     209
     210    // set the model position
     211    if (!pmModelSetPosition(&PAR[PM_PAR_XPOS], &PAR[PM_PAR_YPOS], source)) {
     212      return false;
     213    }
     214
    215215    return(true);
    216216}
Note: See TracChangeset for help on using the changeset viewer.