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

    r25738 r25754  
    11/******************************************************************************
    22 * this file defines the SERSIC 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
     
    4141# define PM_MODEL_FIT_STATUS      pmModelFitStatus_SERSIC
    4242# define PM_MODEL_SET_LIMITS      pmModelSetLimits_SERSIC
     43
     44// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     45// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     46// values need to be pixel coords
    4347
    4448// Lax parameter limits
     
    186190
    187191// make an initial guess for parameters
     192// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    188193bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    189194{
     
    210215    if (!isfinite(shape.sxy)) return false;
    211216
    212     // XXX PAR[PM_PAR_SKY]  = moments->Sky;
    213217    PAR[PM_PAR_SKY]  = 0.0;
    214218    PAR[PM_PAR_I0]   = peak->flux;
     
    284288
    285289    psF64 z = pow (-log(limit), (1.0 / PAR[PM_PAR_7]));
     290    psAssert (isfinite(z), "fix this code: z should not be nan for %f", PAR[PM_PAR_7]);
    286291
    287292    psF64 radius = sigma * sqrt (2.0 * z);
     293    psAssert (isfinite(radius), "fix this code: radius should not be nan for %f, %f", PAR[PM_PAR_7], sigma);
    288294
    289295    if (isnan(radius))
     
    392398bool PM_MODEL_FIT_STATUS (pmModel *model)
    393399{
    394 
    395     psF32 dP;
    396400    bool  status;
    397401
     
    399403    psF32 *dPAR = model->dparams->data.F32;
    400404
    401     dP = 0;
    402     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    403     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    404     dP = sqrt (dP);
    405 
    406405    status = true;
    407 //    status &= (dP < 0.5);
    408406    status &= (PAR[PM_PAR_I0] > 0);
    409407    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
    410408
     409<<<<<<< .working
    411410    fprintf (stderr, "SERSIC status pars: dP: %f, I0: %f, S/N: %f\n",
    412411             dP, PAR[PM_PAR_I0], (dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]));
    413412
     413=======
     414>>>>>>> .merge-right.r25750
    414415    return status;
    415416}
Note: See TracChangeset for help on using the changeset viewer.