Index: branches/tap_branches/psphot/src/psphotEllipticalProfile.c
===================================================================
--- branches/tap_branches/psphot/src/psphotEllipticalProfile.c	(revision 25900)
+++ branches/tap_branches/psphot/src/psphotEllipticalProfile.c	(revision 27838)
@@ -1,7 +1,16 @@
 # include "psphotInternal.h"
 
-bool psphotEllipticalProfile (pmSource *source) {
+bool psphotEllipticalProfile (pmSource *source, bool RAW_RADIUS) {
 
-    pmSourceRadialProfile *profile = source->extpars->profile;
+    psAssert (source, "missing source");
+    psAssert (source->extpars, "missing extpars");
+    psAssert (source->pixels, "missing pixels");
+
+    pmSourceExtendedPars *extpars = source->extpars;
+
+    if (!source->extpars->ellipticalFlux) {
+	source->extpars->ellipticalFlux = pmSourceEllipticalFluxAlloc();
+    }
+    pmSourceEllipticalFlux *profile = source->extpars->ellipticalFlux;
 
     profile->radiusElliptical = psVectorAllocEmpty(100, PS_TYPE_F32);
@@ -21,11 +30,17 @@
 
     psEllipseAxes axes;
-    axes.major = M_SQRT1_2;
-    axes.minor = M_SQRT1_2 * (profile->axes.minor / profile->axes.major);
+    if (RAW_RADIUS) {
+	// force circular profile
+	axes.major = M_SQRT1_2;
+	axes.minor = M_SQRT1_2;
+    } else {
+	axes.major = M_SQRT1_2;
+	axes.minor = M_SQRT1_2 * (extpars->axes.minor / extpars->axes.major);
+    }
 
     // axes.major = 1.0;
-    // axes.minor = profile->axes.minor / profile->axes.major;
+    // axes.minor = extpars->axes.minor / extpars->axes.major;
 
-    axes.theta = profile->axes.theta;
+    axes.theta = extpars->axes.theta;
     psEllipseShape shape = psEllipseAxesToShape (axes);
 
@@ -46,9 +61,9 @@
 
 	    float r2 = 0.5*PS_SQR(x/Sxx) + 0.5*PS_SQR(y/Syy) + x*y*Sxy;
+	    float Rraw = hypot(x, y);
 
 	    psVectorAppend(radius, sqrt(r2));
 	    psVectorAppend(flux, source->pixels->data.F32[iy][ix]);
 
-	    float Rraw = hypot(x, y);
 	    psVectorAppend(radiusRaw, Rraw);
 	    psVectorAppend(fluxRaw, source->pixels->data.F32[iy][ix]);
@@ -67,5 +82,5 @@
     // }
 
-    // psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, 0.0);
+    psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, source->peak->flux, 0.0);
     // psphotPetrosianVisualProfileByAngle (radius, flux);
 
