Index: /branches/eam_branch_20071023/psastro/src/psastroMosaicGradients.c
===================================================================
--- /branches/eam_branch_20071023/psastro/src/psastroMosaicGradients.c	(revision 15519)
+++ /branches/eam_branch_20071023/psastro/src/psastroMosaicGradients.c	(revision 15520)
@@ -1,3 +1,4 @@
 # include "psastroInternal.h"
+static int nPass = 0;
 
 bool psastroMosaicGradients (pmFPA *fpa, psMetadata *recipe) {
@@ -50,4 +51,12 @@
     }
 
+    // if desired, dump the gradients to a file
+    if (psTraceGetLevel("psastro.dump") > 0) { 
+	char name[80];
+	sprintf (name, "gradients.%d.dat", nPass); 
+	psastroDumpGradients (gradients, name); 
+	nPass ++;
+    }
+
     // allocate mosaic-level polynomial transformation and set masks needed by DVO
     int order = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.ORDER");
