Changeset 35768 for trunk/psModules/src/objects/models/pmModel_PGAUSS.c
- Timestamp:
- Jul 3, 2013, 2:37:22 PM (13 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/models/pmModel_PGAUSS.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130509/psModules (added) merged: 35594,35613,35628,35638-35639,35643-35648,35653,35657,35662,35750
- Property svn:mergeinfo changed
-
trunk/psModules/src/objects/models/pmModel_PGAUSS.c
r35560 r35768 129 129 float q2 = NAN; 130 130 if (nParam == PM_PAR_SXY) { 131 float f1 = 1.0 / PS_SQR(params[PM_PAR_SYY]) + 1.0 / PS_SQR(params[PM_PAR_SXX]); 132 float f2 = 1.0 / PS_SQR(params[PM_PAR_SYY]) - 1.0 / PS_SQR(params[PM_PAR_SXX]); 131 // NOTE: the factor of 2 is needed to convert par[SXX,SYY] to shape.sx,sy 132 float f1 = 2.0 / PS_SQR(params[PM_PAR_SYY]) + 2.0 / PS_SQR(params[PM_PAR_SXX]); 133 float f2 = 2.0 / PS_SQR(params[PM_PAR_SYY]) - 2.0 / PS_SQR(params[PM_PAR_SXX]); 133 134 float q1 = PS_SQR(f1)*AR_RATIO - PS_SQR(f2); 134 135 q1 = (q1 < 0.0) ? 0.0 : q1; … … 201 202 202 203 // set the shape parameters 203 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments )) {204 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 204 205 return false; 205 206 } … … 222 223 { 223 224 float z, norm; 224 psEllipseShape shape;225 225 226 226 psF32 *PAR = params->data.F32; 227 227 228 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 229 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 230 shape.sxy = PAR[PM_PAR_SXY]; 231 232 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 228 psEllipseAxes axes; 229 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false); 230 233 231 float AspectRatio = axes.minor / axes.major; 234 232 … … 262 260 { 263 261 psF64 z; 264 psEllipseShape shape;265 262 266 263 psF32 *PAR = params->data.F32; … … 273 270 return (1.0); 274 271 275 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 276 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 277 shape.sxy = PAR[PM_PAR_SXY]; 278 279 // this estimates the radius assuming f(z) is roughly exp(-z) 280 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 272 psEllipseAxes axes; 273 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false); 274 281 275 psF64 sigma = axes.major; 282 276 … … 347 341 } 348 342 349 // the OLD 2D model for SXY actually fitted SXY / (SXX^-2 + SYY^-2); correct here350 // out[PM_PAR_SXY] = pmPSF_SXYtoModel (out);351 352 343 // the 2D PSF model fits polarization terms (E0,E1,E2) 353 344 // convert to shape terms (SXX,SYY,SXY) 354 if (!pmPSF_FitToModel (out, 0.1)) { 345 bool useReff = pmModelUseReff (modelPSF->type); 346 if (!pmPSF_FitToModel (out, 0.1, useReff)) { 355 347 psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]); 356 348 return false; … … 403 395 // the 2D PSF model fits polarization terms (E0,E1,E2) 404 396 // convert to shape terms (SXX,SYY,SXY) 405 // XXX user-defined value for limit?406 if (!pmPSF_FitToModel (PAR, 0.1 )) {397 bool useReff = pmModelUseReff (model->type); 398 if (!pmPSF_FitToModel (PAR, 0.1, useReff)) { 407 399 psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo); 408 400 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
