Index: branches/pap/ppStack/src/ppStackMatch.c
===================================================================
--- branches/pap/ppStack/src/ppStackMatch.c	(revision 26300)
+++ branches/pap/ppStack/src/ppStackMatch.c	(revision 26305)
@@ -18,5 +18,5 @@
 #define COVAR_FRAC 0.01                 // Truncation fraction for covariance matrix
 
-//#define TESTING                         // Enable debugging output
+#define TESTING                         // Enable debugging output
 
 #ifdef TESTING
@@ -64,4 +64,30 @@
     return;
 }
+
+#ifdef TESTING
+static void dumpSources(const char *root, // Root name for source file
+                        psArray *sources// Sources to dump
+    )
+{
+    static int number = 0;              // Index of sources
+    psString name = NULL;               // Output name
+    psStringAppend(&name, "%s_%d.sources", root, number);
+    FILE file = fopen(name, "w");       // File to write
+    psFree(name);
+    for (int i = 0; i < sources->n; i++) {
+        pmSource *source = sources->data[i]; // Source of interest
+        if (!source) {
+            continue;
+        }
+        float x, y;                     // Coordinates of source
+        coordsFromSource(&x, &y, source);
+        float mag = source->psfMag;     // Magnitude of source
+        fprintf(file, "%f %f %f\n", x, y, mag);
+    }
+    fclose(file);
+    return;
+}
+#endif
+
 
 static psArray *stackSourcesFilter(psArray *sources, // Source list to filter
@@ -343,5 +369,7 @@
             psArray *stampSources = stackSourcesFilter(options->sourceLists->data[index],
                                                        footprint); // Filtered list of sources
-
+#ifdef TESTING
+            dumpSources("fakeSources", stampSources);
+#endif
             if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows,
                                           stampSources, SOURCE_MASK, NULL, NULL, options->psf,
@@ -356,8 +384,11 @@
             fake->mask = psImageCopy(NULL, readout->mask, PS_TYPE_IMAGE_MASK);
 
+#if 0
             // Add the background into the target image
+            // XXX Is this desirable?  There should be zero background on the input!
             psImage *bgImage = stackBackgroundModel(readout, config); // Image of background
             psBinaryOp(fake->image, fake->image, "+", bgImage);
             psFree(bgImage);
+#endif
 
 #ifdef TESTING
