Index: trunk/psphot/src/psphotReadout.c
===================================================================
--- trunk/psphot/src/psphotReadout.c	(revision 15231)
+++ trunk/psphot/src/psphotReadout.c	(revision 15936)
@@ -68,5 +68,8 @@
 
     // generate a background model (median, smoothed image)
-    if (!psphotImageMedian (config, view, maskVal)) {
+    if (!psphotModelBackground (config, view, "PSPHOT.INPUT", maskVal)) {
+        return psphotReadoutCleanup (config, readout, recipe, NULL, NULL);
+    }
+    if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT", maskVal)) {
         return psphotReadoutCleanup (config, readout, recipe, NULL, NULL);
     }
