Index: trunk/psastro/src/psastroChooseRefstars.c
===================================================================
--- trunk/psastro/src/psastroChooseRefstars.c	(revision 35050)
+++ trunk/psastro/src/psastroChooseRefstars.c	(revision 35419)
@@ -107,5 +107,5 @@
 
                     if (ref->Mag < clampMagMin) {
-                        psWarning("Skipping refstar with abusrd magnintude %f ra: %f dec: %f\n",
+                        psWarning("Skipping refstar with abusrd magnitude %f ra: %f dec: %f\n",
                             ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d));
                         goto skip;
@@ -131,12 +131,28 @@
 
 # if (0)
-		// XXX test
-		FILE *outfile = fopen ("refstars.dat", "w");
-		assert (outfile);
-		for (int nn = 0; nn < refstars->n; nn++) {
-			  pmAstromObj *ref = refstars->data[nn];
-			  fprintf (outfile, "%lf %lf\n", ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD);
+		if (1) {
+		  // test output block, not used in normal ops
+		  char filename[64];
+		  snprintf (filename, 64, "refstars.%02d.dat", Nchip);
+		  FILE *outfile = fopen (filename, "w");
+		  assert (outfile);
+		  for (int nn = 0; nn < refstars->n; nn++) {
+		    pmAstromObj *ref = refstars->data[nn];
+		    fprintf (outfile, "%lf %lf\n", ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD);
+		  }
+		  fclose (outfile);
 		}
-		fclose (outfile);
+		if (1) {
+		  // test output block, not used in normal ops
+		  char filename[64];
+		  snprintf (filename, 64, "refstars.%02d.dat", Nchip);
+		  FILE *outfile = fopen (filename, "w");
+		  assert (outfile);
+		  for (int nn = 0; nn < refstars->n; nn++) {
+		    pmAstromObj *ref = refstars->data[nn];
+		    fprintf (outfile, "%lf %lf  %lf %lf  %lf %lf\n", ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, );
+		  }
+		  fclose (outfile);
+		}
 # endif
 
