IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2007, 11:45:00 AM (19 years ago)
Author:
eugene
Message:

updating psf parameter to pmTrend2D

File:
1 edited

Legend:

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

    r14969 r14972  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.28.2.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-09-21 18:55:11 $
     8 *  @version $Revision: 1.28.2.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-09-21 21:45:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4141
    4242/*****************************************************************************/
    43 /* DEFINE STATEMENTS                                                         */
    44 /*****************************************************************************/
    45 
    46 /*****************************************************************************/
    47 /* TYPE DEFINITIONS                                                          */
    48 /*****************************************************************************/
    49 
    50 /*****************************************************************************/
    51 /* GLOBAL VARIABLES                                                          */
    52 /*****************************************************************************/
    53 
    54 /*****************************************************************************/
    55 /* FILE STATIC VARIABLES                                                     */
    56 /*****************************************************************************/
    57 
    58 /*****************************************************************************/
    59 /* FUNCTION IMPLEMENTATION - LOCAL                                           */
    60 /*****************************************************************************/
    61 
    62 /*****************************************************************************/
    6343/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
    6444/*****************************************************************************/
    6545
    6646static void pmPSFOptionsFree (pmPSFOptions *options) {
    67 
    6847    return;
    6948}
     
    7251
    7352    pmPSFOptions *options = (pmPSFOptions *) psAlloc(sizeof(pmPSFOptions));
     53    psMemSetDeallocator(options, (psFreeFunc) pmPSFOptionsFree);
    7454
    7555    options->type          = 0;
    7656    options->poissonErrors = false;
    77     options->psfTrendMode  = PM_TREND_MAP;
     57    options->psfTrendMode  = PM_TREND_NONE;
    7858    options->psfTrendNx    = 0;
    7959    options->psfTrendNy    = 0;
     
    11595
    11696    pmPSF *psf = (pmPSF *) psAlloc(sizeof(pmPSF));
     97    psMemSetDeallocator(psf, (psFreeFunc) pmPSFFree);
    11798
    11899    psf->type     = options->type;
     
    163144    // PM_PAR_XPOS, etc)
    164145
     146    // XXX make this a user option
     147    psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
     148
    165149    // XXX define new structure to carry in the psf options
    166     if (psfTrendMask) {
     150    if (options->psfTrendMode != PM_TREND_NONE) {
    167151        for (int i = 0; i < psf->params->n; i++) {
    168             if (i == PM_PAR_SKY)
    169                 continue;
    170             if (i == PM_PAR_I0)
    171                 continue;
    172             if (i == PM_PAR_XPOS)
    173                 continue;
    174             if (i == PM_PAR_YPOS)
    175                 continue;
    176 
    177             // XXX need to set stats, image
     152            if (i == PM_PAR_SKY) continue;
     153            if (i == PM_PAR_I0) continue;
     154            if (i == PM_PAR_XPOS) continue;
     155            if (i == PM_PAR_YPOS) continue;
     156
     157            // XXX need to set stats & image or else nXfine,nYfine
    178158            pmTrend2D *param = pmTrend2DAlloc (options->psfTrendMode, image, options->psfTrendNx, options->psfTrendNx, stats);
    179159            psf->params->data[i] = param;
    180160        }
    181161    }
    182 
    183     psMemSetDeallocator(psf, (psFreeFunc) pmPSFFree);
    184     return(psf);
     162   
     163    psFree (stats);
     164    return psf;
    185165}
    186166
Note: See TracChangeset for help on using the changeset viewer.