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

    r25738 r25754  
    11/******************************************************************************
    22 * this file defines the QGAUSS source shape model (XXX need a better name!).  Note that these
    3  * model functions are loaded by pmModelGroup.c using 'include', and thus need no 'include'
     3 * model functions are loaded by pmModelClass.c using 'include', and thus need no 'include'
    44 * statements of their own.  The models use a psVector to represent the set of parameters, with
    55 * the sequence used to specify the meaning of the parameter.  The meaning of the parameters
     
    3838# define PM_MODEL_FIT_STATUS      pmModelFitStatus_QGAUSS
    3939# define PM_MODEL_SET_LIMITS      pmModelSetLimits_QGAUSS
     40
     41// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     42// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     43// values need to be pixel coords
    4044
    4145// Lax parameter limits
     
    178182
    179183// make an initial guess for parameters
     184// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    180185bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    181186{
     
    202207    if (!isfinite(shape.sxy)) return false;
    203208
    204     // XXX turn this off here for now PAR[PM_PAR_SKY]  = moments->Sky;
    205209    PAR[PM_PAR_SKY]  = 0.0;
    206210    PAR[PM_PAR_I0]   = peak->flux;
     
    283287    // choose a z value guaranteed to be beyond our limit
    284288    float z0 = pow((1.0 / limit), (1.0 / 2.25));
     289    psAssert (isfinite(z0), "fix this code: z0 should not be nan for %f", PAR[PM_PAR_7]);
    285290    float z1 = (1.0 / limit) / PAR[PM_PAR_7];
     291    psAssert (isfinite(z1), "fix this code: z1 should not be nan for %f", PAR[PM_PAR_7]);
    286292    z1 = PS_MAX (z0, z1);
    287293    z0 = 0.0;
     
    409415bool PM_MODEL_FIT_STATUS (pmModel *model)
    410416{
    411 
    412     psF32 dP;
    413417    bool  status;
    414418
     
    416420    psF32 *dPAR = model->dparams->data.F32;
    417421
    418     dP = 0;
    419     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    420     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    421     dP = sqrt (dP);
    422 
    423422    status = true;
    424 //    status &= (dP < 0.5);
    425423    status &= (PAR[PM_PAR_I0] > 0);
    426424    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
Note: See TracChangeset for help on using the changeset viewer.