Index: trunk/psastro/src/psastroMosaicAstrom.c
===================================================================
--- trunk/psastro/src/psastroMosaicAstrom.c	(revision 19517)
+++ trunk/psastro/src/psastroMosaicAstrom.c	(revision 19518)
@@ -104,5 +104,5 @@
     }
 
-    if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0)) { 
+    if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1)) { 
 	snprintf (filename, 256, "%s.0.dat", rootname);
 	psastroDumpMatches (fpa, filename); 
@@ -117,5 +117,5 @@
     }
 
-    if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0)) { 
+    if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1)) { 
 	snprintf (filename, 256, "%s.1.dat", rootname);
 	psastroDumpMatches (fpa, filename); 
@@ -125,5 +125,5 @@
     // apply the new distortion terms up and down
     // refit the per-chip terms with linear fits only
-    if (!psastroMosaicDistortion (fpa, recipe)) {
+    if (!psastroMosaicDistortion (fpa, recipe, pass)) {
 	psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure mosaic gradients (pass %d)", pass);
 	return false;
@@ -131,5 +131,5 @@
 
     snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 2);
-    if (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0) { psastroDumpMatches (fpa, filename); }
+    if (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1) { psastroDumpMatches (fpa, filename); }
     
     // measure the astrometry for the chips under the distortion term
@@ -139,6 +139,12 @@
     }
 
-    snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 3);
-    if (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0) { psastroDumpMatches (fpa, filename); }
+    int traceLevel = psTraceGetLevel("psastro.dump.psastroMosaicAstrom");
+    if (traceLevel > 1) {
+	snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 3);
+	psastroDumpMatches (fpa, filename); 
+    } else {
+	snprintf (filename, 256, "%s.dat", rootname);
+	psastroDumpMatches (fpa, filename); 
+    }
 
     return true;
