IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 11, 2013, 9:15:36 AM (13 years ago)
Author:
eugene
Message:

replace code which converts the PAR[SXX,SXY,SYY] values to shape and then axes with calls to pmModelParamsToAxes : the relationship depends on the model type. placing the code in a single function avoids inconsistent conversions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_RGAUSS.c

    r35560 r35644  
    210210
    211211    // set the shape parameters
    212     if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
     212    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
    213213      return false;
    214214    }
     
    234234{
    235235    float z, norm;
    236     psEllipseShape shape;
    237236
    238237    psF32 *PAR = params->data.F32;
    239238
    240     shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
    241     shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
    242     shape.sxy = PAR[PM_PAR_SXY];
    243 
    244     psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     239    psEllipseAxes axes;
     240    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
    245241    float AspectRatio = axes.minor / axes.major;
    246242
     
    274270{
    275271    psF64 z;
    276     psEllipseShape shape;
    277272
    278273    psF32 *PAR = params->data.F32;
     
    285280        return (1.0);
    286281
    287     shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
    288     shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
    289     shape.sxy = PAR[PM_PAR_SXY];
    290 
    291     psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     282    psEllipseAxes axes;
     283    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
    292284    psF64 sigma = axes.major;
    293285
     
    357349    // the 2D PSF model fits polarization terms (E0,E1,E2)
    358350    // convert to shape terms (SXX,SYY,SXY)
    359     if (!pmPSF_FitToModel (out, 0.1)) {
     351    bool useReff = pmModelUseReff (modelPSF->type);
     352    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
    360353        psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
    361354        return false;
     
    409402    // the 2D PSF model fits polarization terms (E0,E1,E2)
    410403    // convert to shape terms (SXX,SYY,SXY)
    411     // XXX user-defined value for limit?
    412     if (!pmPSF_FitToModel (PAR, 0.1)) {
     404    bool useReff = pmModelUseReff (model->type);
     405    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
    413406        psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
    414407        return false;
Note: See TracChangeset for help on using the changeset viewer.