IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 17, 2007, 11:01:59 AM (19 years ago)
Author:
magnier
Message:

substantial cleanups of APIs:

changed pmModelGroup to pmModelClass

dropped the _GetFunctions, and moved the modelClass-specific functions
to functions pointers in the pmModel structure. These are assigned
when the model is allocated, based on the model type. Now, instead of
calling, for example,

modelFunc = pmModelFunc_GetFunctions(model->type)
modelFunc();

you just do:

model->modelFunc()

moved some of the support functions into pmModelUtils and
pmSourceUtils.

changed pmIsFooBar to pmFooBarTest for better api listing.

added functions to evaluate and add/subtract models applying an offset
between the image coordinate frame and the chip frame (required frame
for model parameters)

added function(s) to instatiate a pmModel from a pmPSF based on a
given coordinate and peak flux.

added a function to set the model normalization based on a source flux
value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070817/psModules/src/objects/pmModelGroup.c

    r14325 r14544  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-07-20 00:31:43 $
     8 *  @version $Revision: 1.17.4.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-08-17 21:01:59 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "pmResiduals.h"
    2929#include "pmModel.h"
    30 #include "pmResiduals.h"
    31 #include "pmPSF.h"
    32 #include "pmSource.h"
     30// #include "pmResiduals.h"
     31// #include "pmPSF.h"
     32// #include "pmSource.h"
    3333#include "pmModelGroup.h"
    3434#include "pmErrorCodes.h"
     
    198198    return (models[type].name);
    199199}
    200 
    201 /******************************************************************************
    202     pmSourceModelGuess(source, model): This function allocates a new
    203     pmModel structure based on the given modelType specified in the argument list.
    204     The corresponding pmModelGuess function is returned, and used to
    205     supply the values of the params array in the pmModel structure.
    206  
    207     XXX: Many parameters are based on the src->moments structure, which is in
    208     image, not subImage coords.  Therefore, the calls to the model evaluation
    209     functions will be in image, not subImage coords.  Remember this.
    210 *****************************************************************************/
    211 pmModel *pmSourceModelGuess(pmSource *source,
    212                             pmModelType modelType)
    213 {
    214     psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
    215     PS_ASSERT_PTR_NON_NULL(source, NULL);
    216     PS_ASSERT_PTR_NON_NULL(source->moments, NULL);
    217     PS_ASSERT_PTR_NON_NULL(source->peak, NULL);
    218 
    219     pmModel *model = pmModelAlloc(modelType);
    220 
    221     pmModelGuessFunc modelGuessFunc = pmModelGuessFunc_GetFunction(modelType);
    222     if (!modelGuessFunc(model, source)) {
    223         psFree (model);
    224         return NULL;
    225     }
    226 
    227     psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);
    228     return(model);
    229 }
    230 
Note: See TracChangeset for help on using the changeset viewer.