Index: /trunk/Ohana/src/relastro/src/UpdateChips.c
===================================================================
--- /trunk/Ohana/src/relastro/src/UpdateChips.c	(revision 17150)
+++ /trunk/Ohana/src/relastro/src/UpdateChips.c	(revision 17151)
@@ -4,5 +4,5 @@
 
   /* we can measure new image parameters for each non-mosaic chip independently */
-  int i, Nimage, Nstars;
+  int i, Nimage, Nraw, Nref;
   Image *image;
   StarData *raw, *ref;
@@ -16,11 +16,15 @@
 
     /* convert measure coordinates to raw entries */
-    raw = getImageRaw (catalog, Ncatalog, i, &Nstars, MODE_MOSAIC);
+    raw = getImageRaw (catalog, Ncatalog, i, &Nraw, MODE_MOSAIC);
 
     /* convert average coordinates to ref entries */
-    ref = getImageRef (catalog, Ncatalog, i, &Nstars, MODE_MOSAIC);
+    ref = getImageRef (catalog, Ncatalog, i, &Nref, MODE_MOSAIC);
 
-    fprintf (stderr, "image %d : Nstars: %d\n", i, Nstars);
-    FitChip (raw, ref, Nstars, &image[i].coords);
+    // note that Nraw & Nref must be equal: if not, we made a programming error in one of these two functions.
+    assert (Nraw == Nref);
+
+    // FitChip does iterative, clipped fitting
+    fprintf (stderr, "image %d : Nstars: %d\n", i, Nraw);
+    FitChip (raw, ref, Nraw, &image[i].coords);
 
     free (raw);
