Changeset 35768 for trunk/psModules/src/objects/models/pmModel_DEV.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_DEV.c (modified) (9 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_DEV.c
r35560 r35768 123 123 124 124 // first, use Rmajor and index to find the central pixel flux (fraction of total flux) 125 psEllipseShape shape; 126 127 shape.sx = PAR[PM_PAR_SXX]; 128 shape.sy = PAR[PM_PAR_SYY]; 129 shape.sxy = PAR[PM_PAR_SXY]; 130 131 // for a non-circular Sersic, the flux of the Rmajor equivalent is scaled by the AspectRatio 132 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 125 psEllipseAxes axes; 126 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 133 127 134 128 // get the central pixel flux from the lookup table … … 238 232 // if q1 < 0.0, f2 ~ f1, we have a very large axis ratio near 45deg.. Saturate at that 239 233 // angle and let f2,f1 fight it out 240 q2 = 0.5*sqrtf(q1); 234 // NOTE: the factor of 2 is needed to convert par[SXX,SYY] to shape.sx,sy 235 q2 = 2.0*0.5*sqrtf(q1); 241 236 } 242 237 … … 303 298 304 299 // set the shape parameters 305 // XXX adjust this? 306 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) { 300 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, true)) { 307 301 return false; 308 302 } … … 330 324 psF64 PM_MODEL_FLUX (const psVector *params) 331 325 { 332 psEllipseShape shape;333 334 326 psF32 *PAR = params->data.F32; 335 327 336 shape.sx = PAR[PM_PAR_SXX]; 337 shape.sy = PAR[PM_PAR_SYY]; 338 shape.sxy = PAR[PM_PAR_SXY]; 339 340 // for a non-circular DeVaucouleur, the flux of the Rmajor equivalent is scaled by the AspectRatio 341 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 328 psEllipseAxes axes; 329 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 342 330 float AspectRatio = axes.minor / axes.major; 343 331 … … 359 347 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux) 360 348 { 361 psEllipseShape shape;362 363 349 psF32 *PAR = params->data.F32; 364 350 … … 370 356 return (1.0); 371 357 372 shape.sx = PAR[PM_PAR_SXX]; 373 shape.sy = PAR[PM_PAR_SYY]; 374 shape.sxy = PAR[PM_PAR_SXY]; 375 376 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 358 psEllipseAxes axes; 359 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 377 360 378 361 // f = Io exp(-z^n) -> z^n = ln(Io/f) … … 382 365 psAssert (isfinite(radius), "fix this code: radius should not be nan for Io = %f, flux = %f, major = %f (%f, %f, %f)", 383 366 PAR[PM_PAR_I0], flux, axes.major, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY]); 384 385 367 return (radius); 386 368 } … … 407 389 // the 2D PSF model fits polarization terms (E0,E1,E2) 408 390 // convert to shape terms (SXX,SYY,SXY) 409 if (!pmPSF_FitToModel (out, 0.1)) { 391 bool useReff = pmModelUseReff (modelPSF->type); 392 if (!pmPSF_FitToModel (out, 0.1, useReff)) { 410 393 psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]); 411 394 return false; … … 460 443 // convert to shape terms (SXX,SYY,SXY) 461 444 // XXX user-defined value for limit? 462 if (!pmPSF_FitToModel (PAR, 0.1)) { 445 bool useReff = pmModelUseReff (model->type); 446 if (!pmPSF_FitToModel (PAR, 0.1, useReff)) { 463 447 psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo); 464 448 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
