Index: trunk/Ohana/src/relastro/Makefile
===================================================================
--- trunk/Ohana/src/relastro/Makefile	(revision 40414)
+++ trunk/Ohana/src/relastro/Makefile	(revision 40415)
@@ -52,5 +52,4 @@
 $(SRC)/UpdateChips.$(ARCH).o         \
 $(SRC)/UpdateStacks.$(ARCH).o         \
-$(SRC)/UpdateStacksWithFit.$(ARCH).o \
 $(SRC)/UpdateMosaic.$(ARCH).o        \
 $(SRC)/UpdateObjects.$(ARCH).o       \
@@ -110,5 +109,6 @@
 $(SRC)/relastroVisual.$(ARCH).o
 
-#$(SRC)/write_coords.$(ARCH).o        \
+#$(SRC)/write_coords.$(ARCH).o        
+#$(SRC)/UpdateStacksWithFit.$(ARCH).o 
 
 $(RELASTRO): $(INC)/relastro.h
Index: trunk/Ohana/src/relastro/include/relastro.h
===================================================================
--- trunk/Ohana/src/relastro/include/relastro.h	(revision 40414)
+++ trunk/Ohana/src/relastro/include/relastro.h	(revision 40415)
@@ -368,4 +368,5 @@
 
 int    FIT_STACKS;
+int    IMSTATS_ONLY;
 int    REPAIR_STACKS;
 int    USE_IMAGE_COORDS_FOR_REPAIR;
Index: trunk/Ohana/src/relastro/src/UpdateChips.c
===================================================================
--- trunk/Ohana/src/relastro/src/UpdateChips.c	(revision 40414)
+++ trunk/Ohana/src/relastro/src/UpdateChips.c	(revision 40415)
@@ -116,4 +116,19 @@
     // note that Nraw & Nref must be equal: if not, we made a programming error in one of these two functions.
     assert (Nraw == Nref);
+
+    if (IMSTATS_ONLY) {
+      int Nstat;
+      float dLsig, dMsig, dRsig;
+      GetScatterRawRef(&dLsig, &dMsig, &dRsig, &Nstat, raw, ref, Nraw, IMFIT_SYS_SIGMA_LIM);
+
+      // XXX: I need to convert dLsig, dMsig from degrees to pixels
+      dLsig *= 3600.0;
+      dMsig *= 3600.0;
+
+      image[i].dXpixSys = dLsig;
+      image[i].dYpixSys = dMsig;
+      image[i].nFitAstrom = Nstat;
+      continue;
+    }
 
     // save these in case of failure
Index: trunk/Ohana/src/relastro/src/UpdateStacks.c
===================================================================
--- trunk/Ohana/src/relastro/src/UpdateStacks.c	(revision 40414)
+++ trunk/Ohana/src/relastro/src/UpdateStacks.c	(revision 40415)
@@ -11,4 +11,6 @@
   off_t Nskip = 0;
   off_t Nmeas = 0;
+  off_t NnewFit = 0;
+  off_t NoldFit = 0;
 
   // measure the scatter for each stack
@@ -43,15 +45,54 @@
     assert (Nraw == Nref);
 
-    int Nstat;
-    float dLsig, dMsig, dRsig;
-    GetScatterRawRef(&dLsig, &dMsig, &dRsig, &Nstat, raw, ref, Nraw, IMFIT_SYS_SIGMA_LIM);
+    // the natural default for stacks is to NOT re-fit
+    if (FIT_STACKS == FALSE) {
+      int Nstat;
+      float dLsig, dMsig, dRsig;
+      GetScatterRawRef(&dLsig, &dMsig, &dRsig, &Nstat, raw, ref, Nraw, IMFIT_SYS_SIGMA_LIM);
 
-    // XXX: I need to convert dLsig, dMsig from degrees to pixels
-    dLsig *= 3600.0;
-    dMsig *= 3600.0;
+      // XXX: I need to convert dLsig, dMsig from degrees to pixels
+      dLsig *= 3600.0;
+      dMsig *= 3600.0;
 
-    image[i].dXpixSys = dLsig;
-    image[i].dYpixSys = dMsig;
-    image[i].nFitAstrom = Nstat;
+      image[i].dXpixSys = dLsig;
+      image[i].dYpixSys = dMsig;
+      image[i].nFitAstrom = Nstat;
+      continue;
+    }
+
+    // save these in case of failure
+    Coords oldCoords;
+    SaveCoords (&oldCoords, &image[i].coords);
+
+    float dXpixSys = image[i].dXpixSys;
+    float dYpixSys = image[i].dYpixSys;
+    int   nFitAstr = image[i].nFitAstrom;
+
+    // FitChip does iterative, clipped fitting
+    if (!FitChip (raw, ref, Nraw, &image[i])) {
+      if (VERBOSE) fprintf (stderr, "reject fit for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT", Nused %d of %d\n", image[i].name, i, Nraw, image[i].nFitAstrom, 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;
+
+      NoldFit ++;
+      free (raw);
+      free (ref);
+      continue;
+    }
+
+    AstromOffsetMapFree (oldCoords.offsetMap);
+
+    // Apply the modified coords back to the measure.R,D.  Note that raw.R,D, ref.L,M, etc
+    // are all automatically updated in this block because they are re-generated from
+    // image.coords on each pass.
+    setImageRaw (catalog, Ncatalog, i, raw, Nraw, MODE_MOSAIC);
+
+    NnewFit ++;
+    free (raw);
+    free (ref);
   }
 
