Index: /trunk/psphot/src/psphotReadout.c
===================================================================
--- /trunk/psphot/src/psphotReadout.c	(revision 14754)
+++ /trunk/psphot/src/psphotReadout.c	(revision 14755)
@@ -79,5 +79,12 @@
     psphotModelTest (config, view, recipe, maskVal, maskMark);
 
-    // find the peaks in the image
+    // load the psf model, if suppled
+    // XXX include code in here to save FWHM_X,FWHM_Y in the recipe
+    pmPSF *psf = psphotLoadPSF (config, view, recipe);
+    
+    // find the peaks in the image.  
+
+    // XXX clean this up into a single function.  if psf is defined, we should treat this as
+    // pass "2", not "1".  re-define this boolean to be "have PSF"
     psArray *peaks;
     psArray *footprints = NULL;
@@ -102,7 +109,4 @@
     }
 
-    // psArray *bounds = psphotGetBounds ();
-    // psArray *sources = psphotBoundsToSources ();
-
     // construct sources and measure basic stats
     psArray *sources = psphotSourceStats (readout, recipe, peaks, maskVal, maskMark);
@@ -122,6 +126,9 @@
     }
 
+    // use source classes to select PSF candidate stars (from PSF clump)?
+    bool findPSFClump = (psf == NULL);
+
     // classify sources based on moments, brightness
-    if (!psphotRoughClass (sources, recipe, true, maskSat)) {
+    if (!psphotRoughClass (sources, recipe, findPSFClump, maskSat)) {
         psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image");
         return psphotReadoutCleanup (config, readout, recipe, NULL, sources);
@@ -131,7 +138,6 @@
     }
 
-    // load the psf model, if suppled
-    pmPSF *psf = psphotLoadPSF (config, view, recipe);
-    if (!psf) {
+    // if we were not supplied a PSF, choose one here
+    if (psf == NULL) {
         // use bright stellar objects to measure PSF
         psf = psphotChoosePSF (readout, sources, recipe, maskVal, maskMark);
