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

    r11253 r14544  
    11/* @file  pmModelGroup.h
    22 *
    3  * The object model function types are defined to allow for the flexible addition
    4  * of new object models. Every object model, with parameters represented by
    5  * pmModel, has an associated set of functions which provide necessary support
    6  * operations. A set of abstract functions allow the programmer to select the
    7  * approriate function or property for a specific named object model.
     3 * The object model function types are desined to allow for the flexible addition of new object
     4 * models. Every object model, with parameters represented by pmModel, has an associated set of
     5 * functions which provide necessary support operations. A set of abstract functions allow the
     6 * programmer to select the approriate function or property for a specific named object model.
     7 *
     8 * Every model instance belongs to a class of models, defined by the value of
     9 * the pmModelType type entry. Various functions need access to information about
     10 * each of the models. Some of this information varies from model to model, and
     11 * may depend on the current parameter values or other data quantities. In order
     12 * to keep the code from requiring the information about each model to be coded
     13 * into the low-level fitting routines, we define a collection of functions which
     14 * allow us to abstract this type of model-dependent information. These generic
     15 * functions take the model type and return the corresponding function pointer
     16 * for the specified model. Each model is defined by creating this collection of
     17 * specific functions, and placing them in a single file for each model. We
     18 * define the following structure to carry the collection of information about
     19 * the models.
    820 *
    921 * @author EAM, IfA
    1022 *
    11  * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    12  * @date $Date: 2007-01-24 02:54:15 $
     23 * @version $Revision: 1.7.14.1 $ $Name: not supported by cvs2svn $
     24 * @date $Date: 2007-08-17 21:01:59 $
    1325 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1426 */
     
    2335typedef psMinimizeLMChi2Func pmModelFunc;
    2436
    25 //  This function is the model chi-square minimization function for this model.
     37//  This function sets the parameter limits for this model.
    2638typedef psMinimizeLMLimitFunc pmModelLimits;
    2739
     
    2941typedef psF64 (*pmModelFlux)(const psVector *params);
    3042
    31 
    3243// This function returns the radius at which the given model and parameters
    3344// achieves the given flux.
    3445typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
    3546
    36 /*  This function sets the model parameter limits vectors for the given model
    37  */
    38 // typedef bool (*pmModelLimits)(psVector **beta_lim, psVector **params_min, psVector **params_max);
    39 
    40 /*  This function provides the model guess parameters based on the details of
    41  *   the given source.
    42  */
     47//  This function provides the model guess parameters based on the details of
     48//  the given source.
    4349typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
    4450
    45 
    46 /*  This function constructs the PSF model for the given source based on the
    47  *  supplied psf and the EXT model for the object.
    48  */
     51//  This function constructs the PSF model for the given source based on the
     52//  supplied psf and the EXT model for the object.
    4953typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelEXT, pmPSF *psf);
    5054
    51 /*  This function returns the success / failure status of the given model fit
    52  */
     55//  This function sets the model parameters based on the PSF for a given coordinate and central
     56//  intensity
     57typedef bool (*pmModelParamsFromPSF)(pmModel *model, pmPSF *psf, float Xo, float Yo, float Io);
     58
     59//  This function returns the success / failure status of the given model fit
    5360typedef bool (*pmModelFitStatusFunc)(pmModel *model);
    5461
    55 /* Every model instance belongs to a class of models, defined by the value of
    56  * the pmModelType type entry. Various functions need access to information about
    57  * each of the models. Some of this information varies from model to model, and
    58  * may depend on the current parameter values or other data quantities. In order
    59  * to keep the code from requiring the information about each model to be coded
    60  * into the low-level fitting routines, we define a collection of functions which
    61  * allow us to abstract this type of model-dependent information. These generic
    62  * functions take the model type and return the corresponding function pointer
    63  * for the specified model. Each model is defined by creating this collection of
    64  * specific functions, and placing them in a single file for each model. We
    65  * define the following structure to carry the collection of information about
    66  * the models.
    67  */
    6862typedef struct
    6963{
     
    7670    pmModelGuessFunc     modelGuessFunc;
    7771    pmModelFromPSFFunc   modelFromPSFFunc;
     72    pmModelParamsFromPSF modelParamsFromPSF;
    7873    pmModelFitStatusFunc modelFitStatusFunc;
    7974}
Note: See TracChangeset for help on using the changeset viewer.