Index: /trunk/BNC/src/PPP/pppClient.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppClient.cpp	(revision 9507)
+++ /trunk/BNC/src/PPP/pppClient.cpp	(revision 9508)
@@ -69,6 +69,6 @@
   if (_opt->_refSatRequired) {
     for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) {
-      char system = _opt->systems()[iSys];
-      _obsPool->initRefSatMapElement(system);
+      char sys = _opt->systems()[iSys];
+      _refSatMap[sys] = new t_pppRefSat();
     }
   }
@@ -94,4 +94,10 @@
   delete _tides;
   clearObs();
+  QMapIterator<char, t_pppRefSat*> it(_refSatMap);
+  while (it.hasNext()) {
+    it.next();
+    delete it.value();
+  }
+  _refSatMap.clear();
 }
 
@@ -216,6 +222,6 @@
     while (it != obsVector.end()) {
       t_pppSatObs* satObs = *it;
-      char system = satObs->prn().system();
-      t_pppRefSat* refSat = _obsPool->getRefSatMapElement(system);
+      char sys = satObs->prn().system();
+      t_pppRefSat* refSat = _refSatMap[sys];
       double stecRef = refSat->stecValue();
       if (stecRef && !satObs->isReference()) {
@@ -605,13 +611,10 @@
 #endif
       if (_obsPool->refSatChanged()) {
-        if(_filter->datumTransformation() != success) {
-          LOG << "pppFilter::datumTransformation() != success" << endl;
+        if(_filter->datumTransformation(_refSatMap) != success) {
+          LOG << "t_pppFilter::datumTransformation() != success" << endl;
           return finish(failure);
         }
         else {
-          LOG << "pppFilter::datumTransformation() == success" << endl;
-          if (!_obsPool->refSatChangeRequired()) {
-            _obsPool->saveLastEpoRefSats();
-          }
+          LOG << "t_pppFilter::datumTransformation() == success" << endl;
         }
       }
@@ -643,10 +646,6 @@
           return finish(failure);
         }
-        if (_obsPool->refSatChanged() &&
-            (_opt->_obsModelType == OPT->DCMcodeBias ||
-             _opt->_obsModelType == OPT->DCMphaseBias ||
-             _opt->_pseudoObsIono)
-           ) {
-          LOG << "refSatChanged()" << endl;
+        if (_obsPool->refSatChanged()) {
+          LOG << "t_pppFilter: refSatChanged()" << endl;
             epochReProcessing = true;
             continue;
@@ -669,5 +668,5 @@
       // Store last epoch of data
       // ------------------------
-      _obsPool->putEpoch(_epoTimeRover, _obsRover, _pseudoObsIono);
+      _obsPool->putEpoch(_epoTimeRover, _obsRover, _pseudoObsIono, _refSatMap);
 
       // Process Epoch in Filter
@@ -798,5 +797,5 @@
     char sys = _opt->systems()[iSys];
     bool refSatDefined = false;
-    t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys);
+    t_pppRefSat* refSat = _refSatMap[sys];
     for (unsigned ii = 0; ii < obsVector.size(); ii++) {
       t_pppSatObs* satObs = obsVector.at(ii);
@@ -806,5 +805,5 @@
       // reference satellite is unchanged
       // ================================
-      if      (!_obsPool->refSatChangeRequired(sys) && refSat->prn() == satObs->prn()) {
+      if (     !_obsPool->refSatChangeRequired(sys) && refSat->prn() == satObs->prn()) {
         refSatDefined = true;
         obsVector[ii]->setAsReference();
@@ -878,9 +877,16 @@
   setRefSatellites(obsVector); // current epoch
   LOG.setf(ios::fixed);
-  QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());
+  t_pppObsPool::t_epoch* epoch = _obsPool->lastEpoch();
+  const QMap<char, t_pppRefSat*>& refSatMapLastEpoch = epoch->refSatMap();
+  
+  QMapIterator<char, t_pppRefSat*> it(_refSatMap);
   while (it.hasNext()) {
     it.next();
     char  sys = it.key();
     t_prn prn = it.value()->prn();
+    t_prn refSatLastEpochPrn = t_prn();
+    if (epoch) {
+      refSatLastEpochPrn =  refSatMapLastEpoch[sys]->prn();
+    }
     if      (prn.number() ==  0) { // no obs for that system available
       continue;
@@ -891,6 +897,5 @@
     }
     QString str;
-    if (prn == _obsPool->getRefSatMapElementLastEpoch(sys) ||
-               _obsPool->getRefSatMapElementLastEpoch(sys) == t_prn() )  {
+    if (prn == refSatLastEpochPrn || refSatLastEpochPrn == t_prn() )  {
       _obsPool->setRefSatChanged(sys, false);
       str = " SET   ";
@@ -906,5 +911,5 @@
 
 void t_pppClient::setHistoricalRefSats() {
-  QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());
+  QMapIterator<char, t_pppRefSat*> it(_refSatMap);
   while (it.hasNext()) {
     it.next();
@@ -914,5 +919,6 @@
       _historicalRefSats[sys].append(prn);
     }
-  }}
+  }
+}
 
 //
Index: /trunk/BNC/src/PPP/pppClient.h
===================================================================
--- /trunk/BNC/src/PPP/pppClient.h	(revision 9507)
+++ /trunk/BNC/src/PPP/pppClient.h	(revision 9508)
@@ -8,7 +8,7 @@
 #include "pppOptions.h"
 #include "pppModel.h"
+#include "pppRefSat.h"
 
 class bncAntex;
-class t_pppRefSat;
 
 namespace BNC_PPP {
@@ -79,4 +79,5 @@
   double                    _offGC;
   std::vector<t_pppSatObs*> _obsRover;
+  QMap<char, t_pppRefSat*>  _refSatMap;
   std::ostringstream*       _log;
   t_pppOptions*             _opt;
Index: /trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppFilter.cpp	(revision 9507)
+++ /trunk/BNC/src/PPP/pppFilter.cpp	(revision 9508)
@@ -72,20 +72,21 @@
   string epoTimeStr = string(_epoTime);
 
+  const QMap<char, t_pppRefSat*>& refSatMap = epoch->refSatMap();
+
   if (OPT->_obsModelType == OPT->DCMcodeBias ||
       OPT->_obsModelType == OPT->DCMphaseBias) {
      // Save parameters of epoch before
     _parlist_sav = _parlist;
- }
+  }
 
   //--
   // Set Parameters
-  if (_parlist.set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) {
+  if (_parlist.set(_epoTime, allObs, refSatMap) != success) {
     return failure;
   }
-
   const vector<t_pppParam*>& params = _parlist.params();
 #ifdef BNC_DEBUG_PPP
-  for (int iPar = 0; iPar < params.size(); iPar++) {
-    LOG << "available par " << params[iPar]->toString() << endl;
+  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
+    LOG << "t_pppFilter::processEpoch par_cur " << params[iPar]->toString() << endl;
   }
 #endif
@@ -133,5 +134,5 @@
     for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
       char sys = usedSystems[iSys];
-      _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
+      _refPrn = refSatMap[sys]->prn();
      vector<t_pppSatObs*> obsVector;
       for (unsigned jj = 0; jj < allObs.size(); jj++) {
@@ -170,5 +171,5 @@
     char sys = usedSystems[iSys];
     if (OPT->_refSatRequired) {
-      _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
+      _refPrn = refSatMap[sys]->prn();
     }
     else {
@@ -195,10 +196,7 @@
   // close epoch processing
   // ----------------------
-  cmpDOP(allObs);
+  cmpDOP(allObs, refSatMap);
   _parlist.printResult(_epoTime, _QFlt, _xFlt);
   _lastEpoTimeOK = _epoTime;  // remember time of last successful epoch processing
-  if (OPT->_refSatRequired) {
-    _obsPool->saveLastEpoRefSats();
-  }
   return success;
 }
@@ -596,5 +594,6 @@
 // Compute various DOP Values
 ////////////////////////////////////////////////////////////////////////////
-void t_pppFilter::cmpDOP(const vector<t_pppSatObs*>& obsVector) {
+void t_pppFilter::cmpDOP(const vector<t_pppSatObs*>& obsVector, 
+                         const QMap<char, t_pppRefSat*>& refSatMap) {
 
   _dop.reset();
@@ -606,8 +605,8 @@
     for (unsigned ii = 0; ii < obsVector.size(); ii++) {
       t_pppSatObs* obs = obsVector[ii];
-      char system = obs->prn().system();
+      char sys = obs->prn().system();
       t_prn refPrn = t_prn();
       if (OPT->_refSatRequired) {
-        refPrn = _obsPool->getRefSatMapElement(system)->prn();
+        refPrn = refSatMap[sys]->prn();
       }
       if (obs->isValid() && !obs->outlier()) {
@@ -678,21 +677,25 @@
 // Compute datum transformation
 ////////////////////////////////////////////////////////////////////////////
-t_irc t_pppFilter::datumTransformation() {
+t_irc t_pppFilter::datumTransformation(const QMap<char, t_pppRefSat*>& refSatMap) {
+
   // get last epoch
   t_pppObsPool::t_epoch* epoch = _obsPool->lastEpoch();
   if (!epoch) {
-    LOG << "!lastEpoch" << endl;
+    LOG << "t_pppFilter::datumTransformation: !lastEpoch" << endl;
     return failure;
   }
-  else {
-    LOG.setf(ios::fixed);
-    LOG << string(epoch->epoTime()) << " DATUM TRANSFORMATION " << endl;
-  }
+  _epoTime = epoch->epoTime();
+  LOG.setf(ios::fixed);
+  LOG << string(_epoTime) << " DATUM TRANSFORMATION " << endl;
 
   vector<t_pppSatObs*>& allObs = epoch->obsVector();
+
+  const QMap<char, t_pppRefSat*>& refSatMapLastEpoch = epoch->refSatMap();
+
+  bool peseudoObsIono = epoch->pseudoObsIono();
 
   // reset old and set new refSats in last epoch (ambiguities/GIM)
   // =============================================================
-  if (resetRefSatellitesLastEpoch(allObs) != true) {
+  if (resetRefSatellitesLastEpoch(allObs, refSatMap, refSatMapLastEpoch) != true) {
     LOG  << "refsatChange required" << endl;
     return success;
@@ -705,13 +708,13 @@
   // set AA2
   // =======
-  if (_parlist.set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) {
+  if (_parlist.set(_epoTime, allObs, refSatMap) != success) {
     return failure;
   }
-  const vector<t_pppParam*>& _params = _parlist.params();
+  vector<t_pppParam*>& _params = _parlist.params();
   unsigned nPar = _parlist.nPar();
 #ifdef BNC_DEBUG_PPP
-  LOG << " parameters of last epoch" << endl;
+  LOG << " t_pppFilter::datumTransformation par last epoch: " << _params.size() << "/" << nPar <<  endl;
   for (unsigned iPar = 0; iPar < nPar; iPar++) {
-    LOG << _params[iPar]->toString() << "\t\t" << endl;
+    LOG << _params[iPar]->toString() << "\t\t"  endl;
   }
 #endif
@@ -719,5 +722,5 @@
   for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     char sys = usedSystems[iSys];
-    t_prn refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
+    t_prn refPrn = refSatMap[sys]->prn();
     vector<t_pppSatObs*> obsVector;
     for (unsigned jj = 0; jj < allObs.size(); jj++) {
@@ -731,5 +734,5 @@
     vector<t_lc::type> LCs = OPT->LCs(sys);
     unsigned usedLCs = LCs.size();
-    if (OPT->_pseudoObsIono && !epoch->pseudoObsIono()) {
+    if (OPT->_pseudoObsIono && !peseudoObsIono) {
         usedLCs -= 1;  // GIM not used
     }
@@ -744,9 +747,8 @@
       maxObs += 1;
     }
-    if (OPT->_pseudoObsIono && epoch->pseudoObsIono()) {
+    if (OPT->_pseudoObsIono && peseudoObsIono) {
       maxObs -= 1; // pseudo obs iono with respect to refSat
     }
     Matrix  AA(maxObs, nPar);
-
     // Real Observations
     // -----------------
@@ -787,6 +789,8 @@
       continue;
     }
-    _datumTrafo->updateIndices(sys, iObs+1);
-    _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, nPar), 2);
+    _datumTrafo->updateIndices(sys, iObs+1);    //LOG << "AA Ncols/Nrows: " << AA.Ncols() << "/" << AA.Nrows() << "  nPar: "  << nPar << endl;    //LOG << "AA.SubMatrix(1 .. " << iObs+1 << " , 1 .. " <<  nPar << ")" << endl;
+    if(_datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, nPar), 2) != success) {
+      return failure;
+    }
   }
   _datumTrafo->updateNumObs();
@@ -819,8 +823,8 @@
   for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     char sys = usedSystems[iSys];
-    t_prn refPrnOld = _obsPool->getRefSatMapElementLastEpoch(sys);
-    t_prn refPrnNew = (_obsPool->getRefSatMapElement(sys))->prn();
+    t_prn refPrnOld = refSatMapLastEpoch[sys]->prn();
+    t_prn refPrnNew = refSatMap[sys]->prn();
     if (refPrnNew != refPrnOld) {
-      t_irc irc = resetAmb(_obsPool->getRefSatMapElementLastEpoch(sys), allObs);
+      t_irc irc = resetAmb(refPrnOld, allObs);
       if (OPT->_obsModelType == OPT->DCMcodeBias) {
         if (irc == success) {
@@ -834,4 +838,6 @@
   // =================
   _datumTrafo->switchAA();
+
+  _obsPool->putEpoch(_epoTime, allObs, peseudoObsIono, refSatMap);
 
   return success;
@@ -877,5 +883,7 @@
 //
 //////////////////////////////////////////////////////////////////////////////
-bool t_pppFilter::resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector) {
+bool t_pppFilter::resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector,
+    const QMap<char, t_pppRefSat*>& refSatMap,
+    const QMap<char, t_pppRefSat*>& refSatMapLastEpoch) {
   bool resetRefSat;
   // reference satellite definition per system
@@ -884,9 +892,10 @@
     resetRefSat = false;
     char sys = usedSystems[iSys];
-    t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys);
-    t_prn newPrn = refSat->prn();
-    t_prn oldPrn = _obsPool->getRefSatMapElementLastEpoch(sys);
+    t_prn newPrn = refSatMap[sys]->prn();
+    t_prn oldPrn = refSatMapLastEpoch[sys]->prn();
 #ifdef BNC_DEBUG_PPP
-    LOG << "oldPrn: " << oldPrn.toString() << " => newPrn: " << newPrn.toString() << endl;
+    if (oldPrn != newPrn) {
+      LOG << "oldRef: " << oldPrn.toString() << " => newRef " <<  newPrn.toString() << endl;
+    }
 #endif
     vector<t_pppSatObs*>::iterator it = obsVector.begin();
@@ -896,6 +905,5 @@
         resetRefSat = true;
         satObs->setAsReference();
-      }
-      else if (satObs->prn() == oldPrn) {
+      } else if (satObs->prn() == oldPrn) {
         satObs->resetReference();
       }
Index: /trunk/BNC/src/PPP/pppFilter.h
===================================================================
--- /trunk/BNC/src/PPP/pppFilter.h	(revision 9507)
+++ /trunk/BNC/src/PPP/pppFilter.h	(revision 9508)
@@ -26,5 +26,5 @@
   const SymmetricMatrix& Q() const {return _QFlt;}
 
-  t_irc datumTransformation();
+  t_irc datumTransformation(const QMap<char, t_pppRefSat*>& refSatMap);
   void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs, bool pseudoObsIono);
   unsigned setTrafoObs();
@@ -91,5 +91,5 @@
         _firstRow = _lastRow + 1;
       }
-      _lastRow += maxObsSys;//LOG << sys << " updateIndices: lastRow: " << _lastRow << "\n" ;
+      _lastRow += maxObsSys; //LOG << sys << " updateIndices: lastRow: " << _lastRow << "\n" ;
     };
 
@@ -120,10 +120,16 @@
       _D21.ReSize(_numPar, _numPar); _D21 = 0.0;
     }
-    void prepareAA(const Matrix& AA, int ind) {
+    t_irc prepareAA(const Matrix& AA, int ind) {
       Matrix* Prep = &_AA2;
       if (ind == 1) {
         Prep = &_AA1;
       }
+      //LOG << "_firstRow: " << _firstRow << " _lastRow: " << _lastRow << " _numPar " << _numPar << std::endl;
+      if (AA.Ncols() > _numPar) {
+        LOG << "t_pppFilter::prepareAA: AA.Ncols() > _numPar: " << AA.Ncols() << " > " << _numPar << std::endl;
+        return failure;
+      }
       Prep->SubMatrix(_firstRow, _lastRow, 1, _numPar) << AA;
+      return success;
     }
     void switchAA() {
@@ -132,5 +138,5 @@
     t_irc computeTrafoMatrix() {
       if (((_AA2.t() * _AA2)).Determinant() == 0.0) {
-        LOG << "(_AA2.t() * _AA2).inv() is singular" << std::endl;
+        LOG << "t_pppFilter::computeTrafoMatrix: (_AA2.t() * _AA2).inv() is singular" << std::endl;
         return failure;
       }
@@ -174,5 +180,6 @@
                  SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
 
-  void cmpDOP(const std::vector<t_pppSatObs*>& obsVector);
+  void cmpDOP(const std::vector<t_pppSatObs*>& obsVector,
+              const QMap<char, t_pppRefSat*>& refSatMap);
 
   void predictCovCrdPart(const SymmetricMatrix& QFltOld);
@@ -180,5 +187,7 @@
   t_irc addNoiseToIono(char sys);
 
-  bool resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector);
+  bool resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector,
+                                   const QMap<char, t_pppRefSat*>& refSatMap,
+                                   const QMap<char, t_pppRefSat*>& refSatMapLastEpoch);
 
   bncTime         _epoTime;
Index: /trunk/BNC/src/PPP/pppObsPool.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppObsPool.cpp	(revision 9507)
+++ /trunk/BNC/src/PPP/pppObsPool.cpp	(revision 9508)
@@ -23,5 +23,5 @@
 /////////////////////////////////////////////////////////////////////////////
 t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
-                               bool pseudoObsIono) {
+                               bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap) {
   _epoTime        = epoTime;
   _pseudoObsIono  = pseudoObsIono;
@@ -30,4 +30,13 @@
   }
   obsVector.clear();
+
+  QMapIterator<char, t_pppRefSat*> it(refSatMap);
+  while (it.hasNext()) {
+    it.next();
+    char sys = it.key();
+    t_pppRefSat* refSat = it.value();
+    _refSatMap[sys] = new t_pppRefSat(refSat->prn(), refSat->stecValue());
+  }
+  //refSatMap.clear();
 }
 
@@ -38,4 +47,11 @@
     delete _obsVector[ii];
   }
+
+  QMapIterator<char, t_pppRefSat*> it(_refSatMap);
+  while (it.hasNext()) {
+    it.next();
+    delete it.value();
+  }
+  _refSatMap.clear();
 }
 
@@ -71,5 +87,4 @@
     _epochs.pop_front();
   }
-  clearRefSatMap();
 }
 
@@ -101,8 +116,7 @@
 /////////////////////////////////////////////////////////////////////////////
 void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
-    bool pseudoObsIono) {
+                            bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap) {
   const unsigned MAXSIZE = 2;
-
-  _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono));
+  _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono, refSatMap));
 
   if (_epochs.size() > MAXSIZE) {
Index: /trunk/BNC/src/PPP/pppObsPool.h
===================================================================
--- /trunk/BNC/src/PPP/pppObsPool.h	(revision 9507)
+++ /trunk/BNC/src/PPP/pppObsPool.h	(revision 9508)
@@ -18,14 +18,16 @@
    public:
     t_epoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
-            bool pseudoObsIono);
+            bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap);
     ~t_epoch();
           std::vector<t_pppSatObs*>& obsVector() {return _obsVector;}
     const std::vector<t_pppSatObs*>& obsVector() const {return _obsVector;}
