- 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_EXP.c
r35560 r35644 115 115 116 116 // first, use Rmajor and index to find the central pixel flux (fraction of total flux) 117 psEllipseShape shape; 118 119 shape.sx = PAR[PM_PAR_SXX]; 120 shape.sy = PAR[PM_PAR_SYY]; 121 shape.sxy = PAR[PM_PAR_SXY]; 122 123 // for a non-circular Sersic, the flux of the Rmajor equivalent is scaled by the AspectRatio 124 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 117 psEllipseAxes axes; 118 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 125 119 126 120 // get the central pixel flux from the lookup table … … 295 289 296 290 // set the shape parameters 297 // XXX adjust this? 298 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) { 291 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, true)) { 299 292 return false; 300 293 } … … 316 309 psF64 PM_MODEL_FLUX (const psVector *params) 317 310 { 318 psEllipseShape shape;319 320 311 psF32 *PAR = params->data.F32; 321 312 322 shape.sx = PAR[PM_PAR_SXX]; 323 shape.sy = PAR[PM_PAR_SYY]; 324 shape.sxy = PAR[PM_PAR_SXY]; 325 326 // for a non-circular Exponential, the flux of the Rmajor equivalent is scaled by the AspectRatio 327 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 313 psEllipseAxes axes; 314 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 328 315 float AspectRatio = axes.minor / axes.major; 329 316 … … 345 332 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux) 346 333 { 347 psEllipseShape shape;348 349 334 psF32 *PAR = params->data.F32; 350 335 … … 356 341 return (1.0); 357 342 358 shape.sx = PAR[PM_PAR_SXX]; 359 shape.sy = PAR[PM_PAR_SYY]; 360 shape.sxy = PAR[PM_PAR_SXY]; 361 362 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 343 psEllipseAxes axes; 344 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 363 345 364 346 // f = Io exp(-sqrt(z)) -> sqrt(z) = ln(Io/f) … … 392 374 // the 2D PSF model fits polarization terms (E0,E1,E2) 393 375 // convert to shape terms (SXX,SYY,SXY) 394 if (!pmPSF_FitToModel (out, 0.1)) { 376 bool useReff = pmModelUseReff (modelPSF->type); 377 if (!pmPSF_FitToModel (out, 0.1, useReff)) { 395 378 psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]); 396 379 return false; … … 445 428 // convert to shape terms (SXX,SYY,SXY) 446 429 // XXX user-defined value for limit? 447 if (!pmPSF_FitToModel (PAR, 0.1)) { 430 bool useReff = pmModelUseReff (model->type); 431 if (!pmPSF_FitToModel (PAR, 0.1, useReff)) { 448 432 psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo); 449 433 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
