IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 24, 2006, 10:56:20 AM (19 years ago)
Author:
magnier
Message:

guess is off by sqrt(2)

File:
1 edited

Legend:

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

    r10078 r10181  
    1414 * PM_PAR_XPOS 2  - X center of object
    1515 * PM_PAR_YPOS 3  - Y center of object
    16  * PM_PAR_SXX 4   - X^2 term of elliptical contour (sqrt(2) / SigmaX)
    17  * PM_PAR_SYY 5   - Y^2 term of elliptical contour (sqrt(2) / SigmaY)
     16 * PM_PAR_SXX 4   - X^2 term of elliptical contour (sqrt(2) * SigmaX)
     17 * PM_PAR_SYY 5   - Y^2 term of elliptical contour (sqrt(2) * SigmaY)
    1818 * PM_PAR_SXY 6   - X*Y term of elliptical contour
    1919 *****************************************************************************/
     
    5151        dPAR[PM_PAR_YPOS] = q*(2.0*py/PAR[PM_PAR_SYY] + X*PAR[PM_PAR_SXY]);
    5252        // the extra factor of 2 below is needed to avoid excessive swings
    53         dPAR[PM_PAR_SXX] =  +4.0*q*px*px/PAR[PM_PAR_SXX];
    54         dPAR[PM_PAR_SYY] =  +4.0*q*py*py/PAR[PM_PAR_SYY];
     53        dPAR[PM_PAR_SXX] =  +2.0*q*px*px/PAR[PM_PAR_SXX];
     54        dPAR[PM_PAR_SYY] =  +2.0*q*py*py/PAR[PM_PAR_SYY];
    5555        dPAR[PM_PAR_SXY] = -q*X*Y;
    5656    }
     
    9595bool PM_MODEL_GUESS (pmModel *model, pmSource *source)
    9696{
    97 
    9897    pmMoments *moments = source->moments;
    9998    psF32     *PAR     = model->params->data.F32;
    10099
     100    # if (0)
     101
     102        psEllipseMoments emoments;
     103    emoments.x2 = moments->Sx;
     104    emoments.y2 = moments->Sx;
     105    emoments.xy = moments->Sxy;
     106
     107    psEllipseAxes axes = psEllipseMomentsToAxes (emoments);
     108    psEllipseShape shape = psEllipseAxesToShape (axes);
     109    # endif
     110
    101111    PAR[PM_PAR_SKY]  = moments->Sky;
    102112    PAR[PM_PAR_I0]   = moments->Peak - moments->Sky;
    103     PAR[PM_PAR_XPOS] = moments->x;
     113    PAR[PM_PAR_XPOS] = moments->x; // XXX use peak->xf, peak->yf?
    104114    PAR[PM_PAR_YPOS] = moments->y;
    105     PAR[PM_PAR_SXX] = PS_MAX(0.5, moments->Sx);
    106     PAR[PM_PAR_SYY] = PS_MAX(0.5, moments->Sy);
    107     PAR[PM_PAR_SXY]  = 0.0;
     115    PAR[PM_PAR_SXX] = PS_MAX(0.5, M_SQRT2*moments->Sx);
     116    PAR[PM_PAR_SYY] = PS_MAX(0.5, M_SQRT2*moments->Sy);
     117    PAR[PM_PAR_SXY] = 0.0;
     118
     119    # if (0)
     120
     121        PAR[PM_PAR_SXX] = PS_MAX(0.5, M_SQRT2*shape.sx);
     122    PAR[PM_PAR_SYY] = PS_MAX(0.5, M_SQRT2*shape.sy);
     123    PAR[PM_PAR_SXY] = shape.sxy;
     124    # endif
    108125
    109126    return(true);
Note: See TracChangeset for help on using the changeset viewer.