Index: trunk/psphot/src/psphotReadout.c
===================================================================
--- trunk/psphot/src/psphotReadout.c	(revision 18833)
+++ trunk/psphot/src/psphotReadout.c	(revision 18834)
@@ -61,4 +61,11 @@
         psLogMsg ("psphot", 3, "unable to find detections in this image");
         return psphotReadoutCleanup (config, readout, recipe, detections, psf, NULL);
+    }
+ 
+    // XXX test write out the footprint image
+    if (0) {
+	psImage *footprintImage = pmSetFootprintArrayIDs (detections->footprints, true);
+	psphotSaveImage (NULL, footprintImage, "footprints.1.fits");
+	psFree (footprintImage);
     }
 
@@ -138,5 +145,5 @@
 
     // identify CRs and extended sources
-    psphotSourceSize (readout, sources, recipe, 0);
+    psphotSourceSize (config, readout, sources, recipe, 0);
     if (!strcasecmp (breakPt, "ENSEMBLE")) {
         goto finish;
@@ -168,4 +175,11 @@
     // find fainter sources (pass 2)
     detections = psphotFindDetections (detections, readout, recipe);
+
+    // XXX test write out the footprint image
+    if (0) {
+	psImage *footprintImage = pmSetFootprintArrayIDs (detections->footprints, true);
+	psphotSaveImage (NULL, footprintImage, "footprints.2.fits");
+	psFree (footprintImage);
+    }
 
     // remove noise for subtracted objects (ie, return to normal noise level)
@@ -217,6 +231,10 @@
 
     // measure source size for the remaining sources
-    psphotSourceSize (readout, sources, recipe, 0);
-
+    psphotSourceSize (config, readout, sources, recipe, 0);
+
+    if (0) {
+	psphotSaveImage (NULL, readout->mask, "mask.fits");
+    }
+	
     psphotExtendedSourceAnalysis (readout, sources, recipe);
 
