Index: /trunk/BNC/src/PPP/pppClient.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppClient.cpp	(revision 8960)
+++ /trunk/BNC/src/PPP/pppClient.cpp	(revision 8961)
@@ -220,9 +220,25 @@
         satObs->setPseudoObsIono(t_frequency::G1, stecRef);
       }
-      satObs->printObsMinusComputed();
       it++;
     }
   }
-
+  if (_opt->_pseudoObsTropo) {
+    vector<t_pppSatObs*>::iterator it = obsVector.begin();
+    while (it != obsVector.end()) {
+      t_pppSatObs* satObs = *it;
+      if (satObs->isReference()) {
+        satObs->setPseudoObsTropo();
+      }
+      it++;
+    }
+  }
+/*
+  vector<t_pppSatObs*>::iterator it = obsVector.begin();
+      while (it != obsVector.end()) {
+        t_pppSatObs* satObs = *it;
+        satObs->printObsMinusComputed();
+        it++;
+      }
+*/
   return pseudoObsIono;
 }
Index: /trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppFilter.cpp	(revision 8960)
+++ /trunk/BNC/src/PPP/pppFilter.cpp	(revision 8961)
@@ -117,16 +117,26 @@
   // Init Datum Trafo
   // ----------------------------------------
-  if ((OPT->_obsModelType == OPT->DCMcodeBias ||
-       OPT->_obsModelType == OPT->DCMphaseBias) &&
-      (_numEpoProcessing == 1)) {
+  if ((OPT->_obsModelType == OPT->DCMcodeBias   ||
+       OPT->_obsModelType == OPT->DCMphaseBias) && (_numEpoProcessing == 1)) {
     _numAllUsedLCs = 0;
     for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
       char system = OPT->systems()[iSys];
       _numAllUsedLCs += OPT->LCs(system).size();
-      if (OPT->_pseudoObsIono && !epoch->pseudoObsIono()) {
+      if (OPT->_pseudoObsIono && epoch->pseudoObsIono() == false) {
         _numAllUsedLCs -= 1;  // GIM not used
       }
     }
-    int maxObs = allObs.size() * _numAllUsedLCs;
+    int modify = 0;
+    if (OPT->_pseudoObsTropo) {
+      modify  = -1;
+    }
+    // max Obs
+    int maxObs = allObs.size() * (_numAllUsedLCs + modify);
+    if (OPT->_pseudoObsIono && epoch->pseudoObsIono() == true) { // stecDiff w.r.t refSat
+      maxObs -= 1;
+    }
+    if (OPT->_pseudoObsTropo) {
+      maxObs += 1;  // once per station
+    }
     _datumTrafo->initAA(maxObs, _parlist->nPar());
   }
@@ -144,4 +154,5 @@
         _refPrn = (_obsPool->getRefSatMapElement(system))->prn();
         if (_obsPool->hasHistoricalRefSat(_refPrn)) {
+          LOG << epoTimeStr << " Warning: prevent to process erroneous refSat again!";
           return failure;
         }
@@ -219,17 +230,24 @@
   }
 
-  unsigned usedLCs = LCs.size(); //qDebug() << "usedLCs: " << usedLCs;
+  unsigned usedLCs = LCs.size();
   if (OPT->_pseudoObsIono && !pseudoObsIonoAvailable) {
     usedLCs -= 1;  // GIM not used
   }
+
   ColumnVector               xSav       = _xFlt;
   SymmetricMatrix            QSav       = _QFlt;
   string                     epoTimeStr = string(_epoTime);
   const vector<t_pppParam*>& params     = _parlist->params();
-  unsigned                   maxObs     = obsVector.size() * usedLCs;
-  //unsigned                   maxObs     = 2 * usedLCs;
-
+  int modify = 0;
+  if (OPT->_pseudoObsTropo) {
+    modify  = -1;
+  }
+  // max Obs
+  unsigned maxObs = obsVector.size() * (usedLCs + modify);
   if (OPT->_pseudoObsIono && pseudoObsIonoAvailable) { // stecDiff w.r.t refSat
     maxObs -= 1;
+  }
+  if (OPT->_pseudoObsTropo) {
+    maxObs +=1;   // tropo pseudo obs once per station
   }
 
@@ -257,5 +275,6 @@
         for (unsigned jj = 0; jj < usedLCs; jj++) {
           const t_lc::type tLC = LCs[jj];
-          if (tLC == t_lc::GIM &&  obs->isReference()) {continue;}
+          if (tLC == t_lc::GIM && obs->isReference()) {continue;}
+          if (tLC == t_lc::Tz0 && ii+1 != obsVector.size()) {continue;}
           ++iObs;
           usedObs.push_back(obs);
@@ -417,5 +436,4 @@
           _slips[obs->prn()]._obsSlipCounter = obs->slipCounter();
         }
