IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 13, 2014, 8:35:36 AM (12 years ago)
Author:
eugene
Message:

remove pmModel class functions from pmModel and replace with a pointer to the class; call model->class->function instead of model->function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPSF.c

    r36623 r36859  
    3737#include "pmMoments.h"
    3838#include "pmModelFuncs.h"
     39#include "pmModelClass.h"
    3940#include "pmModel.h"
    4041#include "pmModelUtils.h"
    41 #include "pmModelClass.h"
    4242#include "pmSourceMasks.h"
    4343#include "pmSourceExtendedPars.h"
     
    329329// convert the parameters used in the fitted source model to the psEllipseAxes representation
    330330// (major,minor,theta)
    331 psEllipseAxes pmPSF_ModelToAxes (psF32 *modelPar, pmModelType type)
     331psEllipseAxes pmPSF_ModelToAxes (psF32 *modelPar, bool useReff)
    332332{
    333333    psEllipseAxes axes;
     
    338338    PS_ASSERT_PTR_NON_NULL(modelPar, axes);
    339339
    340     bool useReff = pmModelUseReff (type);
    341340    pmModelParamsToAxes (&axes, modelPar[PM_PAR_SXX], modelPar[PM_PAR_SXY], modelPar[PM_PAR_SYY], useReff);
    342341    return axes;
     
    345344// convert the psEllipseAxes representation (major,minor,theta) to the parameters used in the
    346345// fitted source model
    347 bool pmPSF_AxesToModel (psF32 *modelPar, psEllipseAxes axes, pmModelType type)
     346bool pmPSF_AxesToModel (psF32 *modelPar, psEllipseAxes axes, bool useReff)
    348347{
    349348    PS_ASSERT_PTR_NON_NULL(modelPar, false);
     
    357356    }
    358357   
    359     bool useReff = pmModelUseReff (type);
    360358    pmModelAxesToParams (&modelPar[PM_PAR_SXX], &modelPar[PM_PAR_SXY], &modelPar[PM_PAR_SYY], axes, useReff);
    361359    return true;
     
    420418
    421419    // get the model full-width at half-max
    422     float fwhmMajor = 2*model->modelRadius (model->params, 0.5);
     420    float fwhmMajor = 2*model->class->modelRadius (model->params, 0.5);
    423421
    424422# if (0)
    425423    psF32 *params = model->params->data.F32; // Model parameters
    426     psEllipseAxes axes = pmPSF_ModelToAxes(params, MAX_AXIS_RATIO, model->type); // Ellipse axes
     424    psEllipseAxes axes = pmPSF_ModelToAxes(params, MAX_AXIS_RATIO, model->class->useReff); // Ellipse axes
    427425
    428426    // Curiously, the minor axis can be larger than the major axis, so need to check.
Note: See TracChangeset for help on using the changeset viewer.