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_QGAUSS.c

    r35639 r35644  
    221221
    222222    // set the shape parameters
    223     if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
     223    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
    224224      return false;
    225225    }
     
    245245{
    246246    float z, norm;
    247     psEllipseShape shape;
    248247
    249248    psF32 *PAR = params->data.F32;
    250249
    251     shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
    252     shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
    253     shape.sxy = PAR[PM_PAR_SXY];
    254 
    255     psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     250    psEllipseAxes axes;
     251    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
    256252    float AspectRatio = axes.minor / axes.major;
    257253
     
    285281{
    286282    psF64 z;
    287     psEllipseShape shape;
    288283
    289284    psF32 *PAR = params->data.F32;
     
    293288    if (flux >= PAR[PM_PAR_I0]) return 1.0;
    294289
    295     shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
    296     shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
    297     shape.sxy = PAR[PM_PAR_SXY];
    298 
    299     psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     290    psEllipseAxes axes;
     291    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
    300292    psF64 sigma = axes.major;
    301293
     
    364356    // the 2D PSF model fits polarization terms (E0,E1,E2)
    365357    // convert to shape terms (SXX,SYY,SXY)
    366     if (!pmPSF_FitToModel (out, 0.1)) {
     358    bool useReff = pmModelUseReff (modelPSF->type);
     359    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
    367360        psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
    368361        return false;
     
    421414    // the 2D PSF model fits polarization terms (E0,E1,E2)
    422415    // convert to shape terms (SXX,SYY,SXY)
    423     // XXX user-defined value for limit?
    424     if (!pmPSF_FitToModel (PAR, 0.1)) {
     416    bool useReff = pmModelUseReff (model->type);
     417    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
    425418        psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
    426419        return false;
Note: See TracChangeset for help on using the changeset viewer.