IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2007, 8:55:12 AM (19 years ago)
Author:
eugene
Message:

converting psf parameters to pmTrend2D

File:
1 edited

Legend:

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

    r14961 r14969  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-09-21 02:46:25 $
     8 *  @version $Revision: 1.28.2.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-09-21 18:55:11 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6464/*****************************************************************************/
    6565
     66static void pmPSFOptionsFree (pmPSFOptions *options) {
     67
     68    return;
     69}
     70
     71pmPSFOptions *pmPSFOptionsAlloc () {
     72
     73    pmPSFOptions *options = (pmPSFOptions *) psAlloc(sizeof(pmPSFOptions));
     74
     75    options->type          = 0;
     76    options->poissonErrors = false;
     77    options->psfTrendMode  = PM_TREND_MAP;
     78    options->psfTrendNx    = 0;
     79    options->psfTrendNy    = 0;
     80}
     81
    6682/*****************************************************************************
    6783pmPSFFree(psf): function to free a pmPSF structure
     
    94110 Object Normalization
    95111 *****************************************************************************/
    96 pmPSF *pmPSFAlloc (pmModelType type, bool poissonErrors, psPolynomial2D *psfTrendMask)
     112pmPSF *pmPSFAlloc (pmPSFOptions *options)
    97113{
    98114    int Nparams;
     
    100116    pmPSF *psf = (pmPSF *) psAlloc(sizeof(pmPSF));
    101117
    102     psf->type     = type;
     118    psf->type     = options->type;
    103119    psf->chisq    = 0.0;
    104120    psf->ApResid  = 0.0;
     
    108124    psf->nPSFstars  = 0;
    109125    psf->nApResid   = 0;
    110     psf->poissonErrors = poissonErrors;
     126    psf->poissonErrors = options->poissonErrors;
    111127
    112128    // the ApTrend components are (x, y).  It may be represented with a polynomial or with a
     
    147163    // PM_PAR_XPOS, etc)
    148164
     165    // XXX define new structure to carry in the psf options
    149166    if (psfTrendMask) {
    150167        for (int i = 0; i < psf->params->n; i++) {
     
    158175                continue;
    159176
    160             psPolynomial2D *param = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, psfTrendMask->nX, psfTrendMask->nY);
    161             for (int nx = 0; nx < param->nX + 1; nx++) {
    162                 for (int ny = 0; ny < param->nY + 1; ny++) {
    163                     param->mask[nx][ny] = psfTrendMask->mask[nx][ny];
    164                 }
    165             }
     177            // XXX need to set stats, image
     178            pmTrend2D *param = pmTrend2DAlloc (options->psfTrendMode, image, options->psfTrendNx, options->psfTrendNx, stats);
    166179            psf->params->data[i] = param;
    167180        }
Note: See TracChangeset for help on using the changeset viewer.