Changeset 6556 for branches/rel10_ifa/psModules/src/objects/pmModelGroup.h
- Timestamp:
- Mar 8, 2006, 5:14:23 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/objects/pmModelGroup.h
r6448 r6556 9 9 * @author EAM, IfA 10 10 * 11 * @version $Revision: 1.2.4. 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-0 2-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 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 15 * 16 16 */ 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. 22 typedef psMinimizeLMChi2Func pmModelFunc; 23 24 // This function returns the integrated flux for the given model parameters. 25 typedef 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. 30 typedef psF64 (*pmModelRadius)(const psVector *params, double flux); 31 32 /* This function sets the model parameter limits vectors for the given model 33 */ 34 typedef 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 */ 39 typedef 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 */ 45 typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelEXT, pmPSF *psf); 46 47 /* This function returns the success / failure status of the given model fit 48 */ 49 typedef 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 */ 64 typedef 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 } 76 pmModelGroup; 77 78 // allocate a pmModelGroup to hold nModels entries 79 pmModelGroup *pmModelGroupAlloc (int nModels); 80 81 // initialize the internal (static) model group with the default models 82 void pmModelGroupInit (void); 83 84 // free the internal (static) model group 85 void pmModelGroupCleanup (void); 86 87 // add a new model to the internal (static) model group 88 void pmModelGroupAdd (pmModelGroup *model); 89 90 /* This function returns the number of parameters used by the listed function. 23 91 */ 24 92 int pmModelParameterCount( … … 27 95 28 96 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. 33 98 */ 34 99 char *pmModelGetType( … … 46 111 ); 47 112 48 49 #ifndef PM_MODEL_GROUP_H50 #define PM_MODEL_GROUP_H51 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 parameters70 * 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 model78 *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 of85 * 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 the94 * 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 fit102 *103 */104 typedef bool (*pmModelFitStatusFunc)(pmModel *model);105 106 113 /** 107 114 * … … 110 117 * 111 118 */ 112 113 119 114 120 /** … … 177 183 178 184 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 */ 194 pmModel *pmSourceModelGuess( 195 pmSource *source, ///< The input pmSource 196 pmModelType model ///< The type of model to be created. 197 ); 179 198 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.
