Index: trunk/BNC/src/PPP/pppSatObs.cpp
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.cpp	(revision 9483)
+++ trunk/BNC/src/PPP/pppSatObs.cpp	(revision 9485)
@@ -397,4 +397,31 @@
   _model._azSat  = atan2(neu[1], neu[0]);
 
+  // Sun unit vector
+  ColumnVector xSun = t_astro::Sun(_time.mjddec());
+  xSun /= xSun.norm_Frobenius();
+
+  // Satellite unit vectors sz, sy, sx
+  ColumnVector sz = -rSat / rSat.norm_Frobenius();
+  ColumnVector sy = crossproduct(sz, xSun);
+  ColumnVector sx = crossproduct(sy, sz);
+
+  sx /= sx.norm_Frobenius();
+  sy /= sy.norm_Frobenius();
+
+  // LOS unit vector satellite --> receiver
+  ColumnVector rho = rRec - rSat;
+  rho /= rho.norm_Frobenius();
+
+  // LOS vector in satellite frame
+  ColumnVector u(3);
+  u(1) = dotproduct(sx, rho);
+  u(2) = dotproduct(sy, rho);
+  u(3) = dotproduct(sz, rho);
+
+  // Azimuth and elevation in satellite antenna frame
+  _model._elTx = atan2(u(3),sqrt(pow(u(2),2)+pow(u(1),2)));
+  _model._azTx = atan2(u(2),u(1));
+
+
   // Satellite Clocks
   // ----------------
@@ -423,6 +450,23 @@
       t_frequency::type frqType = static_cast<t_frequency::type>(ii);
       bool found;
-      _model._antPCO[ii] = PPP_CLIENT->antex()->rcvCorr(station->antName(), frqType,
-                                                        _model._eleSat, _model._azSat, found);
+      QString prn(_prn.toString().c_str());
+      _model._antPCO[ii]  = PPP_CLIENT->antex()->rcvCorr(station->antName(), frqType, _model._eleSat, _model._azSat, found);
+      _model._antPCO[ii] += PPP_CLIENT->antex()->satCorr(prn, frqType,  _model._elTx, _model._azTx, found);
+      if (OPT->_isAPC) {
+        // the PCOs as given in the satellite antenna correction for all frequencies
+        // have to be reduced by the PCO of the reference frequency
+        if      (_prn.system() == 'G') {
+          _model._antPCO[ii] -= PPP_CLIENT->antex()->satCorr(prn, t_frequency::G1, _model._elTx, _model._azTx, found);
+        }
+        else if (_prn.system() == 'R') {
+          _model._antPCO[ii] -= PPP_CLIENT->antex()->satCorr(prn, t_frequency::R1, _model._elTx, _model._azTx, found);
+        }
+        else if (_prn.system() == 'E') {
+          _model._antPCO[ii] -= PPP_CLIENT->antex()->satCorr(prn, t_frequency::E1, _model._elTx, _model._azTx, found);
+        }
+        else if (_prn.system() == 'C') {
+          _model._antPCO[ii] -= PPP_CLIENT->antex()->satCorr(prn, t_frequency::C2, _model._elTx, _model._azTx, found);
+        }
+      }
     }
   }
Index: trunk/BNC/src/PPP/pppSatObs.h
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.h	(revision 9483)
+++ trunk/BNC/src/PPP/pppSatObs.h	(revision 9485)
@@ -92,4 +92,6 @@
       _eleSat    = 0.0;
       _azSat     = 0.0;
+      _elTx      = 0.0;
+      _azTx      = 0.0;
       _recClkM   = 0.0;
       _satClkM   = 0.0;
@@ -113,4 +115,6 @@
     double _eleSat;
     double _azSat;
+    double _elTx;
+    double _azTx;
     double _recClkM;
     double _satClkM;
Index: trunk/BNC/src/PPP_SSR_I/pppFilter.cpp
===================================================================
--- trunk/BNC/src/PPP_SSR_I/pppFilter.cpp	(revision 9483)
+++ trunk/BNC/src/PPP_SSR_I/pppFilter.cpp	(revision 9485)
@@ -386,5 +386,5 @@
 
     // Sun unit vector
