Index: /trunk/BNC/src/orbComp/sp3Comp.cpp
===================================================================
--- /trunk/BNC/src/orbComp/sp3Comp.cpp	(revision 6424)
+++ /trunk/BNC/src/orbComp/sp3Comp.cpp	(revision 6425)
@@ -133,5 +133,5 @@
     ++ret;
   }
-  throw "satellite not found " + prn.toString();
+  return -1;
 }
 
@@ -165,11 +165,15 @@
     Matrix       AA(dc.size(), nPar); AA = 0.0;
     ColumnVector ll(dc.size());       ll = 0.0;
-    map<t_prn, double>::const_iterator it; int ii;
-    for (it = dc.begin(), ii = 0; it != dc.end(); it++, ii++) {
+    map<t_prn, double>::const_iterator it; 
+    int ii = -1;
+    for (it = dc.begin(); it != dc.end(); it++) {
       const t_prn& prn = it->first;
-      int index = epochs.size() + satIndex(clkSats, prn);
-      AA[ii][ie]    = 1.0; // epoch-specfic offset (common for all satellites)
-      AA[ii][index] = 1.0; // satellite-specific offset (common for all epochs)
-      ll[ii]        = it->second;
+      if (satIndex(clkSats, prn) != -1) {
+        ++ii;
+        int index = epochs.size() + satIndex(clkSats, prn);
+        AA[ii][ie]    = 1.0; // epoch-specfic offset (common for all satellites)
+        AA[ii][index] = 1.0; // satellite-specific offset (common for all epochs)
+        ll[ii]        = it->second;
+      }
     }
     SymmetricMatrix dN; dN << AA.t() * AA;
@@ -196,7 +200,9 @@
     for (map<t_prn, double>::iterator it = dc.begin(); it != dc.end(); it++) {
       const t_prn& prn = it->first;
-      int  index = epochs.size() + satIndex(clkSats, prn);
-      dc[prn]                      = it->second - xx[ie] - xx[index];
-      stat[prn.toString()]._offset = xx[index];
+      if (satIndex(clkSats, prn) != -1) {
+        int  index = epochs.size() + satIndex(clkSats, prn);
+        dc[prn]                      = it->second - xx[ie] - xx[index];
+        stat[prn.toString()]._offset = xx[index];
+      }
     }
   }
@@ -256,5 +262,5 @@
   }
 
-  set<t_prn> clkSats;
+  set<t_prn> clkSatsAll;
 
   for (unsigned ie = 0; ie < epochs.size(); ie++) {
@@ -280,5 +286,5 @@
         XYZ_to_RSW(x1, vel, dx, dr[prn]);
         if (epoch->_dc.find(prn) != epoch->_dc.end()) {
-          clkSats.insert(prn);
+          clkSatsAll.insert(prn);
         }
       }
@@ -295,5 +301,16 @@
   // Estimate Clock Offsets
   // ----------------------
-  processClocks(clkSats, epochs, stat);
+  string systems = "GR";
+  for (unsigned iSys = 0; iSys < systems.size(); iSys++) {
+    char system = systems[iSys];
+    set<t_prn> clkSats;
+    set<t_prn>::const_iterator it;
+    for (it = clkSatsAll.begin(); it != clkSatsAll.end(); it++) {
+      if (it->system() == system) {
+        clkSats.insert(*it);
+      }
+    }
+    processClocks(clkSats, epochs, stat);
+  }
 
   // Print Residuals
