Changeset 35768 for trunk/psModules/src/objects/models/pmModel_EXP.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_EXP.c (modified) (8 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_EXP.c
r35560 r35768 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 … … 230 224 // if q1 < 0.0, f2 ~ f1, we have a very large axis ratio near 45deg.. Saturate at that 231 225 // angle and let f2,f1 fight it out 232 q2 = 0.5*sqrtf(q1); 226 // NOTE: the factor of 2 is needed to convert par[SXX,SYY] to shape.sx,sy 227 q2 = 2.0*0.5*sqrtf(q1); 233 228 } 234 229 … … 295 290 296 291 // 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)) { 292 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, true)) { 299 293 return false; 300 294 } … … 316 310 psF64 PM_MODEL_FLUX (const psVector *params) 317 311 { 318 psEllipseShape shape;319 320 312 psF32 *PAR = params->data.F32; 321 313 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); 314 psEllipseAxes axes; 315 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 328 316 float AspectRatio = axes.minor / axes.major; 329 317 … … 345 333 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux) 346 334 { 347 psEllipseShape shape;348 349 335 psF32 *PAR = params->data.F32; 350 336 … … 356 342 return (1.0); 357 343 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); 344 psEllipseAxes axes; 345 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 363 346 364 347 // f = Io exp(-sqrt(z)) -> sqrt(z) = ln(Io/f) … … 392 375 // the 2D PSF model fits polarization terms (E0,E1,E2) 393 376 // convert to shape terms (SXX,SYY,SXY) 394 if (!pmPSF_FitToModel (out, 0.1)) { 377 bool useReff = pmModelUseReff (modelPSF->type); 378 if (!pmPSF_FitToModel (out, 0.1, useReff)) { 395 379 psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]); 396 380 return false; … … 445 429 // convert to shape terms (SXX,SYY,SXY) 446 430 // XXX user-defined value for limit? 447 if (!pmPSF_FitToModel (PAR, 0.1)) { 431 bool useReff = pmModelUseReff (model->type); 432 if (!pmPSF_FitToModel (PAR, 0.1, useReff)) { 448 433 psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo); 449 434 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
