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/pmModel.h

    r13898 r14544  
    1 /* @file  pmObjects.h
     1/* @file  pmModel.h
    22 * @brief Functions to define and manipulate object models
    33 *
     
    55 * @author EAM, IfA
    66 *
    7  * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-06-20 02:22:26 $
     7 * @version $Revision: 1.11.6.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2007-08-17 21:01:59 $
    99 *
    1010 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1414# define PM_MODEL_H
    1515
     16# define TMP_PSF_TYPE void
     17# define TMP_MODEL_TYPE void
     18# define TMP_SOURCE_TYPE void
     19
    1620/// @addtogroup Objects Object Detection / Analysis Functions
    1721/// @{
     22
     23/* pointers for the functions types below are supplied to each pmModel, and can be used by
     24   the programmer without needing to know the model class */
    1825
    1926// type of model carried by the pmModel structure
     
    4148} pmModelOpMode;
    4249
     50//  This function is the model chi-square minimization function for this model.
     51typedef psMinimizeLMChi2Func pmModelFunc;
     52
     53//  This function sets the parameter limits for this model.
     54typedef psMinimizeLMLimitFunc pmModelLimits;
     55
     56// This function returns the integrated flux for the given model parameters.
     57typedef psF64 (*pmModelFlux)(const psVector *params);
     58
     59// This function returns the radius at which the given model and parameters
     60// achieves the given flux.
     61typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
     62
     63//  This function provides the model guess parameters based on the details of
     64//  the given source.
     65typedef bool (*pmModelGuessFunc)(TMP_MODEL_TYPE *model, TMP_SOURCE_TYPE *source);
     66
     67//  This function constructs the PSF model for the given source based on the
     68//  supplied psf and the EXT model for the object.
     69typedef bool (*pmModelFromPSFFunc)(TMP_MODEL_TYPE *modelPSF, TMP_MODEL_TYPE *modelEXT, TMP_PSF_TYPE *psf);
     70
     71//  This function sets the model parameters based on the PSF for a given coordinate and central
     72//  intensity
     73typedef bool (*pmModelParamsFromPSF)(TMP_MODEL_TYPE *model, TMP_PSF_TYPE *psf, float Xo, float Yo, float Io);
     74
     75//  This function returns the success / failure status of the given model fit
     76typedef bool (*pmModelFitStatusFunc)(TMP_MODEL_TYPE *model);
     77
    4378/** pmModel data structure
    4479 *
     
    6297    float radiusFit;                    ///< fit radius actually used
    6398    pmResiduals *residuals;             ///< normalized PSF residuals
    64 }
    65 pmModel;
    6699
    67 /* XXX we are currently saving the residuals with the pmModel.  It might be better to save this
    68  * in the pmSource.  we may want an API to Add/Sub a pmModel (analytical model only) or a
    69  * pmSource (analytical + residuals).
    70  */
     100    // functions for this model which depend on the model class
     101    pmModelFunc          modelFunc;
     102    pmModelFlux          modelFlux;
     103    pmModelRadius        modelRadius;
     104    pmModelLimits        modelLimits;
     105    pmModelGuessFunc     modelGuess;
     106    pmModelFromPSFFunc   modelFromPSF;
     107    pmModelParamsFromPSF modelParamsFromPSF;
     108    pmModelFitStatusFunc modelFitStatus;
     109} pmModel;
    71110
    72111/** Symbolic names for the elements of [d]params
Note: See TracChangeset for help on using the changeset viewer.