Index: trunk/BNC/src/PPP/pppSatObs.cpp
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.cpp	(revision 6028)
+++ trunk/BNC/src/PPP/pppSatObs.cpp	(revision 6029)
@@ -244,4 +244,84 @@
       retVal += it->second * _obs[tFreq]->_phase * t_CST::lambda(tFreq, _channel);
     }
+  }
+
+  return retVal;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+double t_pppSatObs::lambda(t_lc::type tLC) const {
+
+  double f1 = t_CST::freq(_fType1, _channel);
+  double f2 = t_CST::freq(_fType2, _channel);
+
+  if      (tLC == t_lc::l1) {
+    return t_CST::c / f1;
+  }
+  else if (tLC == t_lc::l2) {
+    return t_CST::c / f2;
+  }
+  else if (tLC == t_lc::lIF) {
+    return t_CST::c / (f1 + f2);
+  }
+  else if (tLC == t_lc::MW) {
+    return t_CST::c / (f1 - f2);
+  }
+  else if (tLC == t_lc::CL) {
+    return t_CST::c / f1 / 2.0;
+  }
+
+  return 0.0;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+double t_pppSatObs::sigma(t_lc::type tLC) const {
+
+  map<t_frequency::type, double> codeCoeff;
+  map<t_frequency::type, double> phaseCoeff;
+  lcCoeff(tLC, codeCoeff, phaseCoeff);
+
+  double retVal = 0.0;
+
+  map<t_frequency::type, double>::const_iterator it;
+  for (it = codeCoeff.begin(); it != codeCoeff.end(); it++) {
+    retVal += it->second * it->second * OPT->_sigmaC1 * OPT->_sigmaC1;
+  }
+  for (it = phaseCoeff.begin(); it != phaseCoeff.end(); it++) {
+    retVal += it->second * it->second * OPT->_sigmaL1 * OPT->_sigmaL1;
+  }
+  
+  retVal = sqrt(retVal);    
+
+  // Elevation-Dependent Weighting
+  // -----------------------------
+  double cEle = 1.0;
+  if ( (OPT->_eleWgtCode  && t_lc::includesCode(tLC)) ||
+       (OPT->_eleWgtPhase && t_lc::includesPhase(tLC)) ) {
+    double eleD = eleSat()*180.0/M_PI;
+    double hlp  = fabs(90.0 - eleD);
+    cEle = (1.0 + hlp*hlp*hlp*0.000004);
+  }
+
+  return cEle * retVal;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+double t_pppSatObs::maxRes(t_lc::type tLC) const {
+
+  map<t_frequency::type, double> codeCoeff;
+  map<t_frequency::type, double> phaseCoeff;
+  lcCoeff(tLC, codeCoeff, phaseCoeff);
+
+  double retVal = 0.0;
+
+  map<t_frequency::type, double>::const_iterator it;
+  for (it = codeCoeff.begin(); it != codeCoeff.end(); it++) {
+    retVal += it->second * OPT->_maxResC1;
+  }
+  for (it = phaseCoeff.begin(); it != phaseCoeff.end(); it++) {
+    retVal += it->second * OPT->_maxResL1;
   }
 
@@ -434,73 +514,4 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-double t_pppSatObs::lambda(t_lc::type tLC) const {
-
-  if      (tLC == t_lc::l1) {
-    return t_CST::c / _f1;
-  }
-  else if (tLC == t_lc::l2) {
-    return t_CST::c / _f2;
-  }
-  else if (tLC == t_lc::lIF) {
-    return t_CST::c / (_f1 + _f2);
-  }
-  else if (tLC == t_lc::MW) {
-    return t_CST::c / (_f1 - _f2);
-  }
-  else if (tLC == t_lc::CL) {
-    return t_CST::c / _f1 / 2.0;
-  }
-
-  return 0.0;
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-double t_pppSatObs::sigma(t_lc::type tLC) const {
-
-  ColumnVector sig(4);
-  sig(1) = OPT->_sigmaL1;
-  sig(2) = OPT->_sigmaL1;
-  sig(3) = OPT->_sigmaC1;
-  sig(4) = OPT->_sigmaC1;
-
-  ColumnVector coeff(4);
-  lc(tLC, sig(1), sig(2), sig(3), sig(4), &coeff);
-
-  ColumnVector sp = SP(sig, coeff); // Schur product
-
-  // Elevation-Dependent Weighting
-  // -----------------------------
-  double cEle = 1.0;
-  if ( (OPT->_eleWgtCode  && t_lc::includesCode(tLC)) ||
-       (OPT->_eleWgtPhase && t_lc::includesPhase(tLC)) ) {
-    double eleD = eleSat()*180.0/M_PI;
-    double hlp  = fabs(90.0 - eleD);
-    cEle = (1.0 + hlp*hlp*hlp*0.000004);
-  }
-
-  return cEle * sp.norm_Frobenius();
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-double t_pppSatObs::maxRes(t_lc::type tLC) const {
-
-  ColumnVector res(4);
-  res(1) = OPT->_maxResL1;
-  res(2) = OPT->_maxResL1;
-  res(3) = OPT->_maxResC1;
-  res(4) = OPT->_maxResC1;
-
-  ColumnVector coeff(4);
-  lc(tLC, res(1), res(2), res(3), res(4), &coeff);
-
-  ColumnVector sp = SP(res, coeff); // Schur product
-
-  return sp.norm_Frobenius();
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
 void t_pppSatObs::setRes(t_lc::type tLC, double res) {
   _res[tLC] = res;
