IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 7, 2005, 6:32:40 PM (21 years ago)
Author:
eugene
Message:

cleanup, organization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/pmObjects_EAM.h

    r4954 r4977  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-09-07 03:33:01 $
     7 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-09-08 04:32:40 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222#include<math.h>
    2323#include "pslib.h"
    24 
    25 // XXX EAM : this function should be added to psLib
    26 int          psImageCountPixelMask (psImage *mask, psU8 value);
    27 
    28 // XXX EAM : bug : missing from psLib/*.h
    29 bool psMinimizeGaussNewtonDelta (psVector *delta,
    30                                  const psVector *params,
    31                                  const psVector *paramMask,
    32                                  const psArray  *x,
    33                                  const psVector *y,
    34                                  const psVector *yErr,
    35                                  psMinimizeLMChi2Func func);
    36 
    37 // XXX EAM : switch to psPoly when ready
    38 psF64           Polynomial2DEval(const psPolynomial2D* myPoly, psF64 x, psF64 y);
    39 
    40 // XXX EAM : psEllipse needs to be be included in psLib
    41 # include "psEllipse.h"
     24#include "psLibUtils.h"
     25// #include "pmModelGroup.h"
     26
     27// defined mask values for mask image pixels.
     28// this is probably a bad solution: we will want to set mask values
     29// outside of the PSPHOT code.  Perhaps we can set up a registered
     30// set of mask values with specific meanings that other functions
     31// can add to or define?
     32enum {
     33    PSPHOT_MASK_CLEAR     = 0x00,
     34    PSPHOT_MASK_INVALID   = 0x01,
     35    PSPHOT_MASK_SATURATED = 0x02,
     36    PSPHOT_MASK_MARKED    = 0x08,
     37} psphotMaskValues;
    4238
    4339/** pmPeakType
     
    9187} pmMoments;
    9288
    93 typedef int pmModelType;
    94 
    9589/** pmPSFClump data structure
    9690 * 
     
    10599    float dY;
    106100} pmPSFClump;
     101
     102typedef int pmModelType;
    107103
    108104/** pmModel data structure
     
    169165pmSource;
    170166
    171 /** pmPSF data structure
    172  * 
    173  * 
    174  * 
    175  */
    176 typedef struct
    177 {
    178     pmModelType type;                   ///< PSF Model in use
    179     psArray *params;                    ///< Model parameters (psPolynomial2D)
    180     float chisq;                        ///< PSF goodness statistic
    181     int nPSFstars;                      ///< number of stars used to measure PSF
    182 }
    183 pmPSF;
    184 
    185167pmPeak *pmPeakAlloc(
    186168    int x,                              ///< Row-coordinate in image space
     
    316298);
    317299
    318 /**
    319  *
    320  *  The object model functions are defined to allow for the flexible addition
    321  *  of new object models. Every object model, with parameters represented by
    322  *  pmModel, has an associated set of functions which provide necessary support
    323  *  operations. A set of abstract functions allow the programmer to select the
    324  *  approriate function or property for a specific named object model.
    325  *
    326  */
    327 
    328 /**
    329  *
    330  *  This function is the model chi-square minimization function for this model.
    331  *
    332  */
    333 typedef psMinimizeLMChi2Func pmModelFunc;
    334 
    335 
    336 /**
    337  *
    338  * This function returns the integrated flux for the given model parameters.
    339  */
    340 typedef psF64 (*pmModelFlux)(const psVector *params);
    341 
    342 
    343 /**
    344  *
    345  *  This function returns the radius at which the given model and parameters
    346  *  achieves the given flux.
    347  *
    348  */
    349 typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
    350 
    351 /**
    352  *
    353  *  This function sets the model parameter limits vectors for the given model
    354  *
    355  */
    356 typedef bool (*pmModelLimits)(psVector **beta_lim, psVector **params_min, psVector **params_max);
    357 
    358 /**
    359  *
    360  *  This function provides the model guess parameters based on the details of
    361  *   the given source.
    362  *
    363  */
    364 typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
    365 
    366 
    367 /**
    368  *
    369  *  This function constructs the PSF model for the given source based on the
    370  *  supplied psf and the FLT model for the object.
    371  *
    372  */
    373 typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf);
    374 
    375 
    376 /**
    377  *
    378  *  This function returns the success / failure status of the given model fit
    379  *
    380  */
    381 typedef bool (*pmModelFitStatusFunc)(pmModel *model);
    382 
    383 /**
    384  *
    385  *  Each of the function types above has a corresponding function which returns
    386  *  the function given the model type:
    387  *
    388  */
    389 pmModelFunc          pmModelFunc_GetFunction (pmModelType type);
    390 pmModelFlux          pmModelFlux_GetFunction (pmModelType type);
    391 pmModelRadius        pmModelRadius_GetFunction (pmModelType type);
    392 pmModelLimits        pmModelLimits_GetFunction (pmModelType type);
    393 pmModelGuessFunc     pmModelGuessFunc_GetFunction (pmModelType type);
    394 pmModelFromPSFFunc   pmModelFromPSFFunc_GetFunction (pmModelType type);
    395 pmModelFitStatusFunc pmModelFitStatusFunc_GetFunction (pmModelType type);
    396 
    397 // pmModelGroup utility functions
    398 int                  pmModelParameterCount (pmModelType type);
    399 char                *pmModelGetType (pmModelType type);
    400 pmModelType          pmModelSetType (char *name);
    401 
    402 // structure to carry model group functions
    403 typedef struct {
    404     char *name;
    405     int nParams;
    406     pmModelFunc          modelFunc;
    407     pmModelFlux          modelFlux;
    408     pmModelRadius        modelRadius;
    409     pmModelLimits        modelLimits;
    410     pmModelGuessFunc     modelGuessFunc;
    411     pmModelFromPSFFunc   modelFromPSFFunc;
    412     pmModelFitStatusFunc modelFitStatusFunc;
    413 } pmModelGroup;
    414 
    415300#endif
Note: See TracChangeset for help on using the changeset viewer.