Index: trunk/psastro/src/psastroDemoDump.c
===================================================================
--- trunk/psastro/src/psastroDemoDump.c	(revision 11467)
+++ trunk/psastro/src/psastroDemoDump.c	(revision 12492)
@@ -1,9 +1,38 @@
 # include "psastro.h"
+
+// this function is used for test purposes (-trace psastro.dump.psastroAstromGuess 1)
+bool psastroDumpStars (psArray *stars, char *filename) {
+
+    FILE *f = fopen (filename, "w");
+
+    for (int i = 0; i < stars->n; i++) {
+	pmAstromObj *obj = stars->data[i];
+
+	// write out the upward projections
+	fprintf (f, "%d  %f %f  %f  %f %f  %f %f  %f %f\n", i,
+		 obj->sky->r, obj->sky->d, obj->Mag, 
+		 obj->TP->x, obj->TP->y, 
+		 obj->FP->x, obj->FP->y, 
+		 obj->chip->x, obj->chip->y);
+    }
+    fclose (f);
+    return true;
+}
 
 // this function is used for test purposes (-trace psastro.dump.psastroAstromGuess 1)
 bool psastroDumpRawstars (psArray *rawstars, pmFPA *fpa, pmChip *chip) {
 
-    FILE *f1 = fopen ("rawstars.dat", "w");
-    FILE *f2 = fopen ("rawstars.down.dat", "w");
+    char *filename = NULL;
+    char *chipname = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");
+
+    psStringAppend (&filename, "rawstars.up.%s.dat", chipname);
+    FILE *f1 = fopen (filename, "w");
+    psFree (filename);
+    filename = NULL;
+
+    psStringAppend (&filename, "rawstars.dn.%s.dat", chipname);
+    FILE *f2 = fopen (filename, "w");
+    psFree (filename);
+    filename = NULL;
 
     for (int i = 0; i < rawstars->n; i++) {
