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/pmPSFtry.c

    r13898 r14652  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2007-06-20 02:22:26 $
     7 *  @version $Revision: 1.44 $ $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
     
    2323#include "pmMoments.h"
    2424#include "pmResiduals.h"
     25#include "pmGrowthCurve.h"
     26#include "pmPSF.h"
    2527#include "pmModel.h"
    2628#include "pmSource.h"
    27 #include "pmGrowthCurve.h"
    28 #include "pmPSF.h"
     29#include "pmSourceUtils.h"
    2930#include "pmPSFtry.h"
    30 #include "pmModelGroup.h"
     31#include "pmModelClass.h"
     32#include "pmModelUtils.h"
    3133#include "pmSourceFitModel.h"
    3234#include "pmSourcePhotometry.h"
     
    5961
    6062    // validate the requested model name
    61     pmModelType type = pmModelSetType (modelName);
     63    pmModelType type = pmModelClassGetType (modelName);
    6264    if (type == -1) {
    6365        psError (PS_ERR_UNKNOWN, true, "invalid model name %s", modelName);
     
    412414    // This way, the parameters masked by one of the fits will be applied to the others
    413415    for (int i = 0; i < stats->clipIter; i++) {
    414         psVectorClipFitPolynomial2D (psf->params_NEW->data[PM_PAR_E0], stats, psfTry->mask, 0xff, e0, dz, x, y);
     416        psVectorClipFitPolynomial2D (psf->params->data[PM_PAR_E0], stats, psfTry->mask, 0xff, e0, dz, x, y);
    415417        psTrace ("psModules.pmPSFtry", 4, "clipped E0 : keeping %ld of %ld\n", stats->clippedNvalues, e0->n);
    416         psVectorClipFitPolynomial2D (psf->params_NEW->data[PM_PAR_E1], stats, psfTry->mask, 0xff, e1, dz, x, y);
     418        psVectorClipFitPolynomial2D (psf->params->data[PM_PAR_E1], stats, psfTry->mask, 0xff, e1, dz, x, y);
    417419        psTrace ("psModules.pmPSFtry", 4, "clipped E1 : keeping %ld of %ld\n", stats->clippedNvalues, e1->n);
    418         psVectorClipFitPolynomial2D (psf->params_NEW->data[PM_PAR_E2], stats, psfTry->mask, 0xff, e2, dz, x, y);
     420        psVectorClipFitPolynomial2D (psf->params->data[PM_PAR_E2], stats, psfTry->mask, 0xff, e2, dz, x, y);
    419421        psTrace ("psModules.pmPSFtry", 4, "clipped E2 : keeping %ld of %ld\n", stats->clippedNvalues, e2->n);
    420422    }
     
    436438
    437439    // skip the unfitted parameters (X, Y, Io, Sky) and the shape parameters (SXX, SYY, SXY)
    438     for (int i = 0; i < psf->params_NEW->n; i++) {
     440    for (int i = 0; i < psf->params->n; i++) {
    439441        switch (i) {
    440442          case PM_PAR_SKY:
     
    461463        // the mask is carried from previous steps and updated with this operation
    462464        // the weight is either the flux error or NULL, depending on 'applyWeights'
    463         if (!psVectorClipFitPolynomial2D(psf->params_NEW->data[i], stats, psfTry->mask, 0xff, z, NULL, x, y)) {
     465        if (!psVectorClipFitPolynomial2D(psf->params->data[i], stats, psfTry->mask, 0xff, z, NULL, x, y)) {
    464466            psError(PS_ERR_UNKNOWN, false, "failed to build psf model for parameter %d", i);
    465467            psFree(stats);
     
    489491            fprintf (f, "%f %f : ", model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS]);
    490492
    491             for (int i = 0; i < psf->params_NEW->n; i++) {
    492                 if (psf->params_NEW->data[i] == NULL)
     493            for (int i = 0; i < psf->params->n; i++) {
     494                if (psf->params->data[i] == NULL)
    493495                    continue;
    494496                fprintf (f, "%f %f : ", model->params->data.F32[i], modelPSF->params->data.F32[i]);
Note: See TracChangeset for help on using the changeset viewer.