Index: trunk/psphot/src/psphotReadout.c
===================================================================
--- trunk/psphot/src/psphotReadout.c	(revision 10138)
+++ trunk/psphot/src/psphotReadout.c	(revision 10185)
@@ -32,4 +32,6 @@
     // generate a background model (median, smoothed image)
     psphotImageMedian (config, view);
+
+    pmReadout *background = psphotSelectBackground (config, view);
 
     // find the peaks in the image
@@ -111,5 +113,5 @@
 
     // calculate source magnitudes
-    psphotMagnitudes(sources, recipe, psf, config);
+    psphotMagnitudes(sources, recipe, psf, background);
 
     // replace background in residual image
