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

    r35560 r35768  
    138138    float q2 = NAN;
    139139    if (nParam == PM_PAR_SXY) {
    140         float f1 = 1.0 / PS_SQR(params[PM_PAR_SYY]) + 1.0 / PS_SQR(params[PM_PAR_SXX]);
    141         float f2 = 1.0 / PS_SQR(params[PM_PAR_SYY]) - 1.0 / PS_SQR(params[PM_PAR_SXX]);
     140        // NOTE: the factor of 2 is needed to convert par[SXX,SYY] to shape.sx,sy
     141        float f1 = 2.0 / PS_SQR(params[PM_PAR_SYY]) + 2.0 / PS_SQR(params[PM_PAR_SXX]);
     142        float f2 = 2.0 / PS_SQR(params[PM_PAR_SYY]) - 2.0 / PS_SQR(params[PM_PAR_SXX]);
    142143        float q1 = PS_SQR(f1)*AR_RATIO - PS_SQR(f2);
    143144        q1 = (q1 < 0.0) ? 0.0 : q1;
     
    210211
    211212    // set the shape parameters
    212     if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
     213    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
    213214      return false;
    214215    }
     
    234235{
    235236    float z, norm;
    236     psEllipseShape shape;
    237237
    238238    psF32 *PAR = params->data.F32;
    239239
    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);
     240    psEllipseAxes axes;
     241    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
    245242    float AspectRatio = axes.minor / axes.major;
    246243
     
    274271{
    275272    psF64 z;
    276     psEllipseShape shape;
    277273
    278274    psF32 *PAR = params->data.F32;
     
    285281        return (1.0);
    286282
    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);
     283    psEllipseAxes axes;
     284    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
    292285    psF64 sigma = axes.major;
    293286
     
    357350    // the 2D PSF model fits polarization terms (E0,E1,E2)
    358351    // convert to shape terms (SXX,SYY,SXY)
    359     if (!pmPSF_FitToModel (out, 0.1)) {
     352    bool useReff = pmModelUseReff (modelPSF->type);
     353    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
    360354        psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
    361355        return false;
     
    409403    // the 2D PSF model fits polarization terms (E0,E1,E2)
    410404    // convert to shape terms (SXX,SYY,SXY)
    411     // XXX user-defined value for limit?
    412     if (!pmPSF_FitToModel (PAR, 0.1)) {
     405    bool useReff = pmModelUseReff (model->type);
     406    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
    413407        psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
    414408        return false;
Note: See TracChangeset for help on using the changeset viewer.