Index: /trunk/BNC/src/rinex/rnxobsfile.h
===================================================================
--- /trunk/BNC/src/rinex/rnxobsfile.h	(revision 7816)
+++ /trunk/BNC/src/rinex/rnxobsfile.h	(revision 7817)
@@ -210,9 +210,20 @@
 
   static void writeEpoch(QTextStream* stream, const t_rnxObsHeader& header, const t_rnxEpo* epo) {
+    if (epo == 0) {
+      return;
+    }
+    t_rnxEpo epoLocal;
+    epoLocal.tt = epo->tt;
+    for (unsigned ii = 0; ii < epo->rnxSat.size(); ii++) {
+      const t_rnxSat& rnxSat = epo->rnxSat[ii];
+      if (header._obsTypes[rnxSat.prn.system()].size() > 0) {
+        epoLocal.rnxSat.push_back(rnxSat);
+      }
+    }
     if (header.version() >= 3.0) {
-      writeEpochV3(stream, header, epo);
+      writeEpochV3(stream, header, &epoLocal);
     }
     else {
-      writeEpochV2(stream, header, epo);
+      writeEpochV2(stream, header, &epoLocal);
     }
   }
