Changeset 4770 for trunk/psModules/src/pmObjects.h
- Timestamp:
- Aug 15, 2005, 3:10:36 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmObjects.h (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmObjects.h
r4579 r4770 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 7-19 01:44:48$7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-08-16 01:10:34 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "pslib.h" 24 24 25 /** pmPeakType 26 * 27 * A peak pixel may have several features which may be determined when the 28 * peak is found or measured. These are specified by the pmPeakType enum. 29 * PM_PEAK_LONE represents a single pixel which is higher than its 8 immediate 30 * neighbors. The PM_PEAK_EDGE represents a peak pixel which touching the image 31 * edge. The PM_PEAK_FLAT represents a peak pixel which has more than a specific 32 * number of neighbors at the same value, within some tolarence: 33 * 34 */ 25 35 typedef enum { 26 PM_PEAK_LONE, ///< Isolated peak. 27 PM_PEAK_EDGE, ///< Peak on edge. 28 PM_PEAK_FLAT, ///< Peak has equal-value neighbors. 29 PM_PEAK_UNDEF ///< Undefined. 30 } psPeakType; 31 36 PM_PEAK_LONE, ///< Isolated peak. 37 PM_PEAK_EDGE, ///< Peak on edge. 38 PM_PEAK_FLAT, ///< Peak has equal-value neighbors. 39 PM_PEAK_UNDEF ///< Undefined. 40 } pmPeakType; 41 42 /** pmPeak data structure 43 * 44 * 45 * 46 */ 32 47 typedef struct 33 48 { 34 psS32 x;///< X-coordinate of peak pixel.35 psS32 y;///< Y-coordinate of peak pixel.36 psF32 counts;///< Value of peak pixel (above sky?).37 p sPeakType class;///< Description of peak.49 int x; ///< X-coordinate of peak pixel. 50 int y; ///< Y-coordinate of peak pixel. 51 float counts; ///< Value of peak pixel (above sky?). 52 pmPeakType class; ///< Description of peak. 38 53 } 39 psPeak; 40 54 pmPeak; 55 56 /** pmMoments data structure 57 * 58 * 59 * 60 */ 41 61 typedef struct 42 62 { 43 psF32 x;///< X-coord of centroid.44 psF32 y;///< Y-coord of centroid.45 psF32 Sx;///< x-second moment.46 psF32 Sy;///< y-second moment.47 psF32 Sxy;///< xy cross moment.48 psF32 Sum;///< Pixel sum above sky (background).49 psF32 Peak;///< Peak counts above sky.50 psF32 Sky;///< Sky level (background).51 psS32 nPixels;///< Number of pixels used.63 float x; ///< X-coord of centroid. 64 float y; ///< Y-coord of centroid. 65 float Sx; ///< x-second moment. 66 float Sy; ///< y-second moment. 67 float Sxy; ///< xy cross moment. 68 float Sum; ///< Pixel sum above sky (background). 69 float Peak; ///< Peak counts above sky. 70 float Sky; ///< Sky level (background). 71 int nPixels; ///< Number of pixels used. 52 72 } 53 psMoments; 54 73 pmMoments; 74 75 /** pmModelType enumeration 76 * 77 * 78 * 79 */ 55 80 typedef enum { 56 PS_MODEL_GAUSS, ///< Regular 2-D Gaussian 57 PS_MODEL_PGAUSS, ///< Psuedo 2-D Gaussian 58 PS_MODEL_TWIST_GAUSS, ///< 2-D Twisted Gaussian 59 PS_MODEL_WAUSS, ///< 2-D Waussian 60 PS_MODEL_SERSIC, ///< Sersic 61 PS_MODEL_SERSIC_CORE, ///< Sersic Core 62 PS_MODEL_UNDEFINED ///< Undefined 63 } psModelType; 64 65 // XXX: It will be better if params, and dparams, were psVectors. 81 PS_MODEL_GAUSS, ///< Regular 2-D Gaussian 82 PS_MODEL_PGAUSS, ///< Psuedo 2-D Gaussian 83 PS_MODEL_TWIST_GAUSS, ///< 2-D Twisted Gaussian 84 PS_MODEL_WAUSS, ///< 2-D Waussian 85 PS_MODEL_SERSIC, ///< Sersic 86 PS_MODEL_SERSIC_CORE, ///< Sersic Core 87 PS_MODEL_UNDEFINED ///< Undefined 88 } pmModelType; 89 90 /** pmModel data structure 91 * 92 * 93 * 94 */ 95 // XXX: The SDRS has the "type" member of type psS32. 66 96 typedef struct 67 97 { 68 p sModelType type;///< Model to be used.69 psVector *params; ///< Paramater values.70 psVector *dparams; ///< Parameter errors.71 psF32 chisq;///< Fit chi-squared.72 psS32 nDOF;///< number of degrees of freedom73 psS32 nIter;///< number of iterations to reach min98 pmModelType type; ///< Model to be used. 99 psVector *params; ///< Paramater values. 100 psVector *dparams; ///< Parameter errors. 101 float chisq; ///< Fit chi-squared. 102 int nDOF; ///< number of degrees of freedom 103 int nIter; ///< number of iterations to reach min 74 104 } 75 psModel; 76 105 pmModel; 106 107 /** pmSourceType enumeration 108 * 109 * 110 * 111 */ 77 112 typedef enum { 78 113 PS_SOURCE_PSFSTAR, … … 84 119 PS_SOURCE_BRIGHTSTAR, 85 120 PS_SOURCE_OTHER 86 } psSourceType; 87 121 } pmSourceType; 122 123 /** pmSource data structure 124 * 125 * This source has the capacity for several types of measurements. The 126 * simplest measurement of a source is the location and flux of the peak pixel 127 * associated with the source: 128 * 129 */ 88 130 typedef struct 89 131 { 90 psPeak *peak; ///< Description of peak pixel. 91 psImage *pixels; ///< Rectangular region including object pixels. 92 psImage *mask; ///< Mask which marks pixels associated with objects. 93 psMoments *moments; ///< Basic moments measure for the object. 94 psModel *models; ///< Model parameters and type. 95 psSourceType type; ///< Best identification of object. 132 pmPeak *peak; ///< Description of peak pixel. 133 psImage *pixels; ///< Rectangular region including object pixels. 134 psImage *mask; ///< Mask which marks pixels associated with objects. 135 pmMoments *moments; ///< Basic moments measure for the object. 136 pmModel *modelPSF; ///< PSF model parameters and type 137 pmModel *modelFLT; ///< FLT model parameters and type 138 pmSourceType type; ///< Best identification of object. 96 139 } 97 psSource; 98 99 psPeak *pmPeakAlloc(psS32 x, ///< Row-coordinate in image space 100 psS32 y, ///< Col-coordinate in image space 101 psF32 counts, ///< The value of the peak pixel 102 psPeakType class ///< The type of peak pixel 103 ); 104 105 psMoments *pmMomentsAlloc(); 106 psModel *pmModelAlloc(psModelType type); 107 psSource *pmSourceAlloc(); 140 pmSource; 141 142 /** pmPeak data structure 143 * 144 * 145 * 146 */ 147 typedef struct 148 { 149 psS32 type; ///< PSF Model in use 150 psArray *params; ///< Model parameters (psPolynomial2D) 151 psF32 chisq; ///< PSF goodness statistic 152 psS32 nPSFstars; ///< number of stars used to measure PSF 153 } 154 pmPSF; 155 156 157 158 pmPeak *pmPeakAlloc( 159 int x, ///< Row-coordinate in image space 160 int y, ///< Col-coordinate in image space 161 float counts, ///< The value of the peak pixel 162 pmPeakType class ///< The type of peak pixel 163 ); 164 165 pmMoments *pmMomentsAlloc(); 166 pmModel *pmModelAlloc(pmModelType type); 167 pmSource *pmSourceAlloc(); 108 168 109 169 /****************************************************************************** … … 112 172 the location (x value) of all peaks. 113 173 *****************************************************************************/ 114 psVector *pmFindVectorPeaks(const psVector *vector, ///< The input vector (psF32) 115 psF32 threshold ///< Threshold above which to find a peak 116 ); 174 psVector *pmFindVectorPeaks( 175 const psVector *vector, ///< The input vector (float) 176 float threshold ///< Threshold above which to find a peak 177 ); 117 178 118 179 /****************************************************************************** … … 121 182 value) of all peaks. 122 183 *****************************************************************************/ 123 psArray *pmFindImagePeaks(const psImage *image, ///< The input image where peaks will be found (psF32) 124 psF32 threshold ///< Threshold above which to find a peak 125 ); 184 psArray *pmFindImagePeaks( 185 const psImage *image, ///< The input image where peaks will be found (float) 186 float threshold ///< Threshold above which to find a peak 187 ); 126 188 127 189 /****************************************************************************** … … 129 191 a peak value above the given maximum, or fall outside the valid region. 130 192 *****************************************************************************/ 131 psList *pmCullPeaks(psList *peaks, ///< The psList of peaks to be culled 132 psF32 maxValue, ///< Cull peaks above this value 133 const psRegion *valid ///< Cull peaks otside this psRegion 134 ); 135 136 /****************************************************************************** 137 psSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): 193 psList *pmCullPeaks( 194 psList *peaks, ///< The psList of peaks to be culled 195 float maxValue, ///< Cull peaks above this value 196 const psRegion *valid ///< Cull peaks otside this psRegion 197 ); 198 199 /****************************************************************************** 200 pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): 138 201 139 202 *****************************************************************************/ 140 psSource *pmSourceLocalSky(const psImage *image, ///< The input image (psF32) 141 const psPeak *peak, ///< The peak for which the psSource struct is created. 142 psStatsOptions statsOptions, ///< The statistic used in calculating the background sky 143 psF32 innerRadius, ///< The inner radius of the suqare annulus for calculating sky 144 psF32 outerRadius ///< The outer radius of the suqare annulus for calculating sky 145 ); 146 147 /****************************************************************************** 148 *****************************************************************************/ 149 psSource *pmSourceMoments(psSource *source, ///< The input psSource for which moments will be computed 150 psF32 radius ///< Use a circle of pixels around the peak 151 ); 203 pmSource *pmSourceLocalSky( 204 const psImage *image, ///< The input image (float) 205 const pmPeak *peak, ///< The peak for which the psSource struct is created. 206 psStatsOptions statsOptions, ///< The statistic used in calculating the background sky 207 float innerRadius, ///< The inner radius of the suqare annulus for calculating sky 208 float outerRadius ///< The outer radius of the suqare annulus for calculating sky 209 ); 210 211 /****************************************************************************** 212 *****************************************************************************/ 213 pmSource *pmSourceMoments( 214 pmSource *source, ///< The input pmSource for which moments will be computed 215 float radius ///< Use a circle of pixels around the peak 216 ); 152 217 153 218 /****************************************************************************** … … 155 220 source classification. 156 221 *****************************************************************************/ 157 bool pmSourceRoughClass(psArray *source, ///< The input psSource 158 psMetadata *metadata ///< Contains classification parameters 159 ); 222 bool pmSourceRoughClass( 223 psArray *source, ///< The input pmSource 224 psMetadata *metadata ///< Contains classification parameters 225 ); 160 226 /****************************************************************************** 161 227 pmSourceSetPixelCircle(source, image, radius) 162 228 *****************************************************************************/ 163 bool pmSourceSetPixelsCircle(psSource *source, ///< The input psSource 164 const psImage *image, ///< The input image (psF32) 165 psF32 radius ///< The radius of the circle 166 ); 167 168 /****************************************************************************** 169 *****************************************************************************/ 170 bool pmSourceModelGuess(psSource *source, ///< The input psSource 171 const psImage *image, ///< The input image (psF32) 172 psModelType model ///< The type of model to be created. 173 ); 229 bool pmSourceSetPixelsCircle( 230 pmSource *source, ///< The input pmSource 231 const psImage *image, ///< The input image (float) 232 float radius ///< The radius of the circle 233 ); 234 235 /****************************************************************************** 236 *****************************************************************************/ 237 bool pmSourceModelGuess( 238 pmSource *source, ///< The input pmSource 239 const psImage *image, ///< The input image (float) 240 pmModelType model ///< The type of model to be created. 241 ); 174 242 175 243 /****************************************************************************** … … 179 247 } pmContourType; 180 248 181 psArray *pmSourceContour(psSource *source, ///< The input psSource 182 const psImage *image, ///< The input image (psF32) (this arg should be removed) 183 psF32 level, ///< The level of the contour 184 pmContourType mode ///< Currently this must be PS_CONTOUR_CRUDE 185 ); 186 187 /****************************************************************************** 188 *****************************************************************************/ 189 bool pmSourceFitModel(psSource *source, ///< The input psSource 190 const psImage *image ///< The input image (psF32) 191 ); 192 193 /****************************************************************************** 194 *****************************************************************************/ 195 bool pmSourceAddModel(psImage *image, ///< The opuut image (psF32) 196 psSource *source, ///< The input psSource 197 bool center ///< A boolean flag that determines whether pixels are centered 198 ); 199 200 /****************************************************************************** 201 *****************************************************************************/ 202 bool pmSourceSubModel(psImage *image, ///< The output image (psF32) 203 psSource *source, ///< The input psSource 204 bool center ///< A boolean flag that determines whether pixels are centered 205 ); 249 psArray *pmSourceContour( 250 pmSource *source, ///< The input pmSource 251 const psImage *image, ///< The input image (float) (this arg should be removed) 252 float level, ///< The level of the contour 253 pmContourType mode ///< Currently this must be PS_CONTOUR_CRUDE 254 ); 255 256 /****************************************************************************** 257 *****************************************************************************/ 258 bool pmSourceFitModel( 259 pmSource *source, ///< The input pmSource 260 const psImage *image ///< The input image (float) 261 ); 262 263 /****************************************************************************** 264 *****************************************************************************/ 265 bool pmSourceAddModel( 266 psImage *image, ///< The opuut image (float) 267 pmSource *source, ///< The input pmSource 268 bool center ///< A boolean flag that determines whether pixels are centered 269 ); 270 271 /****************************************************************************** 272 *****************************************************************************/ 273 bool pmSourceSubModel( 274 psImage *image, ///< The output image (float) 275 pmSource *source, ///< The input pmSource 276 bool center ///< A boolean flag that determines whether pixels are centered 277 ); 206 278 207 279 /****************************************************************************** 208 280 XXX: Why only *x argument? 209 XXX EAM: psMinimizeLMChi2Func returns psF64, not psF32281 XXX EAM: psMinimizeLMChi2Func returns psF64, not float 210 282 *****************************************************************************/ 211 283 float pmMinLM_Gauss2D( 212 psVector *deriv, ///< A possibly-NULL structure for the output derivatives213 const psVector *params, ///< A psVector which holds the parameters of this function214 const psVector *x ///< A psVector which holds the row/col coordinate284 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 285 const psVector *params, ///< A psVector which holds the parameters of this function 286 const psVector *x ///< A psVector which holds the row/col coordinate 215 287 ); 216 288 … … 218 290 *****************************************************************************/ 219 291 float pmMinLM_PsuedoGauss2D( 220 psVector *deriv, ///< A possibly-NULL structure for the output derivatives221 const psVector *params, ///< A psVector which holds the parameters of this function222 const psVector *x ///< A psVector which holds the row/col coordinate292 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 293 const psVector *params, ///< A psVector which holds the parameters of this function 294 const psVector *x ///< A psVector which holds the row/col coordinate 223 295 ); 224 296 … … 226 298 *****************************************************************************/ 227 299 float pmMinLM_Wauss2D( 228 psVector *deriv, ///< A possibly-NULL structure for the output derivatives229 const psVector *params, ///< A psVector which holds the parameters of this function230 const psVector *x ///< A psVector which holds the row/col coordinate300 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 301 const psVector *params, ///< A psVector which holds the parameters of this function 302 const psVector *x ///< A psVector which holds the row/col coordinate 231 303 ); 232 304 … … 234 306 *****************************************************************************/ 235 307 float pmMinLM_TwistGauss2D( 236 psVector *deriv, ///< A possibly-NULL structure for the output derivatives237 const psVector *params, ///< A psVector which holds the parameters of this function238 const psVector *x ///< A psVector which holds the row/col coordinate308 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 309 const psVector *params, ///< A psVector which holds the parameters of this function 310 const psVector *x ///< A psVector which holds the row/col coordinate 239 311 ); 240 312 … … 242 314 *****************************************************************************/ 243 315 float pmMinLM_Sersic( 244 psVector *deriv, ///< A possibly-NULL structure for the output derivatives245 const psVector *params, ///< A psVector which holds the parameters of this function246 const psVector *x ///< A psVector which holds the row/col coordinate316 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 317 const psVector *params, ///< A psVector which holds the parameters of this function 318 const psVector *x ///< A psVector which holds the row/col coordinate 247 319 ); 248 320 … … 250 322 *****************************************************************************/ 251 323 float pmMinLM_SersicCore( 252 psVector *deriv, ///< A possibly-NULL structure for the output derivatives253 const psVector *params, ///< A psVector which holds the parameters of this function254 const psVector *x ///< A psVector which holds the row/col coordinate324 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 325 const psVector *params, ///< A psVector which holds the parameters of this function 326 const psVector *x ///< A psVector which holds the row/col coordinate 255 327 ); 256 328 … … 258 330 *****************************************************************************/ 259 331 float pmMinLM_PsuedoSersic( 260 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 261 const psVector *params, ///< A psVector which holds the parameters of this function 262 const psVector *x ///< A psVector which holds the row/col coordinate 263 ); 264 332 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 333 const psVector *params, ///< A psVector which holds the parameters of this function 334 const psVector *x ///< A psVector which holds the row/col coordinate 335 ); 336 337 338 /** 339 * 340 * The object model functions are defined to allow for the flexible addition 341 * of new object models. Every object model, with parameters represented by 342 * pmModel, has an associated set of functions which provide necessary support 343 * operations. A set of abstract functions allow the programmer to select the 344 * approriate function or property for a specific named object model. 345 * 346 */ 347 348 /** 349 * 350 * This function is the model chi-square minimization function for this model. 351 * 352 */ 353 typedef psMinimizeLMChi2Func pmModelFunc; 354 355 356 /** 357 * 358 * This function returns the integrated flux for the given model parameters. 359 */ 360 typedef psF64 (*pmModelFlux)(const psVector *params); 361 362 363 /** 364 * 365 * This function provides the model guess parameters based on the details of 366 * the given source. 367 * 368 */ 369 typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source); 370 371 372 /** 373 * 374 * This function constructs the PSF model for the given source based on the 375 * supplied psf and the FLT model for the object. 376 * 377 */ 378 typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf); 379 380 381 /** 382 * 383 * This function returns the radius at which the given model and parameters 384 * achieves the given flux. 385 * 386 */ 387 typedef psF64 (*pmModelRadius)(const psVector *params, double flux); 388 389 390 /** 391 * 392 * Each of the function types above has a corresponding function which returns 393 * the function given the model type: 394 * 395 */ 396 pmModelFunc pmModelFunc_GetFunction (pmModelType type); 397 pmModelFlux pmModelFlux_GetFunction (pmModelType type); 398 pmModelGuessFunc pmModelGuessFunc_GetFunction (pmModelType type); 399 pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type); 400 pmModelRadius pmModelRadius_GetFunction (pmModelType type); 265 401 266 402 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
