IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25351


Ignore:
Timestamp:
Sep 13, 2009, 4:49:08 PM (17 years ago)
Author:
eugene
Message:

clean up comments, notes on 0.5 PIX, drop old dPAR test (ill-defined), force sky == 0.0

Location:
branches/eam_branches/20090715/psModules/src/objects/models
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_GAUSS.c

    r25303 r25351  
    11/******************************************************************************
    22 * this file defines the GAUSS 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
     
    192192
    193193// make an initial guess for parameters
     194// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    194195bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    195196{
     
    207208    psEllipseShape shape = psEllipseAxesToShape (axes);
    208209
    209     PAR[PM_PAR_SKY]  = moments->Sky;
     210    PAR[PM_PAR_SKY]  = 0.0;
    210211    PAR[PM_PAR_I0]   = peak->flux;
    211212    PAR[PM_PAR_XPOS] = peak->xf;
     
    369370bool PM_MODEL_FIT_STATUS (pmModel *model)
    370371{
    371     psF32 dP;
    372372    bool  status;
    373373
     
    375375    psF32 *dPAR = model->dparams->data.F32;
    376376
    377     dP = 0;
    378     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    379     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    380     dP = sqrt (dP);
    381 
    382377    status = true;
    383     status &= (dP < 0.5);
    384378    status &= (PAR[PM_PAR_I0] > 0);
    385379    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
    386380
    387     if (status)
    388         return true;
    389     return false;
     381    return status;
    390382}
    391383
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_PGAUSS.c

    r20001 r25351  
    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
     
    2929
    3030// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     31// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     32// values need to be pixel coords
    3133psF32 PM_MODEL_FUNC(psVector *deriv,
    3234                    const psVector *params,
     
    191193
    192194// make an initial guess for parameters
     195// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    193196bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    194197{
     
    205208    psEllipseShape shape = psEllipseAxesToShape (axes);
    206209
    207     PAR[PM_PAR_SKY]  = moments->Sky;
     210    PAR[PM_PAR_SKY]  = 0.0;
    208211    PAR[PM_PAR_I0]   = peak->flux;
    209212    PAR[PM_PAR_XPOS] = peak->xf;
     
    415418bool PM_MODEL_FIT_STATUS (pmModel *model)
    416419{
    417     psF32 dP;
    418420    bool  status;
    419421
     
    421423    psF32 *dPAR = model->dparams->data.F32;
    422424
    423     dP = 0;
    424     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    425     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    426     dP = sqrt (dP);
    427 
    428425    status = true;
    429     status &= (dP < 0.5);
    430426    status &= (PAR[PM_PAR_I0] > 0);
    431427    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_PS1_V1.c

    r23962 r25351  
    11/******************************************************************************
    2  * this file defines the PS1_V1 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'
    4  * statements of their own.  The models use a psVector to represent the set of parameters, with
    5  * the sequence used to specify the meaning of the parameter.  The meaning of the parameters
    6  * may thus vary depending on the specifics of the model.  All models which are used a PSF
    7  * representations share a few parameters, for which # define names are listed in pmModel.h:
     2 * this file defines the PS1_V1 source shape model.  Note that these model functions are loaded
     3 * by pmModelClass.c using 'include', and thus need no 'include' statements of their own.  The
     4 * models use a psVector to represent the set of parameters, with the sequence used to specify
     5 * 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 as a PSF representations share a few
     7 * parameters, for which # define names are listed in pmModel.h:
    88
    99   power-law with fitted linear term
     
    3232# define ALPHA_M 0.666
    3333
     34// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     35// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     36// values need to be pixel coords
    3437psF32 PM_MODEL_FUNC (psVector *deriv,
    3538                     const psVector *params,
     
    216219
    217220// make an initial guess for parameters
     221// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    218222bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    219223{
     
    240244    if (!isfinite(shape.sxy)) return false;
    241245
    242     // XXX turn this off here for now PAR[PM_PAR_SKY]  = moments->Sky;
    243246    PAR[PM_PAR_SKY]  = 0.0;
    244247    PAR[PM_PAR_I0]   = peak->flux;
     
    448451bool PM_MODEL_FIT_STATUS (pmModel *model)
    449452{
    450 
    451     psF32 dP;
    452453    bool  status;
    453454
     
    455456    psF32 *dPAR = model->dparams->data.F32;
    456457
    457     dP = 0;
    458     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    459     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    460     dP = sqrt (dP);
    461 
    462458    status = true;
    463 //    status &= (dP < 0.5);
    464459    status &= (PAR[PM_PAR_I0] > 0);
    465460    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_QGAUSS.c

    r20001 r25351  
    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
     
    2929# define PM_MODEL_FIT_STATUS      pmModelFitStatus_QGAUSS
    3030
     31// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     32// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     33// values need to be pixel coords
    3134psF32 PM_MODEL_FUNC (psVector *deriv,
    3235                     const psVector *params,
     
    213216
    214217// make an initial guess for parameters
     218// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    215219bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    216220{
     
    237241    if (!isfinite(shape.sxy)) return false;
    238242
    239     // XXX turn this off here for now PAR[PM_PAR_SKY]  = moments->Sky;
    240243    PAR[PM_PAR_SKY]  = 0.0;
    241244    PAR[PM_PAR_I0]   = peak->flux;
     
    444447bool PM_MODEL_FIT_STATUS (pmModel *model)
    445448{
    446 
    447     psF32 dP;
    448449    bool  status;
    449450
     
    451452    psF32 *dPAR = model->dparams->data.F32;
    452453
    453     dP = 0;
    454     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    455     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    456     dP = sqrt (dP);
    457 
    458454    status = true;
    459 //    status &= (dP < 0.5);
    460455    status &= (PAR[PM_PAR_I0] > 0);
    461456    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_RGAUSS.c

    r20001 r25351  
    11/******************************************************************************
    22 * this file defines the RGAUSS 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
    6  * may thus vary depending on the specifics of the model.  All models which are used a PSF
     6 * may thus vary depending on the specifics of the model.  All models which are used as a PSF
    77 * representations share a few parameters, for which # define names are listed in pmModel.h:
    88
     
    2929# define PM_MODEL_FIT_STATUS      pmModelFitStatus_RGAUSS
    3030
     31// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     32// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     33// values need to be pixel coords
    3134psF32 PM_MODEL_FUNC (psVector *deriv,
    3235                     const psVector *params,
     
    6265        dPAR[PM_PAR_SXY] = -q*X*Y;
    6366
    64         // this model derivative is undefined at z = 0.0, but is actually 0.0
     67        // this model derivative is undefined at z = 0.0, but the limit is zero as z -> 0.0
    6568        dPAR[PM_PAR_7] = (z == 0.0) ? 0.0 : -5.0*t*log(z)*p*z;
    6669    }
     
    206209
    207210// make an initial guess for parameters
     211// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    208212bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    209213{
     
    230234    if (!isfinite(shape.sxy)) return false;
    231235
    232     PAR[PM_PAR_SKY]  = moments->Sky;
     236    PAR[PM_PAR_SKY]  = 0.0;
    233237    PAR[PM_PAR_I0]   = peak->flux;
    234238    PAR[PM_PAR_XPOS] = peak->xf;
     
    436440bool PM_MODEL_FIT_STATUS (pmModel *model)
    437441{
    438 
    439     psF32 dP;
    440442    bool  status;
    441443
     
    443445    psF32 *dPAR = model->dparams->data.F32;
    444446
    445     dP = 0;
    446     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    447     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    448     dP = sqrt (dP);
    449 
    450447    status = true;
    451     status &= (dP < 0.5);
    452448    status &= (PAR[PM_PAR_I0] > 0);
    453449    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_SERSIC.c

    r20001 r25351  
    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
     
    3232# define PM_MODEL_FIT_STATUS      pmModelFitStatus_SERSIC
    3333
     34// the model is a function of the pixel coordinate (pixcoord[0,1] = x,y)
     35// 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords
     36// values need to be pixel coords
    3437psF32 PM_MODEL_FUNC (psVector *deriv,
    3538                     const psVector *params,
     
    223226
    224227// make an initial guess for parameters
     228// 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters
    225229bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    226230{
     
    247251    if (!isfinite(shape.sxy)) return false;
    248252
    249     // XXX PAR[PM_PAR_SKY]  = moments->Sky;
    250253    PAR[PM_PAR_SKY]  = 0.0;
    251254    PAR[PM_PAR_I0]   = peak->flux;
     
    429432bool PM_MODEL_FIT_STATUS (pmModel *model)
    430433{
    431 
    432     psF32 dP;
    433434    bool  status;
    434435
     
    436437    psF32 *dPAR = model->dparams->data.F32;
    437438
    438     dP = 0;
    439     dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);
    440     dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);
    441     dP = sqrt (dP);
    442 
    443439    status = true;
    444 //    status &= (dP < 0.5);
    445440    status &= (PAR[PM_PAR_I0] > 0);
    446441    status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
    447 
    448     fprintf (stderr, "SERSIC status pars: dP: %f, I0: %f, S/N: %f\n",
    449              dP, PAR[PM_PAR_I0], (dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]));
    450442
    451443    return status;
Note: See TracChangeset for help on using the changeset viewer.