-
         if (_slips[obs->prn()]._biasJumpCounter != -1 &&
             _slips[obs->prn()]._biasJumpCounter != obs->biasJumpCounter()) {
@@ -468,5 +486,5 @@
 t_irc t_pppFilter::resetAmb(t_prn prn, const vector<t_pppSatObs*>& obsVector,
                             SymmetricMatrix* QSav, ColumnVector* xSav) {
-
+                            
   t_irc irc = failure;
   vector<t_pppParam*>& params = _parlist->params();
@@ -587,5 +605,4 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_pppFilter::datumTransformation(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld) {
-
   Matrix D21 = _datumTrafo->computeTrafoMatrix();
   _QFlt << D21 * QFltOld * D21.t();
Index: /trunk/BNC/src/PPP/pppParlist.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppParlist.cpp	(revision 8960)
+++ /trunk/BNC/src/PPP/pppParlist.cpp	(revision 8961)
@@ -141,20 +141,20 @@
   switch (_type) {
   case crdX:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (sta->xyzApr()[0] - obs->xc()[0]) / rhoV.NormFrobenius();
   case crdY:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (sta->xyzApr()[1] - obs->xc()[1]) / rhoV.NormFrobenius();
   case crdZ:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (sta->xyzApr()[2] - obs->xc()[2]) / rhoV.NormFrobenius();
   case clkR:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return 1.0;
   case offGG:
-    if (tLC == t_lc::GIM) {return 0.0;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     return (obs->prn().system() == 'R') ? 1.0 : 0.0;
   case amb:
-    if      (tLC == t_lc::GIM) {return 0.0;}
+    if      (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
     else if ((OPT->_obsModelType == OPT->IF)     ||
              (OPT->_obsModelType == OPT->PPPRTK) ||
@@ -181,8 +181,14 @@
     break;
   case trp:
-    if (tLC == t_lc::GIM) {return 0.0;}
-    return  1.0 / sin(obs->eleSat());
+    if      (tLC == t_lc::GIM) {
+      return 0.0;
+    }
+    else if (tLC == t_lc::Tz0) {
+      return 1.0;
+    }
+    else {
+      return 1.0 / sin(obs->eleSat());
+    }
   case ion:
-
     if (obs->prn() == _prn) {
       if      (tLC == t_lc::c1) {
@@ -203,10 +209,10 @@
     }
     if (tLC == t_lc::GIM && _prn == refPrn) {
-      return  1.0;
+      return 1.0;
     }
     break;
   case cBias1:
     if  (tLC == t_lc::c1) {
-      return  1.0;
+      return 1.0;
     }
     else {
@@ -216,5 +222,5 @@
   case cBias2:
      if (tLC == t_lc::c2) {
-      return  1.0;
+      return 1.0;
     }
     else {
@@ -224,5 +230,5 @@
   case pBias1:
     if  (tLC == t_lc::l1) {
-      return  1.0;
+      return 1.0;
     }
     else {
@@ -232,5 +238,5 @@
   case pBias2:
     if  (tLC == t_lc::l2) {
-      return  1.0;
+      return 1.0;
     }
     else {
Index: /trunk/BNC/src/PPP/pppSatObs.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppSatObs.cpp	(revision 8960)
+++ /trunk/BNC/src/PPP/pppSatObs.cpp	(revision 8961)
@@ -92,5 +92,5 @@
   for (unsigned ii = 0; ii < OPT->LCs(_prn.system()).size(); ii++) {
     t_lc::type tLC = OPT->LCs(_prn.system())[ii];
-    if (tLC == t_lc::GIM) {continue;}
+    if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {continue;}
     if (!isValid(tLC)) {
       _valid = false;
@@ -190,4 +190,5 @@
     return;
   case t_lc::GIM:
+  case t_lc::Tz0:
   case t_lc::dummy:
   case t_lc::maxLc:
@@ -218,6 +219,10 @@
     }
     else {
-      return _stecRefSat - _stecSat;
-    }
+      return _stecRefSat;
+    }
+  }
+
+  if (tLC == t_lc::Tz0) {
+    return _model._tropo0;
   }
 
@@ -292,4 +297,8 @@
   if (tLC == t_lc::GIM) {
     retVal = OPT->_sigmaGIMdiff * OPT->_sigmaGIMdiff;
+  }
+
+  if (tLC == t_lc::Tz0) {
+    retVal = OPT->_sigmaTz0 * OPT->_sigmaTz0;
   }
 
@@ -407,5 +416,6 @@
   // Tropospheric Delay
   // ------------------
-  _model._tropo = t_tropo::delay_saast(rRec, _model._eleSat);
+  _model._tropo  = t_tropo::delay_saast(rRec, _model._eleSat);
+  _model._tropo0 = t_tropo::delay_saast(rRec, M_PI/2.0);
 
   // Code Biases
@@ -570,5 +580,8 @@
   }
   else if (tLC == t_lc::GIM) {
-    cmpValue = 0.0;
+    cmpValue =  _stecSat;
+  }
+  else if (tLC == t_lc::Tz0) {
+    cmpValue = _model._tropo0;
   }
   else {
@@ -633,2 +646,9 @@
   _stecRefSat = stecRefSat;
 }
+
+
+//
+////////////////////////////////////////////////////////////////////////////
+void  t_pppSatObs::setPseudoObsTropo() {qDebug() << "setPseudoObsTropo";
+  _tropo0 = _model._tropo0;
+}
Index: /trunk/BNC/src/PPP/pppSatObs.h
===================================================================
--- /trunk/BNC/src/PPP/pppSatObs.h	(revision 8960)
+++ /trunk/BNC/src/PPP/pppSatObs.h	(revision 8961)
@@ -46,4 +46,5 @@
   double              getRes(t_lc::type tLC) const;
   void                setPseudoObsIono(t_frequency::type freq, double stecRefSat);
+  void                setPseudoObsTropo();
   double              getIonoCodeDelay(t_frequency::type freq) {return _model._ionoCodeDelay[freq];}
 
@@ -94,4 +95,5 @@
       _antEcc    = 0.0;
       _tropo     = 0.0;
+      _tropo0    = 0.0;
       _tideEarth = 0.0;
       _tideOcean = 0.0;
@@ -114,4 +116,5 @@
     double _antEcc;
     double _tropo;
+    double _tropo0;
     double _tideEarth;
     double _tideOcean;
@@ -142,4 +145,5 @@
   double                       _stecRefSat;
   double                       _stecSat;
+  double                       _tropo0;
 };
 
Index: /trunk/BNC/src/pppInclude.h
===================================================================
--- /trunk/BNC/src/pppInclude.h	(revision 8960)
+++ /trunk/BNC/src/pppInclude.h	(revision 8961)
@@ -42,5 +42,5 @@
 class t_lc {
  public:
-  enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, GIM, maxLc};
+  enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, GIM, Tz0, maxLc};
 
   static bool includesPhase(type tt) {
@@ -56,7 +56,8 @@
     case cIF:
       return false;
-    case dummy: 
-    case maxLc: 
+    case dummy:
+    case maxLc:
     case GIM:
+    case Tz0:
       return false;
     }
@@ -76,7 +77,8 @@
     case lIF:
       return false;
-    case dummy: 
-    case maxLc: 
+    case dummy:
+    case maxLc:
     case GIM:
+    case Tz0:
       return false;
     }
@@ -100,7 +102,8 @@
     case lIF: case cIF: case MW: case CL:
       return t_frequency::dummy;
-    case dummy: 
-    case maxLc: 
+    case dummy:
+    case maxLc:
     case GIM:
+    case Tz0:
       return t_frequency::dummy;
     }
@@ -119,6 +122,7 @@
     case cIF: return "cIF";
     case GIM: return "GIM";
-    case dummy: 
-    case maxLc: 
+    case Tz0: return "Tz0";
+    case dummy:
+    case maxLc:
       return "";
     }
Index: /trunk/BNC/src/pppMain.cpp
===================================================================
--- /trunk/BNC/src/pppMain.cpp	(revision 8960)
+++ /trunk/BNC/src/pppMain.cpp	(revision 8961)
@@ -185,21 +185,30 @@
     opt->_obsModelType   = t_pppOptions::IF;
     opt->_pseudoObsIono  = false;
+    opt->_pseudoObsTropo = false;
     opt->_refSatRequired = false;
 #ifdef USE_PPP
     // Pseudo Observations
     if      (settings.value("PPP/pseudoObs").toString() == "Ionosphere") {
-      opt->_pseudoObsIono = true;
+      opt->_pseudoObsIono  = true;
+      opt->_pseudoObsTropo = false;
+    }
+    else if (settings.value("PPP/pseudoObs").toString() == "Iono+Tropo") {
+      opt->_pseudoObsIono  = true;
+      opt->_pseudoObsTropo = true;
     }
     else if (settings.value("PPP/pseudoObs").toString() == "no") {
-      opt->_pseudoObsIono = false;
+      opt->_pseudoObsIono  = false;
+      opt->_pseudoObsTropo = false;
     }
     // Observation Model
     if      (settings.value("PPP/modelObs").toString() == "Ionosphere-free PPP") {
       opt->_obsModelType = t_pppOptions::IF;
-      opt->_pseudoObsIono = false;
+      opt->_pseudoObsIono  = false;
+      opt->_pseudoObsTropo = false;
     }
     else if (settings.value("PPP/modelObs").toString() == "PPP-RTK") {
       opt->_obsModelType = t_pppOptions::PPPRTK;
-      opt->_pseudoObsIono = false;
+      opt->_pseudoObsIono  = false;
+      opt->_pseudoObsTropo = false;
     }
     else if (settings.value("PPP/modelObs").toString() == "Uncombined PPP") {
@@ -229,4 +238,7 @@
           opt->_LCsGPS.push_back(t_lc::GIM);
         }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
+        }
       }
     }
@@ -240,4 +252,7 @@
         if (opt->_pseudoObsIono) {
           opt->_LCsGPS.push_back(t_lc::GIM);
+        }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
         }
       }
