IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 22, 2007, 2:55:49 PM (19 years ago)
Author:
magnier
Message:

adjusted pmModel.h to allow pmModel to use functions which use pmModel
as an argument.

adjusted the order of the pmPSF.h entries to allow that as an argument
as well

changed pmPSF I/O functions to load/save the psf on the
chip->analysis, not the readout->analysis

fixed the modelRadius function for PGAUSS

File:
1 edited

Legend:

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

    r14544 r14612  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.25.6.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-08-17 21:01:59 $
     8 *  @version $Revision: 1.25.6.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-08-23 00:55:49 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "pmMoments.h"
    2929#include "pmResiduals.h"
     30#include "pmGrowthCurve.h"
     31#include "pmPSF.h"
    3032#include "pmModel.h"
    3133#include "pmSource.h"
    32 #include "pmGrowthCurve.h"
    33 #include "pmPSF.h"
    3434#include "pmModelClass.h"
     35#include "pmModelUtils.h"
    3536#include "pmSourcePhotometry.h"
    3637#include "pmFPAMaskWeight.h"
     
    7475    psFree (psf->ApTrend);
    7576    psFree (psf->growth);
    76     psFree (psf->params_NEW);
     77    psFree (psf->params);
    7778    psFree (psf->residuals);
    7879    return;
     
    103104    psf->skyBias  = 0.0;
    104105    psf->skySat   = 0.0;
     106    psf->nPSFstars  = 0;
     107    psf->nApResid   = 0;
    105108    psf->poissonErrors = poissonErrors;
    106109
     
    129132        return(NULL);
    130133    }
    131     psf->params_NEW = psArrayAlloc(Nparams);
     134    psf->params = psArrayAlloc(Nparams);
    132135
    133136    // the order of the PSF parameter (X,Y) fits is determined by the psfTrendMask polynomial
     
    139142
    140143    if (psfTrendMask) {
    141         for (int i = 0; i < psf->params_NEW->n; i++) {
     144        for (int i = 0; i < psf->params->n; i++) {
    142145            if (i == PM_PAR_SKY)
    143146                continue;
     
    155158                }
    156159            }
    157             psf->params_NEW->data[i] = param;
     160            psf->params->data[i] = param;
    158161        }
    159162    }
     
    161164    psMemSetDeallocator(psf, (psFreeFunc) pmPSFFree);
    162165    return(psf);
    163 }
    164 
    165 /*****************************************************************************
    166 pmModelFromPSF (*modelEXT, *psf):  use the model position parameters to
    167 construct a realization of the PSF model at the object coordinates
    168  *****************************************************************************/
    169 pmModel *pmModelFromPSF (pmModel *modelEXT, pmPSF *psf)
    170 {
    171     // allocate a new pmModel to hold the PSF version
    172     pmModel *modelPSF = pmModelAlloc (psf->type);
    173 
    174     // set model parameters for this source based on PSF information
    175     if (!modelEXT->modelFromPSF (modelPSF, modelEXT, psf)) {
    176         psError(PM_ERR_PSF, false, "Failed to set model params from PSF");
    177         psFree(modelPSF);
    178         return NULL;
    179     }
    180     // XXX note that model->residuals is just a reference
    181     modelPSF->residuals = psf->residuals;
    182 
    183     return (modelPSF);
    184166}
    185167
     
    333315    pmPSF *psf = pmPSFAlloc (type, true, psfTrend);
    334316
    335     psVector *par = psVectorAlloc (psf->params_NEW->n, PS_TYPE_F32);
     317    psVector *par = psVectorAlloc (psf->params->n, PS_TYPE_F32);
    336318    par->data.F32[PM_PAR_SXX] = sxx;
    337319    par->data.F32[PM_PAR_SYY] = syy;
     
    342324    // set the psf shape parameters
    343325    psPolynomial2D *poly = NULL;
    344     poly = psf->params_NEW->data[PM_PAR_E0];
     326    poly = psf->params->data[PM_PAR_E0];
    345327    poly->coeff[0][0] = pol.e0;
    346328
    347     poly = psf->params_NEW->data[PM_PAR_E1];
     329    poly = psf->params->data[PM_PAR_E1];
    348330    poly->coeff[0][0] = pol.e1;
    349331
    350     poly = psf->params_NEW->data[PM_PAR_E2];
     332    poly = psf->params->data[PM_PAR_E2];
    351333    poly->coeff[0][0] = pol.e2;
    352334
    353     for (int i = PM_PAR_SXY + 1; i < psf->params_NEW->n; i++) {
    354         poly = psf->params_NEW->data[i];
     335    for (int i = PM_PAR_SXY + 1; i < psf->params->n; i++) {
     336        poly = psf->params->data[i];
    355337        poly->coeff[0][0] = (psF32)va_arg(ap, psF64);
    356338    }
Note: See TracChangeset for help on using the changeset viewer.