Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_DEV.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_DEV.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_DEV.c	(revision 35644)
@@ -123,12 +123,6 @@
 
 	// first, use Rmajor and index to find the central pixel flux (fraction of total flux)
-	psEllipseShape shape;
-
-	shape.sx  = PAR[PM_PAR_SXX];
-	shape.sy  = PAR[PM_PAR_SYY];
-	shape.sxy = PAR[PM_PAR_SXY];
-
-	// for a non-circular Sersic, the flux of the Rmajor equivalent is scaled by the AspectRatio
-	psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+	psEllipseAxes axes;
+	pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
 
 	// get the central pixel flux from the lookup table
@@ -303,6 +297,5 @@
 
     // set the shape parameters
-    // XXX adjust this?
-    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
+    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, true)) {
       return false;
     }
@@ -330,14 +323,8 @@
 psF64 PM_MODEL_FLUX (const psVector *params)
 {
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX];
-    shape.sy  = PAR[PM_PAR_SYY];
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    // for a non-circular DeVaucouleur, the flux of the Rmajor equivalent is scaled by the AspectRatio
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
     float AspectRatio = axes.minor / axes.major;
 
@@ -359,6 +346,4 @@
 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux)
 {
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
@@ -370,9 +355,6 @@
         return (1.0);
 
-    shape.sx  = PAR[PM_PAR_SXX];
-    shape.sy  = PAR[PM_PAR_SYY];
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
 
     // f = Io exp(-z^n) -> z^n = ln(Io/f)
@@ -382,5 +364,4 @@
     psAssert (isfinite(radius), "fix this code: radius should not be nan for Io = %f, flux = %f, major = %f (%f, %f, %f)", 
 	      PAR[PM_PAR_I0], flux, axes.major, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY]);
-
     return (radius);
 }
@@ -407,5 +388,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    if (!pmPSF_FitToModel (out, 0.1)) {
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -460,5 +442,6 @@
     // convert to shape terms (SXX,SYY,SXY)
     // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_EXP.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_EXP.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_EXP.c	(revision 35644)
@@ -115,12 +115,6 @@
 
 	// first, use Rmajor and index to find the central pixel flux (fraction of total flux)
-	psEllipseShape shape;
-
-	shape.sx  = PAR[PM_PAR_SXX];
-	shape.sy  = PAR[PM_PAR_SYY];
-	shape.sxy = PAR[PM_PAR_SXY];
-
-	// for a non-circular Sersic, the flux of the Rmajor equivalent is scaled by the AspectRatio
-	psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+	psEllipseAxes axes;
+	pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
 
 	// get the central pixel flux from the lookup table
@@ -295,6 +289,5 @@
 
     // set the shape parameters
-    // XXX adjust this?
-    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
+    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, true)) {
       return false;
     }
@@ -316,14 +309,8 @@
 psF64 PM_MODEL_FLUX (const psVector *params)
 {
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX];
-    shape.sy  = PAR[PM_PAR_SYY];
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    // for a non-circular Exponential, the flux of the Rmajor equivalent is scaled by the AspectRatio
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
     float AspectRatio = axes.minor / axes.major;
 
