Index: trunk/psphot/src/psphotReadoutCleanup.c
===================================================================
--- trunk/psphot/src/psphotReadoutCleanup.c	(revision 11184)
+++ trunk/psphot/src/psphotReadoutCleanup.c	(revision 11263)
@@ -1,15 +1,26 @@
 # include "psphot.h"
 
+// psphotReadoutCleanup is called on exit from psphotReadout if the last raised
+// error is not a DATA error, then there was a serious problem.  only in this
+// case, or if the fail on the stats measurement, do we return false
 bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmPSF *psf, psArray *sources) {
+
+    psErrorCode err = psErrorCodeLast();
+    if (err != PSPHOT_ERR_DATA) {
+	return false;
+    }
 
     // use the psf-model to measure FWHM stats
     if (psf) {
+	// don't call psphotPSFstats unless we have a valid pdf
+	// if it fails, there is probably a programming error 
         if (!psphotPSFstats (readout, recipe, psf)) {
-            psError(PS_ERR_IO, true, "Failed to measure PSF shape parameters");
+            psError(PSPHOT_ERR_PROG, false, "Failed to measure PSF shape parameters");
             return false;
         }
-    } else if (sources) {
+    }
+    if (!psf && sources) {
         if (!psphotMomentsStats (readout, recipe, sources)) {
-            psError(PS_ERR_IO, true, "Failed to measure Moment shape parameters");
+            psError(PSPHOT_ERR_PROG, false, "Failed to measure Moment shape parameters");
             return false;
         }