Index: trunk/Ohana/src/relastro/src/args.c
===================================================================
--- trunk/Ohana/src/relastro/src/args.c	(revision 40414)
+++ trunk/Ohana/src/relastro/src/args.c	(revision 40415)
@@ -91,4 +91,11 @@
     remove_argument (N, &argc, argv);
     CATCH_UP = TRUE;
+  }
+
+  // only update the fit statistics (systematic floor)
+  IMSTATS_ONLY = FALSE;
+  if ((N = get_argument (argc, argv, "-imstats-only"))) {
+    remove_argument (N, &argc, argv);
+    IMSTATS_ONLY = FALSE;
   }
 
@@ -896,4 +903,11 @@
     remove_argument (N, &argc, argv);
     CHECK_MEASURE_TO_IMAGE = TRUE;
+  }
+
+  // only update the fit statistics (systematic floor)
+  IMSTATS_ONLY = FALSE;
+  if ((N = get_argument (argc, argv, "-imstats-only"))) {
+    remove_argument (N, &argc, argv);
+    IMSTATS_ONLY = FALSE;
   }
 
Index: trunk/Ohana/src/relastro/src/launch_region_hosts.c
===================================================================
--- trunk/Ohana/src/relastro/src/launch_region_hosts.c	(revision 40414)
+++ trunk/Ohana/src/relastro/src/launch_region_hosts.c	(revision 40415)
@@ -155,4 +155,5 @@
 
     if (FIT_STACKS)          strextend (&command, "-fit-stacks");
+    if (IMSTATS_ONLY)        strextend (&command, "-imstats-only");
 
     strextend (&command, "-nloop %d", NLOOP);
Index: trunk/Ohana/src/relastro/src/relastro_images.c
===================================================================
--- trunk/Ohana/src/relastro/src/relastro_images.c	(revision 40414)
+++ trunk/Ohana/src/relastro/src/relastro_images.c	(revision 40415)
@@ -87,11 +87,6 @@
       }
 
-      if (FIT_STACKS) {
-	// model astrometry for stacks
-	UpdateStacksWithFit (catalog, Ncatalog);
-      } else {
-	// measure scatter for stacks
-	UpdateStacks (catalog, Ncatalog);
-      }
+      // measure scatter for stacks
+      UpdateStacks (catalog, Ncatalog);
       MARKTIME("UpdateStacks: %f sec\n", dtime);
 
@@ -108,11 +103,5 @@
     case SET_STACKS:
       // we just want to fit the selected stacks to the mean positions
-      if (FIT_STACKS) {
-	// model astrometry for stacks
-	UpdateStacksWithFit (catalog, Ncatalog);
-      } else {
-	// measure scatter for stacks
-	UpdateStacks (catalog, Ncatalog);
-      }
+      UpdateStacks (catalog, Ncatalog);
       MARKTIME("update stacks : %f sec\n", dtime);
       break;
Index: trunk/Ohana/src/relastro/src/relastro_parallel_images.c
===================================================================
--- trunk/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 40414)
+++ trunk/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 40415)
@@ -150,11 +150,6 @@
       }
 
-      if (FIT_STACKS) {
-	// model astrometry for stacks
-	UpdateStacksWithFit (catalog, Ncatalog);
-      } else {
-	// measure scatter for stacks
-	UpdateStacks (catalog, Ncatalog);
-      }
+      // measure astrometry or scatter [default] for stacks
+      UpdateStacks (catalog, Ncatalog);
       LOGRTIME("UpdateStacks on %s, host %d: %f sec\n", myHostName, REGION_HOST_ID, dtime);
 
@@ -167,11 +162,5 @@
       share_mean_pos (catalog, Ncatalog, regionHosts, 0);
       slurp_mean_pos (catalog, Ncatalog, regionHosts, 0);
-      if (FIT_STACKS) {
-	// model astrometry for stacks
-	UpdateStacksWithFit (catalog, Ncatalog);
-      } else {
-	// measure scatter for stacks
-	UpdateStacks (catalog, Ncatalog);
-      }
+      UpdateStacks (catalog, Ncatalog);
       share_image_pos (regionHosts, 0);
       slurp_image_pos (catalog, Ncatalog, regionHosts, 0);
