Index: /trunk/psphot/src/psphotRoughClass.c
===================================================================
--- /trunk/psphot/src/psphotRoughClass.c	(revision 14758)
+++ /trunk/psphot/src/psphotRoughClass.c	(revision 14759)
@@ -2,22 +2,38 @@
 
 // 2006.02.02 : no leaks
-bool psphotRoughClass (psArray *sources, psMetadata *recipe, const bool findPsfClump, psMaskType maskSat) {
-
-    // XXX rather than using a static psfClump, should we push X,Y, dX,dY  into the metadata?
+bool psphotRoughClass (psArray *sources, psMetadata *recipe, const bool havePSF, psMaskType maskSat) {
 
     static pmPSFClump   psfClump;
-    static bool havePsfClump = false;
 
     psTimerStart ("psphot");
 
-    if (findPsfClump) {
+    if (!havePSF) {
+	// determine the PSF parameters from the source moment values
         psfClump = pmSourcePSFClump (sources, recipe);
-    } else if (!havePsfClump) {
-        psError(PSPHOT_ERR_PROG, false, "You must find the PSF clump before reusing it");
-    } else {
-        ;
+    } else 
+	// pull FWHM_X,Y from the recipe, use to define psfClump.X,Y
+        bool status_x, status_y;
+        float FWHM_X = psMetadataLookupF32 (&status_x, recipe, "FWHM_X");
+        float FWHM_Y = psMetadataLookupF32 (&status_y, recipe, "FWHM_Y");
+        float ANGLE  = psMetadataLookupF32 (&status_a, recipe, "ANGLE");
+        if (!status_x | !status_y | !status_a) {
+            psError(PSPHOT_ERR_CONFIG, false, "FWHM_X, FWHM_Y, or ANGLE not defined");
+            return false;
+        }
+
+	psEllipseAxes axes;
+	axes.major = FWHM_X / (2.0*sqrt(2.0*log(2.0)));
+	axes.minor = FWHM_Y / (2.0*sqrt(2.0*log(2.0)));
+	axes.theta = ANGLE;
+	psEllipseShape shape = psEllipseAxesToShape (axes);
+	
+        psfClump.X   = shape.sx;
+        psfClump.Y   = shape.sy;
+        psfClump.dX  = 0.1*shape.sx;
+        psfClump.dY  = 0.1*shape.sy;
+	// dX,dY are somewhat crudely defined, but only used to select PSF candidates.
+	// if we already have a PSF, this is not actually used...
     }
 
-    havePsfClump = false;               // we don't know if it's valid
     if (psfClump.X < 0) {
         psError(PSPHOT_ERR_PROG, false, "programming error calling pmSourcePSFClump");
@@ -42,6 +58,4 @@
     psLogMsg ("psphot.roughclass", PS_LOG_INFO, "rough classification: %f sec\n", psTimerMark ("psphot"));
 
-    havePsfClump = true;                        // we have set psfClump
-
     return true;
 }
