IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 3, 2013, 2:37:22 PM (13 years ago)
Author:
eugene
Message:

deprecate KiiOpen,KiiClose (now KapaOpen,etc); major rework of psEllipse translations : use common functions pmModelAxesToParams and pmModelParamsToAxes ; use new convergence method in pmPCM_MinimizeChisq; add convergence crerition options to psMinimization; threaded versions of pmPSFtryFitEXT and pmPSFtryFitPSF

Location:
trunk/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

  • trunk/psModules/src/objects/models/pmModel_EXP.c

    r35560 r35768  
    115115
    116116        // first, use Rmajor and index to find the central pixel flux (fraction of total flux)
    117         psEllipseShape shape;
    118 
    119         shape.sx  = PAR[PM_PAR_SXX];
    120         shape.sy  = PAR[PM_PAR_SYY];
    121         shape.sxy = PAR[PM_PAR_SXY];
    122 
    123         // for a non-circular Sersic, the flux of the Rmajor equivalent is scaled by the AspectRatio
    124         psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     117        psEllipseAxes axes;
     118        pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
    125119
    126120        // get the central pixel flux from the lookup table
     
    230224        // if q1 < 0.0, f2 ~ f1, we have a very large axis ratio near 45deg..  Saturate at that
    231225        // angle and let f2,f1 fight it out
    232         q2 = 0.5*sqrtf(q1);
     226        // NOTE: the factor of 2 is needed to convert par[SXX,SYY] to shape.sx,sy
     227        q2 = 2.0*0.5*sqrtf(q1);
    233228    }
    234229
     
    295290
    296291    // set the shape parameters
    297     // XXX adjust this?
    298     if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
     292    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, true)) {
    299293      return false;
    300294    }
     
    316310psF64 PM_MODEL_FLUX (const psVector *params)
    317311{
    318     psEllipseShape shape;
    319 
    320312    psF32 *PAR = params->data.F32;
    321313
    322     shape.sx  = PAR[PM_PAR_SXX];
    323     shape.sy  = PAR[PM_PAR_SYY];
    324     shape.sxy = PAR[PM_PAR_SXY];
    325 
    326     // for a non-circular Exponential, the flux of the Rmajor equivalent is scaled by the AspectRatio
    327     psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     314    psEllipseAxes axes;
     315    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
    328316    float AspectRatio = axes.minor / axes.major;
    329317
     
    345333psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux)
    346334{
    347     psEllipseShape shape;
    348 
    349335    psF32 *PAR = params->data.F32;
    350336
     
    356342        return (1.0);
    357343
    358     shape.sx  = PAR[PM_PAR_SXX];
    359     shape.sy  = PAR[PM_PAR_SYY];
    360     shape.sxy = PAR[PM_PAR_SXY];
    361 
    362     psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     344    psEllipseAxes axes;
     345    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
    363346
    364347    // f = Io exp(-sqrt(z)) -> sqrt(z) = ln(Io/f)
     
    392375    // the 2D PSF model fits polarization terms (E0,E1,E2)
    393376    // convert to shape terms (SXX,SYY,SXY)
    394     if (!pmPSF_FitToModel (out, 0.1)) {
     377    bool useReff = pmModelUseReff (modelPSF->type);
     378    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
    395379        psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
    396380        return false;
     
    445429    // convert to shape terms (SXX,SYY,SXY)
    446430    // XXX user-defined value for limit?
    447     if (!pmPSF_FitToModel (PAR, 0.1)) {
     431    bool useReff = pmModelUseReff (model->type);
     432    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
    448433        psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
    449434        return false;
Note: See TracChangeset for help on using the changeset viewer.