Index: trunk/BNC/rinex/bncpostprocess.cpp
===================================================================
--- trunk/BNC/rinex/bncpostprocess.cpp	(revision 3747)
+++ trunk/BNC/rinex/bncpostprocess.cpp	(revision 3748)
@@ -124,13 +124,4 @@
   }
 
-  // Read Ephemerides
-  // ----------------
-  t_eph* eph = 0;
-  while ( (eph = _rnxNavFile->getNextEph()) != 0 ) {
-    if (_pppClient->putNewEph(eph) != success) {
-      delete eph; eph = 0;
-    }
-  }
-
   // Read/Process Observations
   // -------------------------
@@ -140,6 +131,17 @@
     ++nEpo;
 
+    // Get Corrections
+    // ---------------
     if (_corrFile) {
       _corrFile->syncRead(epo->tt);
+    }
+
+    // Get Ephemerides
+    // ----------------
+    t_eph* eph = 0;
+    while ( (eph = _rnxNavFile->getNextEph(epo->tt)) != 0 ) {
+      if (_pppClient->putNewEph(eph) != success) {
+        delete eph; eph = 0;
+      }
     }
 
Index: trunk/BNC/rinex/rnxnavfile.cpp
===================================================================
--- trunk/BNC/rinex/rnxnavfile.cpp	(revision 3747)
+++ trunk/BNC/rinex/rnxnavfile.cpp	(revision 3748)
@@ -161,9 +161,16 @@
 // Read Next Ephemeris
 ////////////////////////////////////////////////////////////////////////////
-t_eph* t_rnxNavFile::getNextEph() {
-  if (!_ephs.empty()) {
+t_eph* t_rnxNavFile::getNextEph(const bncTime& tt) {
+  while (!_ephs.empty()) {
     t_eph* eph = _ephs.front();
-    _ephs.pop();
-    return eph;
+    bncTime ephTime(eph->GPSweek(), eph->GPSweeks());
+    double dt = ephTime - tt;
+    if (dt < 4*3600.0) {
+      _ephs.pop();
+      return eph;
+    }
+    else {
+      return 0;
+    }
   }
   return 0;
Index: trunk/BNC/rinex/rnxnavfile.h
===================================================================
--- trunk/BNC/rinex/rnxnavfile.h	(revision 3747)
+++ trunk/BNC/rinex/rnxnavfile.h	(revision 3748)
@@ -29,4 +29,5 @@
 #include <QtCore>
 #include "bncconst.h"
+#include "bnctime.h"
 
 class t_pppOpt;
@@ -51,5 +52,5 @@
   t_rnxNavFile(QString fileName);
   ~t_rnxNavFile();
-  t_eph* getNextEph();
+  t_eph* getNextEph(const bncTime& tt);
   float version() const {return _header.version();}
   bool  glonass() const {return _header.glonass();}
