IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 17, 2007, 11:01:59 AM (19 years ago)
Author:
magnier
Message:

substantial cleanups of APIs:

changed pmModelGroup to pmModelClass

dropped the _GetFunctions, and moved the modelClass-specific functions
to functions pointers in the pmModel structure. These are assigned
when the model is allocated, based on the model type. Now, instead of
calling, for example,

modelFunc = pmModelFunc_GetFunctions(model->type)
modelFunc();

you just do:

model->modelFunc()

moved some of the support functions into pmModelUtils and
pmSourceUtils.

changed pmIsFooBar to pmFooBarTest for better api listing.

added functions to evaluate and add/subtract models applying an offset
between the image coordinate frame and the chip frame (required frame
for model parameters)

added function(s) to instatiate a pmModel from a pmPSF based on a
given coordinate and peak flux.

added a function to set the model normalization based on a source flux
value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070817/psModules/src/objects/pmPSF.c

    r13898 r14544  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-06-20 02:22:26 $
     8 *  @version $Revision: 1.25.6.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-08-17 21:01:59 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232#include "pmGrowthCurve.h"
    3333#include "pmPSF.h"
    34 #include "pmModelGroup.h"
     34#include "pmModelClass.h"
    3535#include "pmSourcePhotometry.h"
    3636#include "pmFPAMaskWeight.h"
     
    124124    psf->residuals = NULL;
    125125
    126     Nparams = pmModelParameterCount (type);
     126    Nparams = pmModelClassParameterCount (type);
    127127    if (!Nparams) {
    128128        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
     
    169169pmModel *pmModelFromPSF (pmModel *modelEXT, pmPSF *psf)
    170170{
    171 
    172     // need to define the relationship between the modelEXT and modelPSF ?
    173 
    174     // find function used to set the model parameters
    175     pmModelFromPSFFunc modelFromPSFFunc = pmModelFromPSFFunc_GetFunction (psf->type);
    176 
    177171    // allocate a new pmModel to hold the PSF version
    178172    pmModel *modelPSF = pmModelAlloc (psf->type);
    179173
    180174    // set model parameters for this source based on PSF information
    181     if (!modelFromPSFFunc (modelPSF, modelEXT, psf)) {
     175    if (!modelEXT->modelFromPSF (modelPSF, modelEXT, psf)) {
    182176        psError(PM_ERR_PSF, false, "Failed to set model params from PSF");
    183177        psFree(modelPSF);
     
    335329    va_start(ap, sxy);
    336330
    337     pmModelType type = pmModelSetType (typeName);
     331    pmModelType type = pmModelClassGetType (typeName);
    338332    psPolynomial2D *psfTrend = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, 0, 0);
    339333    pmPSF *psf = pmPSFAlloc (type, true, psfTrend);
Note: See TracChangeset for help on using the changeset viewer.