Changeset 35644 for branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PGAUSS.c
- Timestamp:
- Jun 11, 2013, 9:15:36 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PGAUSS.c
r35560 r35644 201 201 202 202 // set the shape parameters 203 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments )) {203 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 204 204 return false; 205 205 } … … 222 222 { 223 223 float z, norm; 224 psEllipseShape shape;225 224 226 225 psF32 *PAR = params->data.F32; 227 226 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); 227 psEllipseAxes axes; 228 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false); 229 233 230 float AspectRatio = axes.minor / axes.major; 234 231 … … 262 259 { 263 260 psF64 z; 264 psEllipseShape shape;265 261 266 262 psF32 *PAR = params->data.F32; … … 273 269 return (1.0); 274 270 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); 271 psEllipseAxes axes; 272 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false); 273 281 274 psF64 sigma = axes.major; 282 275 … … 347 340 } 348 341 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 342 // the 2D PSF model fits polarization terms (E0,E1,E2) 353 343 // convert to shape terms (SXX,SYY,SXY) 354 if (!pmPSF_FitToModel (out, 0.1)) { 344 bool useReff = pmModelUseReff (modelPSF->type); 345 if (!pmPSF_FitToModel (out, 0.1, useReff)) { 355 346 psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]); 356 347 return false; … … 403 394 // the 2D PSF model fits polarization terms (E0,E1,E2) 404 395 // convert to shape terms (SXX,SYY,SXY) 405 // XXX user-defined value for limit?406 if (!pmPSF_FitToModel (PAR, 0.1 )) {396 bool useReff = pmModelUseReff (model->type); 397 if (!pmPSF_FitToModel (PAR, 0.1, useReff)) { 407 398 psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo); 408 399 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
