IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 2, 2009, 3:11:32 PM (17 years ago)
Author:
eugene
Message:

check in changes from genes development branch : extensive changes to moments calculation, psf model generation, aperture residuals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/models/pmModel_PGAUSS.c

    r25738 r25754  
    11/******************************************************************************
    22 * this file defines the PGAUSS source shape model.  Note that these model functions are loaded
    3  * by pmModelGroup.c using 'include', and thus need no 'include' statements of their own.  The
     3 * by pmModelClass.c using 'include', and thus need no 'include' statements of their own.  The
    44 * models use a psVector to represent the set of parameters, with the sequence used to specify
    55 * the meaning of the parameter.  The meaning of the parameters may thus vary depending on the
    6  * specifics of the model.  All models which are used a PSF representations share a few
     6 * specifics of the model.  All models which are used as a PSF representations share a few
    77 * parameters, for which # define names are listed in pmModel.h:
    88
     
    5454
    5555// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     56// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     57// values need to be pixel coords
    5658psF32 PM_MODEL_FUNC(psVector *deriv,
    5759                    const psVector *params,
     
    165167
    166168// make an initial guess for parameters
     169// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    167170bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    168171{
     
    179182    psEllipseShape shape = psEllipseAxesToShape (axes);
    180183
    181     PAR[PM_PAR_SKY]  = moments->Sky;
     184    PAR[PM_PAR_SKY]  = 0.0;
    182185    PAR[PM_PAR_I0]   = peak->flux;
    183186    PAR[PM_PAR_XPOS] = peak->xf;
     
    258261    // choose a z value guaranteed to be beyond our limit
    259262    float z0 = pow((1.0 / limit), (1.0 / 3.0));
     263    psAssert (isfinite(z0), "fix this code: z0 should not be nan for %f", PAR[PM_PAR_I0]);
    260264    float z1 = (1.0 / limit);
     265    psAssert (isfinite(z1), "fix this code: z1 should not be nan for %f", PAR[PM_PAR_I0]);
    261266    z1 = PS_MAX (z0, z1);
    262267    z0 = 0.0;
     
    389394bool PM_MODEL_FIT_STATUS (pmModel *model)
    390395{
    391     psF32 dP;
    392396    bool  status;
    393397
     
    395399    psF32 *dPAR = model->dparams->data.F32;
    396400
    397     dP = 0;
    398     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    399     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    400     dP = sqrt (dP);
    401 
    402401    status = true;
    403     status &= (dP < 0.5);
    404402    status &= (PAR[PM_PAR_I0] > 0);
    405403    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
Note: See TracChangeset for help on using the changeset viewer.