-    ColumnVector xSun = t_astro::Sun(satData->tt.mjd());
+    ColumnVector xSun = t_astro::Sun(satData->tt.mjddec());
     xSun /= xSun.norm_Frobenius();
 
Index: trunk/BNC/src/pppWidgets.cpp
===================================================================
--- trunk/BNC/src/pppWidgets.cpp	(revision 9483)
+++ trunk/BNC/src/pppWidgets.cpp	(revision 9485)
@@ -206,5 +206,5 @@
   // WhatsThis, PPP (2)
   // ------------------
-  _staTable->setWhatsThis(tr("<p>Specify values for Sigma and white Noise of the Stations North, East and Height coordinate components in meters. Specify also a Sigma in meters for a priori model based Tropospheric delays and a Sigma in meters per second for the delay's Noise.</p><p>Specifying one record per Station is mandatory. BNC will only process data for stations which are listed here. To define a station, specify the 'Mountpoint' when in 'Real-Time Streams' mode or the 4-character station ID when in 'RINEX Files' mode.</p><p>'Sigma' is meant to describe the uncertainty of a single coordinate or tropospheric delay estimated for one epoch. 'Noise' is meant to describe the variation of estimates from epoch to epoch.</p><p><ul><li>A Sigma of 100.0 meters may be an appropriate choice e.g. for the initial N/E/H coordinates. However, this value may be significantly smaller (i.e. 0.01) for stations with well-known a priori coordinates.</li><li>A Noise of 100.0 meters for the estimated N/E/H coordinates may also be appropriate considering the potential movement of a rover position.</li><li>A value of 0.1 meters may be an appropriate Sigma for the a priori model based Tropospheric delay estimation.</li><li>Specify a Noise to describe the expected variation of the tropospheric effect over time. Supposing 1Hz observation data, specifying a value of 3e-6 would mean that the tropospheric effect may vary 3600 * 3e-6 = 0.01 meters per hour.</li><li>Specify a Noise to describe the expected variation of the ionospheric effect over time.</li></ul></p><p>You can also specify a 'NMEA Port' to output coordinates in NMEA format through an IP port of your local host. <i>[key: PPP/staTable]</i></p>"));
+  _staTable->setWhatsThis(tr("<p>Specify values for Sigma and white Noise of the Stations North, East and Height coordinate components in meters. Specify also a Sigma in meters for a priori model based Tropospheric delays and a Sigma in meters per second for the delay's Noise.</p><p>Specifying one record per Station is mandatory. BNC will only process data for stations which are listed here. To define a station, specify the 'Mountpoint' when in 'Real-Time Streams' mode or the 4-character station ID when in 'RINEX Files' mode.</p><p>'Sigma' is meant to describe the uncertainty of a single coordinate or tropospheric delay estimated for one epoch. 'Noise' is meant to describe the variation of estimates from epoch to epoch.</p><p><ul><li>A Sigma of 100.0 meters may be an appropriate choice e.g. for the initial N/E/H coordinates. However, this value may be significantly smaller (i.e. 0.01) for stations with well-known a priori coordinates.</li><li>A Noise of 100.0 meters for the estimated N/E/H coordinates may also be appropriate considering the potential movement of a rover position.</li><li>A value of 0.1 meters may be an appropriate Sigma for the a priori model based Tropospheric delay estimation.</li><li>Specify a Noise to describe the expected variation of the tropospheric effect over time. Supposing 1Hz observation data, specifying a value of 3e-6 would mean that the tropospheric effect may vary 3600 * 3e-6 = 0.01 meters per hour.</li><li>Specify a Noise to describe the expected variation of the ionospheric effect over time. Supposing 1Hz observation data, specifying a value of 6e-4 would mean that the ionospheric effect may vary 1800 * 5.5e-4 = 1.0 meters per half an hour.</li></ul></p><p>You can also specify a 'NMEA Port' to output coordinates in NMEA format through an IP port of your local host. <i>[key: PPP/staTable]</i></p>"));
 
   // WhatsThis, PPP (3)
@@ -583,5 +583,5 @@
      if (iCol == 7) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.1"));
      if (iCol == 8) _staTable->setItem(iRow, iCol, new QTableWidgetItem("3e-6"));
-     if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.10"));
+     if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("6e-4"));
      if (iCol == 10) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0"));
   }
