Index: trunk/psastro/src/psastroAstromGuess.c
===================================================================
--- trunk/psastro/src/psastroAstromGuess.c	(revision 10861)
+++ trunk/psastro/src/psastroAstromGuess.c	(revision 10864)
@@ -75,12 +75,4 @@
                 if (rawstars == NULL) { continue; }
 
-		if (psTraceGetLevel("psastro.dump.rawstars") > 2) {
-		  dump_stars (rawstars, fpa, chip);
-		}
-
-		if (psTraceGetLevel("psastro.plot.rawstars") > 2) {
-		  plot_stars (rawstars, fpa, chip);
-		}
-
                 for (int i = 0; i < rawstars->n; i++) {
                     pmAstromObj *raw = rawstars->data[i];
@@ -100,4 +92,13 @@
                     DECmax = PS_MAX (raw->sky->d, DECmax);
                 }
+
+		// dump or plot the resulting projected positions
+		if (psTraceGetLevel("psastro.dump") > 0) {
+		    psastroDumpRawstars (rawstars, fpa, chip);
+		}
+
+		if (psTraceGetLevel("psastro.plot") > 0) {
+		    psastroPlotRawstars (rawstars, fpa, chip);
+		}
             }
         }
@@ -125,42 +126,2 @@
    sky (ra, dec)
 */
-
-dump_stars (psArray *rawstars, pmFPA *fpa, pmChip *chip) {
-
-  FILE *f1 = fopen ("rawstars.up.dat", "w");
-  FILE *f2 = fopen ("rawstars.dn.dat", "w");
-  for (int i = 0; i < rawstars->n; i++) {
-    pmAstromObj *raw = rawstars->data[i];
-
-    psPlaneTransformApply (raw->FP, chip->toFPA, raw->chip);
-    psPlaneTransformApply (raw->TP, fpa->toTPA, raw->FP);
-    psDeproject (raw->sky, raw->TP, fpa->toSky);
-
-    fprintf (f1, "%d  %f %f  %f %f  %f %f  %f %f\n", i,
-	     raw->sky->r, raw->sky->d, 
-	     raw->TP->x, raw->TP->y, 
-	     raw->FP->x, raw->FP->y, 
-	     raw->chip->x, raw->chip->y);
-		
-    psPlane *fp = psPlaneAlloc();
-    psPlane *tp = psPlaneAlloc();
-    psPlane *ch = psPlaneAlloc();
-			
-    psProject (tp, raw->sky, fpa->toSky);
-    psPlaneTransformApply (fp, fpa->fromTPA, tp);
-    psPlaneTransformApply (ch, chip->fromFPA, fp);
-			
-    fprintf (f2, "%d  %f %f  %f %f  %f %f  %f %f\n", i,
-	     raw->sky->r, raw->sky->d, 
-	     tp->x, tp->y, 
-	     fp->x, fp->y, 
-	     ch->x, ch->y);
-		
-    psFree (fp);
-    psFree (tp);
-    psFree (ch);
-  }
-
-  fclose (f1);
-  fclose (f2);
-}
