Index: /branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/bcatalog.c
===================================================================
--- /branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/bcatalog.c	(revision 36797)
+++ /branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/bcatalog.c	(revision 36798)
@@ -6,4 +6,5 @@
 static int Nskip2 = 0;
 
+FILE *fbogus = NULL;
 static int NskipBogus = 0;
 
@@ -57,4 +58,13 @@
     ID_STAR_USE_PAR   |
     ID_STAR_NO_ASTROM ; 
+
+  if (ExcludeBogus && (fbogus == NULL)) {
+    char name[1024];
+    snprintf (name, 1024, "%s/bogus.%02d.dat", CATDIR, HOST_ID);
+    fbogus = fopen (name, "w");
+    if (!fbogus) {
+      fprintf (stderr, "trouble opening bogus detection dump : %s\n", name);
+    }
+  }
 
   /* exclude stars not in range or with too few measurements */
@@ -116,5 +126,8 @@
 	      NskipBogus ++;
 	      if (TRUE || VERBOSE2) {
-		  fprintf (stderr, "exclude bogus: %10.6f %10.6f : %10.6f %10.6f : %6.2f %6.2f : %6.2f\n", catalog[0].average[i].R, catalog[0].average[i].D, Ri, Di, Xi, Yi, radius);
+		FILE *foutput = fbogus ? fbogus : stderr;
+		char *date = ohana_sec_to_date(catalog[0].measure[offset].t);
+		fprintf (foutput, "exclude bogus: %10.6f %10.6f : %10.6f %10.6f : %6.2f %6.2f : %6.2f : %5d %s\n", catalog[0].average[i].R, catalog[0].average[i].D, Ri, Di, Xi, Yi, radius, catalog[0].measure[offset].photcode, date);
+		free (date);
 	      }
 	      continue;
@@ -192,7 +205,10 @@
 
 void bcatalog_show_skips () {
+  if (ExcludeBogus) {
+    if (fbogus) fclose (fbogus);
     fprintf (stderr, "NskipBogus: %d\n", NskipBogus);
     // fprintf (stderr, "Nskip: %d, %d\n", Nskip1, Nskip2);
     // fprintf (stderr, "Nkeep: %d, %d\n", Nkeep1, Nkeep2);
+  }
 }
 
