Index: trunk/BNC/src/PPP/pppInclude.h
===================================================================
--- trunk/BNC/src/PPP/pppInclude.h	(revision 5838)
+++ trunk/BNC/src/PPP/pppInclude.h	(revision 5839)
@@ -4,4 +4,5 @@
 #include <string>
 #include <vector>
+#include <newmat.h>
 
 #include "bncconst.h"
@@ -73,4 +74,12 @@
 class t_orbCorr {
  public:
+  ColumnVector getX(const bncTime& tt) const {
+    ColumnVector xx(3);
+    double dt = tt - _time;
+    xx[0] = _xr[0] + _dotXr[0] * dt;
+    xx[1] = _xr[1] + _dotXr[1] * dt;
+    xx[2] = _xr[2] + _dotXr[2] * dt;
+    return xx;
+  }
   t_prn          prn() const {return _prn;}
   unsigned short IOD() const {return _iod;}
@@ -80,9 +89,13 @@
   char           _system;
   double         _xr[3];
-  double         _dotXr[3];
+  double         _dotXr[3]; 
 };
 
 class t_clkCorr {
  public:
+  double getClk(const bncTime& tt) const {
+    double dt = tt - _time;
+    return _dClk + dt * _dotDClk + dt * dt * _dotDotDClk;    
+  }
   t_prn          prn() const {return _prn;}
   unsigned short IOD() const {return _iod;}
Index: trunk/BNC/src/ephemeris.cpp
===================================================================
--- trunk/BNC/src/ephemeris.cpp	(revision 5838)
+++ trunk/BNC/src/ephemeris.cpp	(revision 5839)
@@ -12,4 +12,5 @@
 #include "bnctime.h"
 #include "bnccore.h"
+#include "bncutils.h"
 #include "PPP/pppInclude.h"
 
@@ -63,5 +64,21 @@
   position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data());
   if (useCorr) {
-    throw "t_eph::getCrd: not yet implemented";
+    if (_orbCorr && _clkCorr) {
+      ColumnVector xr = _orbCorr->getX(tt); 
+      ColumnVector dx(3);
+      if (_orbCorr->_system == 'R') {
+        RSW_to_XYZ(xc.Rows(1,3), vv.Rows(1,3), xr, dx);
+      }
+      else {
+        dx = xr;
+      }
+      xc[0] -= dx[0];
+      xc[1] -= dx[1];
+      xc[2] -= dx[2];
+      xc[3] += _clkCorr->getClk(tt);
+    }
+    else {
+      return failure;
+    }
   }
   return success;
