Index: /branches/eam_branches/ipp-20120627/psphot/src/psphotReadoutMinimal.c
===================================================================
--- /branches/eam_branches/ipp-20120627/psphot/src/psphotReadoutMinimal.c	(revision 34178)
+++ /branches/eam_branches/ipp-20120627/psphot/src/psphotReadoutMinimal.c	(revision 34179)
@@ -25,4 +25,15 @@
     // Generate the mask and weight images, including the user-defined analysis region of interest
     psphotSetMaskAndVariance (config, view, filerule);
+
+    // only subtract background if needed?
+    if (1) {
+      // generate a background model (median, smoothed image)
+      if (!psphotModelBackground (config, view, filerule)) {
+        return psphotReadoutCleanup (config, view, filerule);
+      }
+      if (!psphotSubtractBackground (config, view, filerule)) {
+        return psphotReadoutCleanup (config, view, filerule);
+      }
+    }
 
     // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are saved on readout->analysis
Index: /branches/eam_branches/ipp-20120627/psphot/src/psphotSourceSize.c
===================================================================
--- /branches/eam_branches/ipp-20120627/psphot/src/psphotSourceSize.c	(revision 34178)
+++ /branches/eam_branches/ipp-20120627/psphot/src/psphotSourceSize.c	(revision 34179)
@@ -456,4 +456,14 @@
     psImageMaskType maskVal = options->maskVal | options->markVal;
 
+    // in the ppSub context, do we get sensible values for ApResid?
+    float ApResidPSF = options->ApResid;
+    if (!isfinite(ApResidPSF)) {
+      ApResidPSF = 0.0;
+    }
+    float ApSysErrPSF = options->ApSysErr;
+    if (!isfinite(ApSysErrPSF)) {
+      ApSysErrPSF = 0.0;
+    }
+
     for (psS32 i = 0 ; i < sources->n ; i++) {
 
@@ -521,9 +531,7 @@
 	}
 
-	// XXX in the ppSub context, do we get sensible values for ApResid?
-
         // set nSigmaMAG to include both systematic and poisson error terms.  we include a hard
 	// floor on the Ap Sys Err (to be a bit generous).  XXX put the floor in the recipe...
-        float nSigmaMAG = (dMag - options->ApResid) / hypot(source->psfMagErr, hypot(options->ApSysErr, 0.02));
+        float nSigmaMAG = (dMag - ApResidPSF) / hypot(source->psfMagErr, hypot(ApSysErrPSF, 0.02));
         source->extNsigma = nSigmaMAG;
 