@@ -345,6 +332,4 @@
 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux)
 {
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
@@ -356,9 +341,6 @@
         return (1.0);
 
-    shape.sx  = PAR[PM_PAR_SXX];
-    shape.sy  = PAR[PM_PAR_SYY];
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
 
     // f = Io exp(-sqrt(z)) -> sqrt(z) = ln(Io/f)
@@ -392,5 +374,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    if (!pmPSF_FitToModel (out, 0.1)) {
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -445,5 +428,6 @@
     // convert to shape terms (SXX,SYY,SXY)
     // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_GAUSS.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_GAUSS.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_GAUSS.c	(revision 35644)
@@ -200,5 +200,5 @@
 
     // set the shape parameters
-    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
+    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
       return false;
     }
@@ -219,16 +219,10 @@
 psF64 PM_MODEL_FLUX (const psVector *params)
 {
-
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
 
     // Area is equivalent to 2 pi sigma^2
-    // axes ratio < 20
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
     psF64 Area = 2.0 * M_PI * axes.major * axes.minor;
 
@@ -242,6 +236,4 @@
 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux)
 {
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
@@ -253,9 +245,7 @@
         return (1.0);
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
+
     psF64 radius = axes.major * sqrt (2.0 * log(PAR[PM_PAR_I0] / flux));
     psAssert (isfinite(radius), "fix this code: radius should not be nan for Io = %f, flux = %f, major = %f (%f, %f, %f)", 
@@ -285,12 +275,8 @@
     }
 
-    // the OLD 2D model for SXY actually fitted SXY / (SXX^-2 + SYY^-2); correct here
-    // out[PM_PAR_SXY] = pmPSF_SXYtoModel (out);
-
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (out, 0.1)) {
-        // psError(PM_ERR_PSF, false, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -343,6 +329,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PGAUSS.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PGAUSS.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PGAUSS.c	(revision 35644)
@@ -201,5 +201,5 @@
 
     // set the shape parameters
-    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
+    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
       return false;
     }
@@ -222,13 +222,10 @@
 {
     float z, norm;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
+
     float AspectRatio = axes.minor / axes.major;
 
@@ -262,5 +259,4 @@
 {
     psF64 z;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
@@ -273,10 +269,7 @@
         return (1.0);
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    // this estimates the radius assuming f(z) is roughly exp(-z)
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
+
     psF64 sigma = axes.major;
 
@@ -347,10 +340,8 @@
     }
 
-    // the OLD 2D model for SXY actually fitted SXY / (SXX^-2 + SYY^-2); correct here
-    // out[PM_PAR_SXY] = pmPSF_SXYtoModel (out);
-
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    if (!pmPSF_FitToModel (out, 0.1)) {
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -403,6 +394,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PS1_V1.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PS1_V1.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_PS1_V1.c	(revision 35644)
@@ -221,5 +221,5 @@
 
     // set the shape parameters
-    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
+    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
       return false;
     }
@@ -245,13 +245,9 @@
 {
     float z, norm;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
     float AspectRatio = axes.minor / axes.major;
 
@@ -285,5 +281,4 @@
 {
     psF64 z;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
@@ -293,9 +288,6 @@
     if (flux >= PAR[PM_PAR_I0]) return 1.0;
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
     psF64 sigma = axes.major;
 
@@ -364,5 +356,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    if (!pmPSF_FitToModel (out, 0.1)) {
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -417,5 +410,6 @@
     // convert to shape terms (SXX,SYY,SXY)
     // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_QGAUSS.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_QGAUSS.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_QGAUSS.c	(revision 35644)
@@ -221,5 +221,5 @@
 
     // set the shape parameters
-    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
+    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
       return false;
     }
@@ -245,13 +245,9 @@
 {
     float z, norm;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
     float AspectRatio = axes.minor / axes.major;
 
@@ -285,5 +281,4 @@
 {
     psF64 z;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
@@ -293,9 +288,6 @@
     if (flux >= PAR[PM_PAR_I0]) return 1.0;
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
     psF64 sigma = axes.major;
 
@@ -364,5 +356,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    if (!pmPSF_FitToModel (out, 0.1)) {
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -421,6 +414,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_RGAUSS.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_RGAUSS.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_RGAUSS.c	(revision 35644)
@@ -210,5 +210,5 @@
 
     // set the shape parameters
-    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments)) {
+    if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) {
       return false;
     }
@@ -234,13 +234,9 @@
 {
     float z, norm;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
     float AspectRatio = axes.minor / axes.major;
 
@@ -274,5 +270,4 @@
 {
     psF64 z;
-    psEllipseShape shape;
 
     psF32 *PAR = params->data.F32;
@@ -285,9 +280,6 @@
         return (1.0);
 
-    shape.sx  = PAR[PM_PAR_SXX] / M_SQRT2;
-    shape.sy  = PAR[PM_PAR_SYY] / M_SQRT2;
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false);
     psF64 sigma = axes.major;
 
@@ -357,5 +349,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    if (!pmPSF_FitToModel (out, 0.1)) {
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -409,6 +402,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_SERSIC.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_SERSIC.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_SERSIC.c	(revision 35644)
@@ -125,12 +125,6 @@
 
 	// first, use Rmajor and index to find the central pixel flux (fraction of total flux)
-	psEllipseShape shape;
-
-	shape.sx  = PAR[PM_PAR_SXX];
-	shape.sy  = PAR[PM_PAR_SYY];
-	shape.sxy = PAR[PM_PAR_SXY];
-
-	// for a non-circular Sersic, the flux of the Rmajor equivalent is scaled by the AspectRatio
-	psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+	psEllipseAxes axes;
+	pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
 
 	// get the central pixel flux from the lookup table
@@ -347,9 +341,6 @@
     axes.major = Rmajor;
     axes.minor = Rminor;
-    psEllipseShape shape = psEllipseAxesToShape (axes);
-
-    if (!isfinite(shape.sx))  return false;
-    if (!isfinite(shape.sy))  return false;
-    if (!isfinite(shape.sxy)) return false;
+
+    pmModelAxesToParams (&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], axes, true);
 
     float bn = 1.9992*index - 0.3271;
@@ -357,11 +348,4 @@
     float Io = exp(0.5*bn);
 
-    float Sxx = PS_MAX(0.5, shape.sx);
-    float Syy = PS_MAX(0.5, shape.sy);
-
-    PAR[PM_PAR_SXX]  = Sxx;
-    PAR[PM_PAR_SYY]  = Syy;
-    PAR[PM_PAR_SXY]  = shape.sxy;
-
     // set the model normalization (adjust for Sersic best guess)
     if (!pmModelSetNorm(&PAR[PM_PAR_I0], source)) {
@@ -381,14 +365,8 @@
 psF64 PM_MODEL_FLUX (const psVector *params)
 {
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
-    shape.sx  = PAR[PM_PAR_SXX];
-    shape.sy  = PAR[PM_PAR_SYY];
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    // for a non-circular Sersic, the flux of the Rmajor equivalent is scaled by the AspectRatio
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
     float AspectRatio = axes.minor / axes.major;
 
@@ -410,6 +388,4 @@
 psF64 PM_MODEL_RADIUS (const psVector *params, psF64 flux)
 {
-    psEllipseShape shape;
-
     psF32 *PAR = params->data.F32;
 
@@ -421,9 +397,6 @@
         return (1.0);
 
-    shape.sx  = PAR[PM_PAR_SXX];
-    shape.sy  = PAR[PM_PAR_SYY];
-    shape.sxy = PAR[PM_PAR_SXY];
-
-    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
+    psEllipseAxes axes;
+    pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true);
 
     // f = Io exp(-z^n) -> z^n = ln(Io/f)
@@ -457,5 +430,6 @@
     // the 2D PSF model fits polarization terms (E0,E1,E2)
     // convert to shape terms (SXX,SYY,SXY)
-    if (!pmPSF_FitToModel (out, 0.1)) {
+    bool useReff = pmModelUseReff (modelPSF->type);
+    if (!pmPSF_FitToModel (out, 0.1, useReff)) {
         psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]);
         return false;
@@ -510,5 +484,6 @@
     // convert to shape terms (SXX,SYY,SXY)
     // XXX user-defined value for limit?
-    if (!pmPSF_FitToModel (PAR, 0.1)) {
+    bool useReff = pmModelUseReff (model->type);
+    if (!pmPSF_FitToModel (PAR, 0.1, useReff)) {
         psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo);
         return false;
Index: /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_TRAIL.c
===================================================================
--- /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_TRAIL.c	(revision 35643)
+++ /branches/eam_branches/ipp-20130509/psModules/src/objects/models/pmModel_TRAIL.c	(revision 35644)
@@ -350,10 +350,9 @@
     PAR[PM_PAR_SKY]  = 0.0;
 
-    // XXX test : modify the Io, SXX, SYY terms based on the psf SXX, SYY terms:
-    psEllipseShape psfShape;
-    psfShape.sx  = source->modelPSF->params->data.F32[PM_PAR_SXX] / M_SQRT2;
-    psfShape.sxy = source->modelPSF->params->data.F32[PM_PAR_SXY];
-    psfShape.sy  = source->modelPSF->params->data.F32[PM_PAR_SYY] / M_SQRT2;
-    psEllipseAxes psfAxes = psEllipseShapeToAxes (psfShape, 20.0);
+    psF32 *psfPAR  = source->modelPSF->params->data.F32;
+    bool useReff = pmModelUseReff (source->modelPSF->type);
+
+    psEllipseAxes psfAxes;
+    pmModelParamsToAxes (&psfAxes, psfPAR[PM_PAR_SXX], psfPAR[PM_PAR_SXY], psfPAR[PM_PAR_SYY], useReff);
 
     psEllipseMoments emoments;
