Index: /trunk/BNC/bncantex.cpp
===================================================================
--- /trunk/BNC/bncantex.cpp	(revision 3054)
+++ /trunk/BNC/bncantex.cpp	(revision 3055)
@@ -43,4 +43,5 @@
 
 #include "bncantex.h"
+#include "bnctides.h"
 
 using namespace std;
@@ -209,11 +210,29 @@
 // Satellite Antenna Offset
 ////////////////////////////////////////////////////////////////////////////
-t_irc bncAntex::offset(const QString& prn, ColumnVector& neu) {
+t_irc bncAntex::satCoMcorrection(const QString& prn, double Mjd, 
+                                 const ColumnVector& xSat, ColumnVector& dx) {
+
   QMap<QString, t_antMap*>::const_iterator it = _maps.find(prn);
   if (it != _maps.end()) {
     t_antMap* map = it.value();
-    neu[0] = map->frqMapL1->neu[0];
-    neu[1] = map->frqMapL1->neu[1];
-    neu[2] = map->frqMapL1->neu[2];
+    double* neu = map->frqMapL1->neu;
+
+    // Unit Vectors sz, sy, sx
+    // -----------------------
+    ColumnVector sz = -xSat;
+    sz /= sqrt(DotProduct(sz,sz));
+
+    ColumnVector xSun = Sun(Mjd);
+    xSun /= sqrt(DotProduct(xSun,xSun));
+  
+    ColumnVector sy = crossproduct(sz, xSun);
+    sy /= sqrt(DotProduct(sy,sy));
+  
+    ColumnVector sx = crossproduct(sy, sz);
+
+    dx[0] = sx[0] * neu[0] + sy[0] * neu[1] + sz[0] * neu[2];
+    dx[1] = sx[1] * neu[0] + sy[1] * neu[1] + sz[1] * neu[2];
+    dx[2] = sx[2] * neu[0] + sy[2] * neu[1] + sz[2] * neu[2];
+
     return success;
   }
Index: /trunk/BNC/bncantex.h
===================================================================
--- /trunk/BNC/bncantex.h	(revision 3054)
+++ /trunk/BNC/bncantex.h	(revision 3055)
@@ -38,5 +38,6 @@
   void print() const;
   double pco(const QString& antName, double eleSat, bool& found);
-  t_irc  offset(const QString& prn, ColumnVector& neu);
+  t_irc  satCoMcorrection(const QString& prn, double Mjd, 
+                          const ColumnVector& xSat, ColumnVector& dx);
 
  private:
Index: /trunk/BNC/combination/bnccomb.cpp
===================================================================
--- /trunk/BNC/combination/bnccomb.cpp	(revision 3054)
+++ /trunk/BNC/combination/bnccomb.cpp	(revision 3055)
@@ -27,4 +27,5 @@
 #include "bnssp3.h"
 #include "bncantex.h"
+#include "bnctides.h"
 
 using namespace std;
@@ -389,11 +390,10 @@
       // -------------------------------
       if (_antex) {
-        ColumnVector neu(3);
-        if (_antex->offset(corr->prn, neu) == success) {
-          ColumnVector dx;
-          RSW_to_XYZ(xc.Rows(1,3), vv, neu, dx);
-          xc(1) += dx(1);
-          xc(2) += dx(2);
-          xc(3) += dx(3);
+        ColumnVector dx(3); dx = 0.0;
+        double Mjd = resTime.mjd() + resTime.daysec()/86400.0;
+        if (_antex->satCoMcorrection(corr->prn, Mjd, xc.Rows(1,3), dx) == success) {
+          xc(1) -= dx(1);
+          xc(2) -= dx(2);
+          xc(3) -= dx(3);
         }
         else {
