Index: trunk/psastro/src/psastroChipAstrom.c
===================================================================
--- trunk/psastro/src/psastroChipAstrom.c	(revision 31333)
+++ trunk/psastro/src/psastroChipAstrom.c	(revision 35419)
@@ -75,4 +75,41 @@
                 if (refstars == NULL) { continue; }
 
+# if (0)
+		static int Nchip = 0;
+		if (1) {
+		  // XXX test
+		  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  %lf %lf\n", 
+			     ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD,
+			     ref->TP->x, ref->TP->y, 
+			     ref->FP->x, ref->FP->y, 
+			     ref->chip->x, ref->chip->y);
+		  }
+		  fclose (outfile);
+		}
+		if (1) {
+		  // XXX test
+		  char filename[64];
+		  snprintf (filename, 64, "rawstars.%02d.dat", Nchip);
+		  FILE *outfile = fopen (filename, "w");
+		  assert (outfile);
+		  for (int nn = 0; nn < gridrawstars->n; nn++) {
+		    pmAstromObj *ref = gridrawstars->data[nn];
+		    fprintf (outfile, "%lf %lf  %lf %lf  %lf %lf  %lf %lf\n", 
+			     ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD,
+			     ref->TP->x, ref->TP->y, 
+			     ref->FP->x, ref->FP->y, 
+			     ref->chip->x, ref->chip->y);
+		  }
+		  fclose (outfile);
+		  Nchip ++;
+		}
+# endif
+
                 // the absolute minimum number of stars is 4 (for order = 1)
                 if ((rawstars->n < 4) || (refstars->n < 4)) {
