Index: /trunk/psphot/src/psphotChoosePSF.c
===================================================================
--- /trunk/psphot/src/psphotChoosePSF.c	(revision 13078)
+++ /trunk/psphot/src/psphotChoosePSF.c	(revision 13079)
@@ -229,4 +229,6 @@
     // XXX test dump of psf star data and psf-subtracted image
     if (psTraceGetLevel("psphot.psfstars") > 5) { 
+	psphotSaveImage (NULL, readout->image,  "rawstars.fits");
+
 	for (int i = 0; i < try->sources->n; i++) {
 	    // masked for: bad model fit, outlier in parameters
@@ -247,4 +249,42 @@
 	}
 
+	FILE *f = fopen ("shapes.dat", "w");
+	for (int i = 0; i < try->sources->n; i++) {
+	    psF32 inPar[10];
+
+	    // masked for: bad model fit, outlier in parameters
+	    if (try->mask->data.U8[i] & PSFTRY_MASK_ALL) continue;
+
+	    pmSource *source = try->sources->data[i];
+	    psF32 *outPar = source->modelEXT->params->data.F32;
+
+	    psEllipseShape shape;
+
+	    shape.sx  = outPar[PM_PAR_SXX] / M_SQRT2;
+	    shape.sy  = outPar[PM_PAR_SYY] / M_SQRT2;
+	    shape.sxy = outPar[PM_PAR_SXY];
+
+	    psEllipsePol pol = pmPSF_ModelToFit (outPar);
+	    inPar[PM_PAR_E0] = pol.e0;
+	    inPar[PM_PAR_E1] = pol.e1;
+	    inPar[PM_PAR_E2] = pol.e2;
+	    pmPSF_FitToModel (inPar, 0.1);
+
+	    psEllipseAxes axes1 = psEllipseShapeToAxes (shape, 20.0);
+	    psEllipseAxes axes2 = psEllipsePolToAxes (pol, 0.1);
+	    psEllipsePol pol2 = psEllipseAxesToPol (axes1);
+
+	    fprintf (f, "%3d  %7.2f %7.2f  %7.4f %7.4f %7.4f  --  %7.4f %7.4f %7.4f  :  %7.4f %7.4f %7.4f  --  %7.4f %7.4f %7.4f : %7.4f %7.4f %6.1f : %7.4f %7.4f %6.1f\n",
+		     i, outPar[PM_PAR_XPOS], outPar[PM_PAR_YPOS],
+		     outPar[PM_PAR_SXX], outPar[PM_PAR_SXY], outPar[PM_PAR_SYY],
+		     pol.e0, pol.e1, pol.e2, 
+		     pol2.e0, pol2.e1, pol2.e2, 
+		     inPar[PM_PAR_SXX], inPar[PM_PAR_SXY], inPar[PM_PAR_SYY],
+		     axes1.major, axes1.minor, axes1.theta*PM_DEG_RAD,
+		     axes2.major, axes2.minor, axes2.theta*PM_DEG_RAD
+		     );
+	}
+	fclose (f);
+
 	psphotSaveImage (NULL, readout->image,  "psfstars.fits");
 	pmSourcesWritePSFs (try->sources, "psfstars.dat");