+    const QMap<char, t_pppRefSat*>& refSatMap() const {return _refSatMap;}
     const bncTime& epoTime() const {return _epoTime;}
     bool pseudoObsIono() const {return _pseudoObsIono;}
    private:
     bncTime                   _epoTime;
+    bool                      _pseudoObsIono;
     std::vector<t_pppSatObs*> _obsVector;
-    bool                      _pseudoObsIono;
+    QMap<char, t_pppRefSat*>  _refSatMap;
   };
 
@@ -37,5 +39,5 @@
 
   void putEpoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
-                bool pseudoObs);
+                bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap);
 
   void deleteLastEpoch();
@@ -56,33 +58,4 @@
       return 0;
     }
-  }
-
-  // RefSatMap of the current epoch
-  // ==============================
-  void initRefSatMapElement(char system) {_refSatMap[system] = new t_pppRefSat();}
-  void clearRefSatMap() {
-    QMapIterator<char, t_pppRefSat*> it(_refSatMap);
-    while (it.hasNext()) {
-      it.next();
-      delete it.value();
-    }
-    _refSatMap.clear();
-  }
-  QMap<char, t_pppRefSat*> getRefSatMap() {return _refSatMap;}
-  t_pppRefSat* getRefSatMapElement(char sys) {return _refSatMap[sys];}
-
-
-  // RefSatMap of the last epoch
-  // ===========================
-  QMap<char, t_prn> getRefSatMapLastEpoch() {return _refSatMapLastEpoch;}
-  t_prn getRefSatMapElementLastEpoch(char sys) {return _refSatMapLastEpoch[sys];}
-  void setRefSatMapElementLastEpoch(char sys, t_prn prn) {_refSatMapLastEpoch[sys] = prn;}
-  void saveLastEpoRefSats() {
-    QMapIterator<char, t_pppRefSat*> it(getRefSatMap());
-    while (it.hasNext()) {
-      it.next();
-      t_prn prn = it.value()->prn();
-      setRefSatMapElementLastEpoch(prn.system(), prn);
-    };
   }
 
