Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37685)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37686)
@@ -503,4 +503,5 @@
 int checkStarMap(int N);
 int createStarMap (Catalog *catalog, int Ncatalog);
+int printStarMap(int N, char *filename);
 
 int GetScatterRawRef(float *dLsig, float *dMsig, float *dRsig, int *nKeep, StarData *raw, StarData *ref, int Nstars, float SigmaLimit);
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/StarMaps.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/StarMaps.c	(revision 37685)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/StarMaps.c	(revision 37686)
@@ -176,2 +176,20 @@
 }
 
+int printStarMap(int N, char *filename) {
+
+  off_t i, Nimages;
+  Image *images = getimages(&Nimages, NULL);
+  double L, M;
+
+  FILE *f = fopen (filename, "w");
+
+  for (i = 0; i < starmap[N].Npoints; i++) {
+    // set the transformed coordinates
+    XY_to_LM (&L, &M, starmap[N].points[i].X, starmap[N].points[i].Y, &images[N].coords);
+
+    fprintf (f, "%d %7.2f %f : %7.2f %7.2f : %7.2f %7.2f : %7.2f %7.2f\n", (int) i, starmap[N].points[i].X, starmap[N].points[i].Y, starmap[N].points[i].L, starmap[N].points[i].M, L, M, starmap[N].points[i].L - L, starmap[N].points[i].M - M);
+  }
+  fclose (f);
+  return (TRUE);
+}
+
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c	(revision 37685)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c	(revision 37686)
@@ -107,16 +107,18 @@
       if (VERBOSE) fprintf (stderr, "reject fit for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT" of %d\n", image[i].name,  i,  Nraw, image[i].nstar);
 
-      // restore status quo ante (replace truMap with tmpMap)
-      RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
-      image[i].dXpixSys = dXpixSys;
-      image[i].dYpixSys = dYpixSys; 
-      image[i].nFitAstrom = nFitAstr;
-
-      saveCenter (image, &Ro[i], &Do[i], i);
-      mode[i] = 1;
-      NoldFit ++;
-      free (raw);
-      free (ref);
-      continue;
+      if (1) {
+	// restore status quo ante (replace truMap with tmpMap)
+	RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
+	image[i].dXpixSys = dXpixSys;
+	image[i].dYpixSys = dYpixSys; 
+	image[i].nFitAstrom = nFitAstr;
+
+	saveCenter (image, &Ro[i], &Do[i], i);
+	mode[i] = 1;
+	NoldFit ++;
+	free (raw);
+	free (ref);
+	continue;
+      }
     }
 
@@ -124,17 +126,19 @@
       if (VERBOSE) fprintf (stderr, "fit diverges too much for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT"\n", image[i].name,  i,  Nraw);
 
-      // restore status quo ante (replace truMap with tmpMap)
-      RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
-      image[i].dXpixSys = dXpixSys;
-      image[i].dYpixSys = dYpixSys; 
-      image[i].nFitAstrom = nFitAstr;
-
-      saveCenter (image, &Ro[i], &Do[i], i);
-      mode[i] = 2;
-      image[i].flags |= ID_IMAGE_ASTROM_POOR;
-      NoldFit ++;
-      free (raw);
-      free (ref);
-      continue;
+      if (1) {
+	// restore status quo ante (replace truMap with tmpMap)
+	RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
+	image[i].dXpixSys = dXpixSys;
+	image[i].dYpixSys = dYpixSys; 
+	image[i].nFitAstrom = nFitAstr;
+
+	saveCenter (image, &Ro[i], &Do[i], i);
+	mode[i] = 2;
+	image[i].flags |= ID_IMAGE_ASTROM_POOR;
+	NoldFit ++;
+	free (raw);
+	free (ref);
+	continue;
+      }
     } 
 
@@ -538,5 +542,7 @@
 
   // copy the coords structure data first, then fix the offsetMap pointers
+  // this modifies tgt.coords, but we need to keep the original pointer
   CopyCoords (tgt, src);
+  tgt->offsetMap = truMap;
 
   // we want to keep the old solution, which is (maybe) a pointer to a stand-alone
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/bcatalog.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/bcatalog.c	(revision 37685)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/bcatalog.c	(revision 37686)
@@ -199,4 +199,9 @@
       }
     }
+    // we have filtered this object.  do not keep it if we now have too few meas
+    if (Nm <= SRC_MEAS_TOOFEW) {
+      Nmeasure -= Nm;
+      continue;
+    }
     subcatalog[0].average[Naverage].Nmeasure = Nm;
     Naverage ++;
