Index: trunk/psastro/src/psastroModelBoresite.c
===================================================================
--- trunk/psastro/src/psastroModelBoresite.c	(revision 15887)
+++ trunk/psastro/src/psastroModelBoresite.c	(revision 15891)
@@ -1,6 +1,8 @@
 # include "psastroStandAlone.h"
 
-// chisq = sum ((L_obs - L_fit(t))^2 + (M_obs - M_fit(t))^2)
-// coord[0] = measured L or measured M
+// the full chisq is built of two associated sums over coordinates:
+// chisq = sum ((X_obs - X_fit(t))^2 + (Y_obs - Y_fit(t))^2)
+// we use split this into a 2x long vector and use coord[1] to distinguish the X and Y terms:
+// coord[0] = measured X or measured Y
 // coord[1] =          0 or          1
 psF32 psastroModelBoresite (psVector *deriv, const psVector *params, const psVector *coord) {
@@ -15,33 +17,33 @@
     float sntht = sin(dtheta);
 
-    // value is L
+    // value is X
     if (coord->data.F32[1] == 0) {
 
-	float value = PAR[PAR_L0] + PAR[PAR_RL]*cstht*csphi + PAR[PAR_RM]*sntht*snphi;
+	float value = PAR[PAR_X0] + PAR[PAR_RX]*cstht*csphi + PAR[PAR_RY]*sntht*snphi;
 
 	if (deriv) {
 	    psF32 *dPAR = deriv->data.F32;
-	    dPAR[PAR_L0] = 1.0;
-	    dPAR[PAR_M0] = 0.0;
-	    dPAR[PAR_RL] = +cstht*csphi;
-	    dPAR[PAR_RM] = +sntht*snphi;
-	    dPAR[PAR_P0] = -PAR[PAR_RL]*cstht*snphi + PAR[PAR_RM]*sntht*csphi;
-	    dPAR[PAR_T0] =  PAR[PAR_RL]*sntht*csphi - PAR[PAR_RM]*cstht*snphi;
+	    dPAR[PAR_X0] = 1.0;
+	    dPAR[PAR_Y0] = 0.0;
+	    dPAR[PAR_RX] = +cstht*csphi;
+	    dPAR[PAR_RY] = +sntht*snphi;
+	    dPAR[PAR_P0] = -PAR[PAR_RX]*cstht*snphi + PAR[PAR_RY]*sntht*csphi;
+	    dPAR[PAR_T0] =  PAR[PAR_RX]*sntht*csphi - PAR[PAR_RY]*cstht*snphi;
 	}
 	return (value);
     }  
 
-    // value is M
+    // value is Y
     if (coord->data.F32[1] == 1) {
-	float value = PAR[PAR_M0] + PAR[PAR_RM]*sntht*csphi - PAR[PAR_RL]*cstht*snphi;
+	float value = PAR[PAR_Y0] + PAR[PAR_RY]*sntht*csphi - PAR[PAR_RX]*cstht*snphi;
 
 	if (deriv) {
 	    psF32 *dPAR = deriv->data.F32;
-	    dPAR[PAR_L0]  = 0.0;
-	    dPAR[PAR_M0]  = 1.0;
-	    dPAR[PAR_RL]  = -cstht*snphi;
-	    dPAR[PAR_RM]  = +sntht*csphi;
-	    dPAR[PAR_P0]  = -PAR[PAR_RM]*sntht*snphi - PAR[PAR_RL]*cstht*csphi;
-	    dPAR[PAR_T0]  = -PAR[PAR_RM]*sntht*csphi - PAR[PAR_RL]*cstht*snphi;
+	    dPAR[PAR_X0]  = 0.0;
+	    dPAR[PAR_Y0]  = 1.0;
+	    dPAR[PAR_RX]  = -cstht*snphi;
+	    dPAR[PAR_RY]  = +sntht*csphi;
+	    dPAR[PAR_P0]  = -PAR[PAR_RY]*sntht*snphi - PAR[PAR_RX]*cstht*csphi;
+	    dPAR[PAR_T0]  = -PAR[PAR_RY]*sntht*csphi - PAR[PAR_RX]*cstht*snphi;
 	}
 	return (value);
@@ -49,53 +51,2 @@
     psAbort ("programming error: invalid coordinate");
 }
-
-# undef PAR_L0
-# undef PAR_RL
-# undef PAR_PHI
-# define PAR_L0  0
-# define PAR_RL  1
-# define PAR_PHI 2
-
-psF32 psastroModelBoresiteL (psVector *deriv, const psVector *params, const psVector *coord) {
-
-    psF32 *PAR = params->data.F32;
-
-    float csphi = cos(PAR[PAR_PHI]);
-    float snphi = sin(PAR[PAR_PHI]);
-
-    float theta = coord->data.F32[0];
-    float cstht = cos(theta);
-    float sntht = sin(theta);
-
-    float value = PAR[PAR_L0] + PAR[PAR_RL]*cstht*csphi - PAR[PAR_RL]*sntht*snphi;
-
-    if (deriv) {
-	psF32 *dPAR = deriv->data.F32;
-	dPAR[PAR_L0]  = 1.0;
-	dPAR[PAR_RL]  = cstht*csphi - sntht*snphi;
-	dPAR[PAR_PHI] = -PAR[PAR_RL]*cstht*snphi - PAR[PAR_RL]*sntht*csphi;
-    }
-    return (value);
-}
-
-psF32 psastroModelBoresiteM (psVector *deriv, const psVector *params, const psVector *coord) {
-
-    psF32 *PAR = params->data.F32;
-
-    float csphi = cos(PAR[PAR_PHI]);
-    float snphi = sin(PAR[PAR_PHI]);
-
-    float theta = coord->data.F32[0];
-    float cstht = cos(theta);
-    float sntht = sin(theta);
-
-    float value = PAR[PAR_L0] + PAR[PAR_RL]*sntht*csphi + PAR[PAR_RL]*cstht*snphi;
-
-    if (deriv) {
-	psF32 *dPAR = deriv->data.F32;
-	dPAR[PAR_L0]  = 1.0;
-	dPAR[PAR_RL]  = +sntht*csphi + cstht*snphi;
-	dPAR[PAR_PHI] = -PAR[PAR_RL]*sntht*snphi + PAR[PAR_RL]*cstht*csphi;
-    }
-    return (value);
-}
