- 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_DEV.c
r35560 r35644 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 … … 303 297 304 298 // 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)) { 299 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, true)) { 307 300 return false; 308 301 } … … 330 323 psF64 PM_MODEL_FLUX (const psVector *params) 331 324 { 332 psEllipseShape shape;333 334 325 psF32 *PAR = params->data.F32; 335 326 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); 327 psEllipseAxes axes; 328 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 342 329 float AspectRatio = axes.minor / axes.major; 343 330 … … 359 346 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux) 360 347 { 361 psEllipseShape shape;362 363 348 psF32 *PAR = params->data.F32; 364 349 … … 370 355 return (1.0); 371 356 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); 357 psEllipseAxes axes; 358 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 377 359 378 360 // f = Io exp(-z^n) -> z^n = ln(Io/f) … … 382 364 psAssert (isfinite(radius), "fix this code: radius should not be nan for Io = %f, flux = %f, major = %f (%f, %f, %f)", 383 365 PAR[PM_PAR_I0], flux, axes.major, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY]); 384 385 366 return (radius); 386 367 } … … 407 388 // the 2D PSF model fits polarization terms (E0,E1,E2) 408 389 // convert to shape terms (SXX,SYY,SXY) 409 if (!pmPSF_FitToModel (out, 0.1)) { 390 bool useReff = pmModelUseReff (modelPSF->type); 391 if (!pmPSF_FitToModel (out, 0.1, useReff)) { 410 392 psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]); 411 393 return false; … … 460 442 // convert to shape terms (SXX,SYY,SXY) 461 443 // XXX user-defined value for limit? 462 if (!pmPSF_FitToModel (PAR, 0.1)) { 444 bool useReff = pmModelUseReff (model->type); 445 if (!pmPSF_FitToModel (PAR, 0.1, useReff)) { 463 446 psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo); 464 447 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
