Index: trunk/Ohana/src/relastro/src/FitChip.c
===================================================================
--- trunk/Ohana/src/relastro/src/FitChip.c	(revision 15237)
+++ trunk/Ohana/src/relastro/src/FitChip.c	(revision 15238)
@@ -13,24 +13,23 @@
   fit_eval (fit);
   fit_apply_coords (fit, coords);
+
+  // apply new coords to raw (X,Y -> L,M)
+  for (i = 0; i < Nmatch; i++) {
+    XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, coords);
+  }
+
   fit_free (fit);
-  /* FitChip and FitSimple update the coords in different ways? maybe not... */
 }
 
-/* XXX the supporting fitting functions are not quite right
-   I probably need to apply the projection and then do the fit 
-   to L,M.  I also need to incorporate the transformations 
-   determined for psastro */
-
-
-/* in the simple case, we only have three coord systems of interest:
+/* in the mosaic case, we have four coord systems of interest:
    R,D : the sky
    P,Q : the tangent plane
+   L,M : the focal plane
    X,Y : the chip
 
    R,D -> P,Q (projection)
-   P,Q -> X,Y (polynomial transformation)
+   P,Q -> L,M (polynomial transformation : DIS)
+   L,M -> X,Y (polynomial transformation : WRP)
 */
 
 /* XXX I'm not using the errors at all : this could at least be done with the dMag values */
-
-   
Index: trunk/Ohana/src/relastro/src/FitMosaic.c
===================================================================
--- trunk/Ohana/src/relastro/src/FitMosaic.c	(revision 15237)
+++ trunk/Ohana/src/relastro/src/FitMosaic.c	(revision 15238)
@@ -14,23 +14,21 @@
   fit_apply_coords (fit, coords);
   fit_free (fit);
-  /* FitChip and FitSimple update the coords in different ways? maybe not... */
+
+  // apply new coords to raw (X,Y -> L,M)
+  for (i = 0; i < Nmatch; i++) {
+    XY_to_LM (&raw[i].P, &raw[i].Q, raw[i].L, raw[i].M, coords);
+  }
 }
 
-/* XXX the supporting fitting functions are not quite right
-   I probably need to apply the projection and then do the fit 
-   to L,M.  I also need to incorporate the transformations 
-   determined for psastro */
-
-
-/* in the simple case, we only have three coord systems of interest:
+/* in the mosaic case, we have four coord systems of interest:
    R,D : the sky
    P,Q : the tangent plane
+   L,M : the focal plane
    X,Y : the chip
 
    R,D -> P,Q (projection)
-   P,Q -> X,Y (polynomial transformation)
+   P,Q -> L,M (polynomial transformation : DIS)
+   L,M -> X,Y (polynomial transformation : WRP)
 */
 
 /* XXX I'm not using the errors at all : this could at least be done with the dMag values */
-
-   
Index: trunk/Ohana/src/relastro/src/FitSimple.c
===================================================================
--- trunk/Ohana/src/relastro/src/FitSimple.c	(revision 15237)
+++ trunk/Ohana/src/relastro/src/FitSimple.c	(revision 15238)
@@ -9,16 +9,18 @@
   for (i = 0; i < Nmatch; i++) {
     if (raw[i].mask) continue;
-    fit_add (fit, raw[i].X, raw[i].Y, ref[i].L, ref[i].M, 1.0);
+    fit_add (fit, raw[i].X, raw[i].Y, ref[i].P, ref[i].Q, 1.0);
   }
   fit_eval (fit);
   fit_apply_coords (fit, coords);
+
+  // apply new coords to raw (X,Y -> P,Q)
+  for (i = 0; i < Nmatch; i++) {
+    XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, coords);
+    raw[i].P = raw[i].L;
+    raw[i].Q = raw[i].M;
+  }
+
   fit_free (fit);
 }
-
-/* XXX the supporting fitting functions are not quite right
-   I probably need to apply the projection and then do the fit 
-   to L,M.  I also need to incorporate the transformations 
-   determined for psastro */
-
 
 /* in the simple case, we only have three coord systems of interest:
@@ -29,7 +31,7 @@
    R,D -> P,Q (projection)
    P,Q -> X,Y (polynomial transformation)
+
+   L,M is maintained, but is identical to P,Q
 */
 
 /* XXX I'm not using the errors at all : this could at least be done with the dMag values */
-
-   