@@ -256,4 +271,7 @@
           opt->_LCsGPS.push_back(t_lc::GIM);
         }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
+        }
       }
     }
@@ -268,4 +286,7 @@
         if (opt->_pseudoObsIono) {
           opt->_LCsGLONASS.push_back(t_lc::GIM);
+        }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
         }
       }
@@ -281,4 +302,7 @@
           opt->_LCsGLONASS.push_back(t_lc::GIM);
         }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
+        }
       }
     }
@@ -296,4 +320,7 @@
           opt->_LCsGLONASS.push_back(t_lc::GIM);
         }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
+        }
       }
     }
@@ -309,4 +336,7 @@
           opt->_LCsGalileo.push_back(t_lc::GIM);
         }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
+        }
       }
     }
@@ -320,4 +350,7 @@
         if (opt->_pseudoObsIono) {
           opt->_LCsGalileo.push_back(t_lc::GIM);
+        }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
         }
       }
@@ -336,4 +369,7 @@
           opt->_LCsGalileo.push_back(t_lc::GIM);
         }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
+        }
       }
     }
@@ -349,4 +385,7 @@
           opt->_LCsBDS.push_back(t_lc::GIM);
         }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
+        }
       }
     }
@@ -360,4 +399,7 @@
         if (opt->_pseudoObsIono) {
           opt->_LCsBDS.push_back(t_lc::GIM);
+        }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
         }
       }
