00001 /** @file pmModelGroup.h 00002 * 00003 * The object model function types are defined to allow for the flexible addition 00004 * of new object models. Every object model, with parameters represented by 00005 * pmModel, has an associated set of functions which provide necessary support 00006 * operations. A set of abstract functions allow the programmer to select the 00007 * approriate function or property for a specific named object model. 00008 * 00009 * @author EAM, IfA 00010 * 00011 * @version $Revision: 1.1 $ $Name: rel8_0 $ 00012 * @date $Date: 2005/10/10 19:53:40 $ 00013 * 00014 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 00015 * 00016 */ 00017 #include "pmObjects.h" 00018 #include "pmPSF.h" 00019 /** 00020 * 00021 * This function returns the number of parameters used by the listed function. 00022 * 00023 */ 00024 int pmModelParameterCount( 00025 pmModelType type ///< Add comment. 00026 ); 00027 00028 00029 /** 00030 * 00031 * This function returns the user-space model names for the specified model type. 00032 * 00033 */ 00034 char *pmModelGetType( 00035 pmModelType type ///< Add comment. 00036 ); 00037 00038 00039 /** 00040 * 00041 * This function returns the internal model type code for the user-space model names. 00042 * 00043 */ 00044 pmModelType pmModelSetType( 00045 char *name ///< Add comment. 00046 ); 00047 00048 00049 #ifndef PM_MODEL_GROUP_H 00050 #define PM_MODEL_GROUP_H 00051 00052 /** 00053 * 00054 * This function is the model chi-square minimization function for this model. 00055 * 00056 */ 00057 typedef psMinimizeLMChi2Func pmModelFunc; 00058 00059 00060 /** 00061 * 00062 * This function returns the integrated flux for the given model parameters. 00063 */ 00064 typedef psF64 (*pmModelFlux)(const psVector *params); 00065 00066 00067 /** 00068 * 00069 * This function returns the radius at which the given model and parameters 00070 * achieves the given flux. 00071 * 00072 */ 00073 typedef psF64 (*pmModelRadius)(const psVector *params, double flux); 00074 00075 /** 00076 * 00077 * This function sets the model parameter limits vectors for the given model 00078 * 00079 */ 00080 typedef bool (*pmModelLimits)(psVector **beta_lim, psVector **params_min, psVector **params_max); 00081 00082 /** 00083 * 00084 * This function provides the model guess parameters based on the details of 00085 * the given source. 00086 * 00087 */ 00088 typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source); 00089 00090 00091 /** 00092 * 00093 * This function constructs the PSF model for the given source based on the 00094 * supplied psf and the FLT model for the object. 00095 * 00096 */ 00097 typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf); 00098 00099 /** 00100 * 00101 * This function returns the success / failure status of the given model fit 00102 * 00103 */ 00104 typedef bool (*pmModelFitStatusFunc)(pmModel *model); 00105 00106 /** 00107 * 00108 * Each of the function types above has a corresponding function which returns 00109 * the function given the model type: 00110 * 00111 */ 00112 00113 00114 /** 00115 * 00116 * pmModelFunc is the function used to determine the value of the model at a 00117 * specific coordinate, and is the one used by psMinimizeLMChi2. 00118 * 00119 */ 00120 pmModelFunc pmModelFunc_GetFunction (pmModelType type); 00121 00122 00123 /** 00124 * 00125 * pmModelFlux returns the total integrated flux for the given input parameters. 00126 * 00127 */ 00128 pmModelFlux pmModelFlux_GetFunction (pmModelType type); 00129 00130 00131 /** 00132 * 00133 * pmModelRadius returns the scaling radius at which the flux of the model 00134 * matches the specified flux. This presumes that the model is a function of an 00135 * elliptical contour. 00136 * 00137 */ 00138 pmModelRadius pmModelRadius_GetFunction (pmModelType type); 00139 00140 00141 /** 00142 * 00143 * pmModelLimits sets the parameter limit vectors for the function. 00144 * 00145 */ 00146 pmModelLimits pmModelLimits_GetFunction (pmModelType type); 00147 00148 00149 /** 00150 * 00151 * pmModelGuessFunc generates an initial guess for the model based on the 00152 * provided source statistics (moments and pixel values as needed). 00153 * 00154 */ 00155 pmModelGuessFunc pmModelGuessFunc_GetFunction (pmModelType type); 00156 00157 00158 /** 00159 * 00160 * pmModelFromPSFFunc takes as input a representation of the psf and a value 00161 * for the model and fills in the PSF parameters of the model. The input 00162 * primarily relies upon the centroid coordinates of the input model, though the 00163 * normalization may potentially be used. 00164 * 00165 */ 00166 pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type); 00167 00168 00169 /** 00170 * 00171 * pmModelFitStatusFunc returns a true or false values based on the success or 00172 * failure of a model fit. The success is determined by quantities such as the 00173 * chisq or the signal-to-noise. 00174 * 00175 */ 00176 pmModelFitStatusFunc pmModelFitStatusFunc_GetFunction (pmModelType type); 00177 00178 00179 00180 00181 /** 00182 * 00183 * Every model instance belongs to a class of models, defined by the value of 00184 * the pmModelType type entry. Various functions need access to information about 00185 * each of the models. Some of this information varies from model to model, and 00186 * may depend on the current parameter values or other data quantities. In order 00187 * to keep the code from requiring the information about each model to be coded 00188 * into the low-level fitting routines, we define a collection of functions which 00189 * allow us to abstract this type of model-dependent information. These generic 00190 * functions take the model type and return the corresponding function pointer 00191 * for the specified model. Each model is defined by creating this collection of 00192 * specific functions, and placing them in a single file for each model. We 00193 * define the following structure to carry the collection of information about 00194 * the models. 00195 * 00196 */ 00197 typedef struct 00198 { 00199 char *name; 00200 int nParams; 00201 pmModelFunc modelFunc; 00202 pmModelFlux modelFlux; 00203 pmModelRadius modelRadius; 00204 pmModelLimits modelLimits; 00205 pmModelGuessFunc modelGuessFunc; 00206 pmModelFromPSFFunc modelFromPSFFunc; 00207 pmModelFitStatusFunc modelFitStatusFunc; 00208 } 00209 pmModelGroup; 00210 00211 # endif
1.4.5