Index: /trunk/psphot/src/psphot.c
===================================================================
--- /trunk/psphot/src/psphot.c	(revision 5627)
+++ /trunk/psphot/src/psphot.c	(revision 5628)
@@ -10,4 +10,5 @@
     psStats     *sky     = NULL;
     pmPSFClump   psfClump;
+    bool         status;
 
     config = psphotArguments (&argc, argv);
@@ -17,4 +18,8 @@
     // we have memory leaks here -- may be from psMetadata
     imdata = psphotSetup (config);
+    char *breakPt = psMetadataLookupPtr (&status, config, "BREAK_POINT");
+    if (!status) {
+      breakPt = psStringCopy ("NONE");
+    }
 
     // measure image stats for initial guess 
@@ -23,26 +28,17 @@
     // find the peaks in the image
     peaks = pmPeaksSigmaLimit (imdata, config, sky);
+    if (!strcasecmp (breakPt, "PEAKS")) exit (0);
 
     // construct sources and measure basic stats
     sources = psphotSourceStats (imdata, config, peaks);
+    if (!strcasecmp (breakPt, "STATS")) exit (0);
 
     // classify sources based on moments, brightness
     // XXX - this has 1 leak
     psfClump = pmSourcePSFClump (sources, config);
-    // psLogMsg ("psphot", 4, "clump  X,  Y: %f, %f\n", psfClump.X, psfClump.Y);
-    // psLogMsg ("psphot", 4, "clump DX, DY: %f, %f\n", psfClump.dX, psfClump.dY);
 
     // group into STAR, COSMIC, GALAXY, SATURATED
     pmSourceRoughClass (sources, config, psfClump);
-
-    // optional dump of all rough source data
-    { 
-      bool status;
-      char *output = psMetadataLookupPtr (&status, config, "MOMENTS_OUTPUT_FILE");
-      if (status && (output != NULL) && (output[0])) {
-	pmMomentsWriteText (sources, output);
-	psFree (output);
-      }
-    }
+    if (!strcasecmp (breakPt, "CLASS")) exit (0);
 
     // source analysis is done in S/N order (brightest first)
@@ -51,10 +47,13 @@
     // use bright stellar objects to measure PSF
     psf = psphotChoosePSF (config, sources, sky);
+    if (!strcasecmp (breakPt, "PSFFIT")) exit (0);
 
     // test PSF on all except SATURATE and DEFECT (artifacts)
     psphotApplyPSF (imdata, config, sources, psf, sky);
+    if (!strcasecmp (breakPt, "PSFSUB")) exit (0);
 
     // fit extended objects with galaxy models
     psphotFitGalaxies (imdata, config, sources, sky);
+    if (!strcasecmp (breakPt, "GALSUB")) exit (0);
 
     // write out data in appropriate format
Index: /trunk/psphot/src/psphotOutput.c
===================================================================
--- /trunk/psphot/src/psphotOutput.c	(revision 5627)
+++ /trunk/psphot/src/psphotOutput.c	(revision 5628)
@@ -364,32 +364,4 @@
 	fprintf (f, "%5d %5d  %7.1f\n", 
 		 peak->x, peak->y, peak->counts); 
-    }
-    fclose (f);
-    return true;
-}
-
-// write the moments to an output file 
-bool pmMomentsWriteText (psArray *sources, char *filename) {
-
-    int i;
-    FILE *f;
-    pmSource *source;
-	
-    f = fopen (filename, "w");
-    if (f == NULL) {
-	psLogMsg ("pmMomentsWriteText", 3, "can't open output file for moments%s\n", filename);
-	return false;
-    }
-
-    for (i = 0; i < sources->n; i++) {
-	source = (pmSource *) sources->data[i];
-	if (source->moments == NULL) continue;
-	fprintf (f, "%5d %5d  %7.1f  %7.1f %7.1f  %6.3f %6.3f  %8.1f %7.1f %7.1f %7.1f  %4d %2d\n", 
-		 source->peak->x, source->peak->y, source->peak->counts, 
-		 source->moments->x, source->moments->y, 
-		 source->moments->Sx, source->moments->Sy, 
-		 source->moments->Sum, source->moments->Peak, 
-		 source->moments->Sky, source->moments->SN, 
-		 source->moments->nPixels, source->type); 
     }
     fclose (f);