@@ -375,4 +417,7 @@
         if (opt->_pseudoObsIono) {
           opt->_LCsBDS.push_back(t_lc::GIM);
+        }
+        if (opt->_pseudoObsTropo) {
+          opt->_LCsGPS.push_back(t_lc::Tz0);
         }
       }
@@ -417,8 +462,10 @@
     opt->_aprSigPhaseBias = 1000.0;
     // TODO: Find realistic values!!!!!!
-    opt->_noiseIon        = 10.0;
+    opt->_noiseIon        = 1.00;
     opt->_noiseCodeBias   = 1.00;
     opt->_noisePhaseBias  = 5.00;
-    opt->_sigmaGIMdiff    = 2.00; //pseudo observation GIM: STEC(ref_sat) - STEC(sat)
+    // pseudo observations
+    opt->_sigmaGIMdiff    = 2.00; // Todo: add to bncWindow
+    opt->_sigmaTz0        = 0.10;
 
     _options << opt;
Index: /trunk/BNC/src/pppOptions.h
===================================================================
--- /trunk/BNC/src/pppOptions.h	(revision 8960)
+++ /trunk/BNC/src/pppOptions.h	(revision 8961)
@@ -53,5 +53,5 @@
   double                  _maxResL1;
   double                  _sigmaGIMdiff;
-  double                  _maxResGIMdiff;
+  double                  _sigmaTz0;
   bool                    _eleWgtCode;
   bool                    _eleWgtPhase;
@@ -77,4 +77,5 @@
   std::vector<t_lc::type> _LCsBDS;
   bool                    _pseudoObsIono;
+  bool                    _pseudoObsTropo;
   bool                    _refSatRequired;
 };
Index: /trunk/BNC/src/pppWidgets.cpp
===================================================================
--- /trunk/BNC/src/pppWidgets.cpp	(revision 8960)
+++ /trunk/BNC/src/pppWidgets.cpp	(revision 8961)
@@ -155,5 +155,5 @@
 #else
   _modelObs->addItems(QString("Ionosphere-free PPP,Uncombined PPP,PPP-RTK,DCM with Code Biases,DCM with Phase Biases").split(","));
-  _pseudoObs->addItems(QString("no,Ionosphere").split(","));
+  _pseudoObs->addItems(QString("no,Ionosphere,Iono+Tropo").split(","));
 #endif
 
