IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2006, 5:14:23 PM (20 years ago)
Author:
magnier
Message:

major rework of objects code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/objects/pmModelGroup.h

    r6448 r6556  
    99 *  @author EAM, IfA
    1010 *
    11  *  @version $Revision: 1.2.4.1 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-02-17 17:13:42 $
     11 *  @version $Revision: 1.2.4.2 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-03-09 03:14:23 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1515 *
    1616 */
    17 #include "pmObjects.h"
    18 #include "pmPSF.h"
    19 /**
    20  *
    21  * This function returns the number of parameters used by the listed function.
    22  *
     17
     18# ifndef PM_MODEL_GROUP_H
     19# define PM_MODEL_GROUP_H
     20
     21//  This function is the model chi-square minimization function for this model.
     22typedef psMinimizeLMChi2Func pmModelFunc;
     23
     24// This function returns the integrated flux for the given model parameters.
     25typedef psF64 (*pmModelFlux)(const psVector *params);
     26
     27
     28// This function returns the radius at which the given model and parameters
     29// achieves the given flux.
     30typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
     31
     32/*  This function sets the model parameter limits vectors for the given model
     33 */
     34typedef bool (*pmModelLimits)(psVector **beta_lim, psVector **params_min, psVector **params_max);
     35
     36/*  This function provides the model guess parameters based on the details of
     37 *   the given source.
     38 */
     39typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
     40
     41
     42/*  This function constructs the PSF model for the given source based on the
     43 *  supplied psf and the EXT model for the object.
     44 */
     45typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelEXT, pmPSF *psf);
     46
     47/*  This function returns the success / failure status of the given model fit
     48 */
     49typedef bool (*pmModelFitStatusFunc)(pmModel *model);
     50
     51/* Every model instance belongs to a class of models, defined by the value of
     52 * the pmModelType type entry. Various functions need access to information about
     53 * each of the models. Some of this information varies from model to model, and
     54 * may depend on the current parameter values or other data quantities. In order
     55 * to keep the code from requiring the information about each model to be coded
     56 * into the low-level fitting routines, we define a collection of functions which
     57 * allow us to abstract this type of model-dependent information. These generic
     58 * functions take the model type and return the corresponding function pointer
     59 * for the specified model. Each model is defined by creating this collection of
     60 * specific functions, and placing them in a single file for each model. We
     61 * define the following structure to carry the collection of information about
     62 * the models.
     63 */
     64typedef struct
     65{
     66    char *name;
     67    int nParams;
     68    pmModelFunc          modelFunc;
     69    pmModelFlux          modelFlux;
     70    pmModelRadius        modelRadius;
     71    pmModelLimits        modelLimits;
     72    pmModelGuessFunc     modelGuessFunc;
     73    pmModelFromPSFFunc   modelFromPSFFunc;
     74    pmModelFitStatusFunc modelFitStatusFunc;
     75}
     76pmModelGroup;
     77
     78// allocate a pmModelGroup to hold nModels entries
     79pmModelGroup *pmModelGroupAlloc (int nModels);
     80
     81// initialize the internal (static) model group with the default models
     82void pmModelGroupInit (void);
     83
     84// free the internal (static) model group
     85void pmModelGroupCleanup (void);
     86
     87// add a new model to the internal (static) model group
     88void pmModelGroupAdd (pmModelGroup *model);
     89
     90/* This function returns the number of parameters used by the listed function.
    2391 */
    2492int pmModelParameterCount(
     
    2795
    2896
    29 /**
    30  *
    31  * This function returns the user-space model names for the specified model type.
    32  *
     97/* This function returns the user-space model names for the specified model type.
    3398 */
    3499char *pmModelGetType(
     
    46111);
    47112
    48 
    49 #ifndef PM_MODEL_GROUP_H
    50 #define PM_MODEL_GROUP_H
    51 
    52 /**
    53  *
    54  *  This function is the model chi-square minimization function for this model.
    55  *
    56  */
    57 typedef psMinimizeLMChi2Func pmModelFunc;
    58 
    59 
    60 /**
    61  *
    62  * This function returns the integrated flux for the given model parameters.
    63  */
    64 typedef psF64 (*pmModelFlux)(const psVector *params);
    65 
    66 
    67 /**
    68  *
    69  *  This function returns the radius at which the given model and parameters
    70  *  achieves the given flux.
    71  *
    72  */
    73 typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
    74 
    75 /**
    76  *
    77  *  This function sets the model parameter limits vectors for the given model
    78  *
    79  */
    80 typedef bool (*pmModelLimits)(psVector **beta_lim, psVector **params_min, psVector **params_max);
    81 
    82 /**
    83  *
    84  *  This function provides the model guess parameters based on the details of
    85  *   the given source.
    86  *
    87  */
    88 typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
    89 
    90 
    91 /**
    92  *
    93  *  This function constructs the PSF model for the given source based on the
    94  *  supplied psf and the EXT model for the object.
    95  *
    96  */
    97 typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelEXT, pmPSF *psf);
    98 
    99 /**
    100  *
    101  *  This function returns the success / failure status of the given model fit
    102  *
    103  */
    104 typedef bool (*pmModelFitStatusFunc)(pmModel *model);
    105 
    106113/**
    107114 *
     
    110117 *
    111118 */
    112 
    113119
    114120/**
     
    177183
    178184
     185/** pmSourceModelGuess()
     186 *
     187 * Convert available data to an initial guess for the given model. This
     188 * function allocates a pmModel entry for the pmSource structure based on the
     189 * provided model selection. The method of defining the model parameter guesses
     190 * are specified for each model below. The guess values are placed in the model
     191 * parameters. The function returns TRUE on success or FALSE on failure.
     192 *
     193 */
     194pmModel *pmSourceModelGuess(
     195    pmSource *source,   ///< The input pmSource
     196    pmModelType model   ///< The type of model to be created.
     197);
    179198
    180 
    181 /**
    182  *
    183  * Every model instance belongs to a class of models, defined by the value of
    184  * the pmModelType type entry. Various functions need access to information about
    185  * each of the models. Some of this information varies from model to model, and
    186  * may depend on the current parameter values or other data quantities. In order
    187  * to keep the code from requiring the information about each model to be coded
    188  * into the low-level fitting routines, we define a collection of functions which
    189  * allow us to abstract this type of model-dependent information. These generic
    190  * functions take the model type and return the corresponding function pointer
    191  * for the specified model. Each model is defined by creating this collection of
    192  * specific functions, and placing them in a single file for each model. We
    193  * define the following structure to carry the collection of information about
    194  * the models.
    195  *
    196  */
    197 typedef struct
    198 {
    199     char *name;
    200     int nParams;
    201     pmModelFunc          modelFunc;
    202     pmModelFlux          modelFlux;
    203     pmModelRadius        modelRadius;
    204     pmModelLimits        modelLimits;
    205     pmModelGuessFunc     modelGuessFunc;
    206     pmModelFromPSFFunc   modelFromPSFFunc;
    207     pmModelFitStatusFunc modelFitStatusFunc;
    208 }
    209 pmModelGroup;
    210 
    211 // allocate a pmModelGroup to hold nModels entries
    212 pmModelGroup *pmModelGroupAlloc (int nModels);
    213 
    214 // initialize the internal (static) model group with the default models
    215 void pmModelGroupInit (void);
    216 
    217 // free the internal (static) model group
    218 void pmModelGroupCleanup (void);
    219 
    220 // add a new model to the internal (static) model group
    221 void pmModelGroupAdd (pmModelGroup *model);
    222 
    223 # endif
     199# endif /* PM_MODEL_GROUP_H */
Note: See TracChangeset for help on using the changeset viewer.