IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 23, 2007, 2:11:02 PM (19 years ago)
Author:
magnier
Message:
  • added function pointers to pmModel to provide class-dependent functions
  • dropped pmModel*_GetFunction functions (use pmModel->func functions instead)
  • added modelParamsFromPSF functions to model classes
  • changed pmModelGroup to pmModelClass
  • added pmSourceFitSet.[ch]
  • updated pmSourceFitSet to allow variable model classes
  • added functions to add/sub and eval models & sources with an offset between image and chip
  • added function to set a pmModel flux
  • added function to instatiate a pmModel from a pmPSF at a coordinate
  • moved pmPSF I/O to chip->analysis from readout->analysis
  • changed pmPSF I/O function names from *ForPSFmodel to pmPSFmodel*
  • changed pmModel.params_NEW back to pmModel.params
  • changed pmFind*Peaks to pmPeaksIn* (* = Image,Vector)
  • dropped pmCullPeaks (deprecated)
  • changed pmModelSetType to pmModelClassGetType
  • changed pmModelGetType to pmModelClassGetName
  • fixed PGAUSS implementation of modelRadius function
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmModel.h

    r13898 r14652  
    1 /* @file  pmObjects.h
     1/* @file  pmModel.h
    22 * @brief Functions to define and manipulate object models
    33 *
     
    55 * @author EAM, IfA
    66 *
    7  * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-06-20 02:22:26 $
     7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2007-08-24 00:11:02 $
    99 *
    1010 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1717/// @{
    1818
    19 // type of model carried by the pmModel structure
    20 typedef int pmModelType;
     19/* pointers for the functions types below are supplied to each pmModel, and can be used by
     20   the programmer without needing to know the model class */
    2121
    2222typedef enum {
     
    4141} pmModelOpMode;
    4242
     43typedef struct pmModel pmModel;
     44typedef struct pmSource pmSource;
     45
     46//  This function is the model chi-square minimization function for this model.
     47typedef psMinimizeLMChi2Func pmModelFunc;
     48
     49//  This function sets the parameter limits for this model.
     50typedef psMinimizeLMLimitFunc pmModelLimits;
     51
     52// This function returns the integrated flux for the given model parameters.
     53typedef psF64 (*pmModelFlux)(const psVector *params);
     54
     55// This function returns the radius at which the given model and parameters
     56// achieves the given flux.
     57typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
     58
     59//  This function provides the model guess parameters based on the details of
     60//  the given source.
     61typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
     62
     63//  This function constructs the PSF model for the given source based on the
     64//  supplied psf and the EXT model for the object.
     65typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelEXT, pmPSF *psf);
     66
     67//  This function sets the model parameters based on the PSF for a given coordinate and central
     68//  intensity
     69typedef bool (*pmModelParamsFromPSF)(pmModel *model, pmPSF *psf, float Xo, float Yo, float Io);
     70
     71//  This function returns the success / failure status of the given model fit
     72typedef bool (*pmModelFitStatusFunc)(pmModel *model);
     73
    4374/** pmModel data structure
    4475 *
     
    5081 *
    5182 */
    52 typedef struct
    53 {
     83struct pmModel {
    5484    pmModelType type;                   ///< Model to be used.
    5585    psVector *params;                   ///< Paramater values.
     
    6292    float radiusFit;                    ///< fit radius actually used
    6393    pmResiduals *residuals;             ///< normalized PSF residuals
    64 }
    65 pmModel;
    6694
    67 /* XXX we are currently saving the residuals with the pmModel.  It might be better to save this
    68  * in the pmSource.  we may want an API to Add/Sub a pmModel (analytical model only) or a
    69  * pmSource (analytical + residuals).
    70  */
     95    // functions for this model which depend on the model class
     96    pmModelFunc          modelFunc;
     97    pmModelFlux          modelFlux;
     98    pmModelRadius        modelRadius;
     99    pmModelLimits        modelLimits;
     100    pmModelGuessFunc     modelGuess;
     101    pmModelFromPSFFunc   modelFromPSF;
     102    pmModelParamsFromPSF modelParamsFromPSF;
     103    pmModelFitStatusFunc modelFitStatus;
     104};
    71105
    72106/** Symbolic names for the elements of [d]params
     
    130164);
    131165
     166bool pmModelAddWithOffset(psImage *image,
     167                          psImage *mask,
     168                          pmModel *model,
     169                          pmModelOpMode mode,
     170                          psMaskType maskVal,
     171                          int dx,
     172                          int dy);
     173
     174bool pmModelSubWithOffset(psImage *image,
     175                          psImage *mask,
     176                          pmModel *model,
     177                          pmModelOpMode mode,
     178                          psMaskType maskVal,
     179                          int dx,
     180                          int dy);
     181
    132182/** pmModelFitStatus()
    133183 *
Note: See TracChangeset for help on using the changeset viewer.