@@ -130,8 +103,6 @@
   t_vTec*                  _vTec;
   std::deque<t_epoch*>     _epochs;
-  QMap<char, t_pppRefSat*> _refSatMap;
   QMap<char, bool>         _refSatChangeRequiredMap;
   QMap<char, bool>         _refSatChangedMap;
-  QMap<char, t_prn>        _refSatMapLastEpoch;
 };
 
Index: /trunk/BNC/src/PPP/pppParlist.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppParlist.cpp	(revision 9507)
+++ /trunk/BNC/src/PPP/pppParlist.cpp	(revision 9508)
@@ -143,4 +143,7 @@
   _sigma0   = old->sigma0();
   _epoSpec  = old->epoSpec();
+  _x0       = old->x0();
+  setFirstObsTime(old->firstObsTime());
+  setLastObsTime(old->lastObsTime());
   _ambInfo  = 0;
   if (_type == t_pppParam::amb) {
@@ -149,5 +152,4 @@
     _ambInfo->_eleSat         = old->_ambInfo->_eleSat;
     _ambInfo->_numEpo         = old->_ambInfo->_numEpo;
-    _x0 = x0();
   }
 }
@@ -448,5 +450,6 @@
       if (OPT->_obsModelType == OPT->DCMcodeBias ||
           OPT->_obsModelType == OPT->DCMphaseBias) {
-        t_prn refPrn = (refSatMap[par->prn().system()])->prn();
+        char sys = par->prn().system();
+        t_prn refPrn = (refSatMap[sys])->prn();
         if (par->lastObsTime().valid() &&
             ((epoTime - par->lastObsTime() > 1.0) || (par->prn() == refPrn))) {
@@ -475,4 +478,7 @@
     }
     if (remove) {
+#ifdef BNC_DEBUG_PPP
+      LOG << "remove " << par->toString() << std::endl;
+#endif
       delete par;
       it = _params.erase(it);
@@ -519,4 +525,7 @@
       }
       if (remove) {
+#ifdef BNC_DEBUG_PPP
+        LOG << "remove " << par->toString() << std::endl;
+#endif
         delete par;
         it = _params.erase(it);
@@ -711,4 +720,7 @@
     }
     else {
+#ifdef BNC_DEBUG_PPP
+      LOG << "push_back  parReq " << parReq->toString() << std::endl;
+#endif
       _params.push_back(parReq);
     }
Index: /trunk/BNC/src/src.pri
===================================================================
--- /trunk/BNC/src/src.pri	(revision 9507)
+++ /trunk/BNC/src/src.pri	(revision 9508)
@@ -131,5 +131,5 @@
   SOURCES += PPP/pppClient.cpp  PPP/pppObsPool.cpp PPP/pppEphPool.cpp \
              PPP/pppStation.cpp PPP/pppFilter.cpp  PPP/pppParlist.cpp \
-             PPP/pppSatObs.cpp  PPP/pppRefSat.cpp
+             PPP/pppSatObs.cpp
 }
 else {
