IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 29, 2006, 5:02:59 PM (20 years ago)
Author:
magnier
Message:

major cleanup of model code, fixes to use new param defs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/models/pmModel_GAUSS.c

    r9770 r9775  
    11/******************************************************************************
    2  * this file defines the PGAUSS source shape model.  Note that these model functions are loaded
     2 * this file defines the GAUSS source shape model.  Note that these model functions are loaded
    33 * by pmModelGroup.c using 'include', and thus need no 'include' statements of their own.  The
    44 * models use a psVector to represent the set of parameters, with the sequence used to specify
     
    66 * specifics of the model.  All models which are used a PSF representations share a few
    77 * parameters, for which # define names are listed in pmModel.h:
     8 
     9   pure Gaussian:
     10   exp(-z)
    811 
    912 * PM_PAR_SKY 0   - local sky : note that this is unused and may be dropped in the future
     
    114117    shape.sx  = PAR[PM_PAR_SXX] / sqrt(2.0);
    115118    shape.sy  = PAR[PM_PAR_SYY] / sqrt(2.0);
    116     shape.sxy = PAR[PM_PAR_SXY] / sqrt(2.0);
     119    shape.sxy = PAR[PM_PAR_SXY];
    117120
    118121    // Area is equivalent to 2 pi sigma^2
     
    131134    psEllipseShape shape;
    132135
     136    psF32 *PAR = params->data.F32;
     137
    133138    if (flux <= 0)
    134139        return (1.0);
    135     if (params->data.F32[PM_PAR_I0] <= 0)
     140    if (PAR[PM_PAR_I0] <= 0)
    136141        return (1.0);
    137     if (flux >= params->data.F32[PM_PAR_I0])
     142    if (flux >= PAR[PM_PAR_I0])
    138143        return (1.0);
    139 
    140     psF32 *PAR = params->data.F32;
    141144
    142145    shape.sx  = PAR[PM_PAR_SXX] / sqrt(2.0);
    143146    shape.sy  = PAR[PM_PAR_SYY] / sqrt(2.0);
    144     shape.sxy = PAR[PM_PAR_SXY] / sqrt(2.0);
     147    shape.sxy = PAR[PM_PAR_SXY];
    145148
    146149    psEllipseAxes axes = psEllipseShapeToAxes (shape);
    147     psF64 radius = axes.major * sqrt (2.0 * log(params->data.F32[PM_PAR_I0] / flux));
     150    psF64 radius = axes.major * sqrt (2.0 * log(PAR[PM_PAR_I0] / flux));
    148151    return (radius);
    149152}
Note: See TracChangeset for help on using the changeset viewer.