Index: /branches/czw_branch/20160809/psphot/src/psphotSourceStats.c
===================================================================
--- /branches/czw_branch/20160809/psphot/src/psphotSourceStats.c	(revision 39913)
+++ /branches/czw_branch/20160809/psphot/src/psphotSourceStats.c	(revision 39914)
@@ -560,4 +560,18 @@
         }
 
+	if (psTraceGetLevel("psphot.moments.save")) {
+	  char name[64];
+	  sprintf (name, "moments.v%d.dat", i);
+	  FILE *fout = fopen (name, "w");
+	  for (int j = 0; j < sources->n; j++) {
+            pmSource *source = sources->data[j];
+            psAssert (source->moments, "force moments to exist");
+            source->moments->nPixels = 0;
+            status = pmSourceMoments (source, 20, sigma[i], 0.0, 0.0, maskVal);
+	    fprintf (fout, "%f %f | %f %f %f | %f\n", source->moments->Mx, source->moments->My, source->moments->Mxx, source->moments->Mxy, source->moments->Myy, source->moments->Sum);
+	  }
+	  fclose (fout);
+	}
+
         // choose a grid scale that is a fixed fraction of the psf sigma^2
         float PSF_CLUMP_GRID_SCALE = 0.1*PS_SQR(sigma[i]);
