IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2007, 4:20:17 PM (19 years ago)
Author:
eugene
Message:

updating to use pmTrend for the psf parameters

File:
1 edited

Legend:

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

    r14972 r14980  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.28.2.2 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-09-21 21:45:00 $
     8 *  @version $Revision: 1.28.2.3 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-09-22 02:20:11 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4545
    4646static void pmPSFOptionsFree (pmPSFOptions *options) {
     47
     48    if (!options) return;
     49
     50    psFree (options->image);
     51    psFree (options->stats);
    4752    return;
    4853}
     
    5459
    5560    options->type          = 0;
    56     options->poissonErrors = false;
     61
     62    options->image         = NULL;
     63    options->stats         = NULL;
     64
    5765    options->psfTrendMode  = PM_TREND_NONE;
    5866    options->psfTrendNx    = 0;
    5967    options->psfTrendNy    = 0;
     68
     69    options->poissonErrors = false;
    6070}
    6171
     
    136146    }
    137147    psf->params = psArrayAlloc(Nparams);
     148   
     149    // save the trend stats on the psf for use in pmPSFFromPSFtry
     150    psf->psfTrendStats = psMemIncrRefCounter (options->stats);
    138151
    139152    // the order of the PSF parameter (X,Y) fits is determined by the psfTrendMask polynomial
     
    144157    // PM_PAR_XPOS, etc)
    145158
    146     // XXX make this a user option
    147     psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
    148 
    149     // XXX define new structure to carry in the psf options
     159    // define the parameter trends
    150160    if (options->psfTrendMode != PM_TREND_NONE) {
    151161        for (int i = 0; i < psf->params->n; i++) {
     
    155165            if (i == PM_PAR_YPOS) continue;
    156166
    157             // XXX need to set stats & image or else nXfine,nYfine
    158             pmTrend2D *param = pmTrend2DAlloc (options->psfTrendMode, image, options->psfTrendNx, options->psfTrendNx, stats);
    159             psf->params->data[i] = param;
     167            psf->params->data[i] = pmTrend2DAlloc (options->psfTrendMode, options->image, options->psfTrendNx, options->psfTrendNx, options->stats);
    160168        }
    161169    }
    162    
    163     psFree (stats);
    164170    return psf;
    165171}
     
    287293
    288294// generate a psf model of the requested type, with fixed shape
     295// XXX update this.
    289296pmPSF *pmPSFBuildSimple (char *typeName, float sxx, float syy, float sxy, ...)
    290297{
Note: See TracChangeset for help on using the changeset viewer.