Index: trunk/psphot/src/psphotReadout.c
===================================================================
--- trunk/psphot/src/psphotReadout.c	(revision 12665)
+++ trunk/psphot/src/psphotReadout.c	(revision 12689)
@@ -61,4 +61,5 @@
 	return psphotReadoutCleanup (config, readout, recipe, NULL, NULL);
     }
+    pmPeaksWriteText (peaks, "oldpeaks.dat");
 
     // construct sources and measure basic stats
@@ -70,4 +71,6 @@
         return psphotReadoutCleanup(config, readout, recipe, NULL, sources);
     }
+
+    psphotDeblendSatstars (sources, recipe);
 
     // mark blended peaks PS_SOURCE_BLEND
@@ -102,24 +105,24 @@
     psphotGuessModels (readout, sources, recipe, psf);
 
+    psphotSaveImage (NULL, readout->image,  "image.v0.fits");
+
     // linear PSF fit to peaks
     psphotEnsemblePSF (readout, sources, recipe, psf, FALSE);
+    psphotSaveImage (NULL, readout->image,  "image.v1.fits");
     if (!strcasecmp (breakPt, "ENSEMBLE")) {
         goto finish;
     }
 
-    // plot positive + negative sources (replace, then remove)
-    psphotSourcePlots (readout, sources, recipe);
-
     // non-linear PSF and EXT fit to brighter sources
     psphotBlendFit (readout, sources, recipe, psf);
+    psphotSaveImage (NULL, readout->image,  "image.v2.fits");
 
     // replace all sources
     psphotReplaceAll (sources);
-
-    // plot positive sources 
-    // psphotSourcePlots (readout, sources, recipe);
+    psphotSaveImage (NULL, readout->image,  "image.v3.fits");
 
     // linear PSF fit to remaining peaks
     psphotEnsemblePSF (readout, sources, recipe, psf, TRUE);
+    psphotSaveImage (NULL, readout->image,  "image.v4.fits");
     if (!strcasecmp (breakPt, "PASS1")) {
         goto finish;
@@ -137,4 +140,5 @@
     // find the peaks in the image
     psArray *newPeaks = psphotFindPeaks (readout, recipe, 2);
+    pmPeaksWriteText (newPeaks, "newpeaks.dat");
 
     // remove noise for subtracted objects
@@ -153,4 +157,5 @@
     // replace all sources
     psphotReplaceAll (sources);
+    psphotSaveImage (NULL, readout->image,  "image.v5.fits");
 
     // merge the newly selected peaks into the existing list
@@ -160,6 +165,10 @@
     // linear PSF fit to remaining peaks
     psphotEnsemblePSF (readout, sources, recipe, psf, TRUE);
+    psphotSaveImage (NULL, readout->image,  "image.v6.fits");
 
 finish:
+
+    // plot positive sources 
+    psphotSourcePlots (readout, sources, recipe);
 
     // measure aperture photometry corrections
