Index: trunk/psphot/src/psphotReadoutCleanup.c
===================================================================
--- trunk/psphot/src/psphotReadoutCleanup.c	(revision 37932)
+++ trunk/psphot/src/psphotReadoutCleanup.c	(revision 37941)
@@ -54,4 +54,10 @@
     psArray      *sources    = detections ? detections->allSources : NULL;
     // XXX where do we free these, in here (psMetadataRemove?)
+
+    int quality = psMetadataLookupS32 (&status, readout->analysis, "PSPHOT_QUALITY");
+    if (quality) {
+        // if there is no stats file this will be a no-op
+        psphotStatsFileSetQuality(quality);
+    }
 
     // use the psf-model to measure FWHM stats
