Changeset 10181
- Timestamp:
- Nov 24, 2006, 10:56:20 AM (19 years ago)
- Location:
- trunk/psModules/src/objects/models
- Files:
-
- 2 edited
-
pmModel_GAUSS.c (modified) (3 diffs)
-
pmModel_PGAUSS.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/models/pmModel_GAUSS.c
r10078 r10181 14 14 * PM_PAR_XPOS 2 - X center of object 15 15 * 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) 18 18 * PM_PAR_SXY 6 - X*Y term of elliptical contour 19 19 *****************************************************************************/ … … 95 95 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 96 96 { 97 98 97 pmMoments *moments = source->moments; 99 98 psF32 *PAR = model->params->data.F32; 99 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 100 110 101 111 PAR[PM_PAR_SKY] = moments->Sky; … … 103 113 PAR[PM_PAR_XPOS] = moments->x; 104 114 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);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); 107 117 PAR[PM_PAR_SXY] = 0.0; 118 # if (0) 119 120 PAR[PM_PAR_SXX] = PS_MAX(0.5, M_SQRT2*shape.sx); 121 PAR[PM_PAR_SYY] = PS_MAX(0.5, M_SQRT2*shape.sy); 122 PAR[PM_PAR_SXY] = shape.sxy; 123 # endif 124 108 125 return(true); 109 126 } -
trunk/psModules/src/objects/models/pmModel_PGAUSS.c
r10078 r10181 14 14 * PM_PAR_XPOS 2 - X center of object 15 15 * 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) 18 18 * PM_PAR_SXY 6 - X*Y term of elliptical contour 19 19 *****************************************************************************/ … … 51 51 dPAR[PM_PAR_YPOS] = q*(2.0*py/PAR[PM_PAR_SYY] + X*PAR[PM_PAR_SXY]); 52 52 // 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]; 55 55 dPAR[PM_PAR_SXY] = -q*X*Y; 56 56 } … … 95 95 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 96 96 { 97 98 97 pmMoments *moments = source->moments; 99 98 psF32 *PAR = model->params->data.F32; 100 99 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 101 111 PAR[PM_PAR_SKY] = moments->Sky; 102 112 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? 104 114 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 108 125 109 126 return(true);
Note:
See TracChangeset
for help on using the changeset viewer.
