Index: /trunk/BNC/CHANGELOG.md
===================================================================
--- /trunk/BNC/CHANGELOG.md	(revision 10944)
+++ /trunk/BNC/CHANGELOG.md	(revision 10945)
@@ -3,4 +3,5 @@
 - ADDED: PPP-AR Algorithm description is now part of BNCs help contents
 - ADDED: L1C/B (RINEX code: '1E') in QZSS Signal ID Mapping
+- ADDED: Minimum Elevation parameter to BNC's RINEX Editing & QC feature [(#195)](https://software.rtcm-ntrip.org/ticket/195)
 - FIXED: BNC is now able to work with com ports with higher numbers, e.g. COM11 or COM17  [(#205)](https://software.rtcm-ntrip.org/ticket/205)
 - FIXED: Handling of ionospheric constraints [(#220)](https://software.rtcm-ntrip.org/ticket/220)
Index: /trunk/BNC/src/bnchelp.html
===================================================================
--- /trunk/BNC/src/bnchelp.html	(revision 10944)
+++ /trunk/BNC/src/bnchelp.html	(revision 10945)
@@ -128,9 +128,10 @@
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.2 <a href="#reqcinp">Input Files</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.3 <a href="#reqcout">Output Files</a><br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.4 <a href="#reqclog">Logfiles</a><br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.5 <a href="#reqcplots">Plots for Signals</a><br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.6 <a href="#reqcdir">Directory for Plots</a><br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.7 <a href="#reqcedit">Set Edit Options</a><br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.8 <a href="#reqccommand">Command Line, No Window</a><br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.4 <a href="#reqcminele">Minimum Elevation</a><br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.5 <a href="#reqclog">Logfiles</a><br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.6 <a href="#reqcplots">Plots for Signals</a><br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.7 <a href="#reqcdir">Directory for Plots</a><br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.8 <a href="#reqcedit">Set Edit Options</a><br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.6.9 <a href="#reqccommand">Command Line, No Window</a><br>
 &nbsp; &nbsp; &nbsp; 2.7 <a href="#sp3comp"><b>SP3 Comparison</b></a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.7.1 <a href="#sp3input">Input SP3 Files</a><br>
@@ -318,10 +319,10 @@
   <tr><td>7</td><td>BNC's 'Network' panel configured to ignore eventually occurring SSL error messages</td><td>2.2.2</td></tr>
   <tr><td>8</td><td>BNC translating incoming RTCM Version 3 Observation streams to 15 min RINEX Version 4 Observation files</td><td>2.4</td></tr>
-  <tr><td>9</td><td>Example for creating RINEX quality check analysis graphics output with BNC</td><td>2.6.5</td></tr>
-  <tr><td>10</td><td>Example for satellite availability, elevation and PDOP plots as a result of a RINEX quality check analysis with BNC</td><td>2.6.5</td></tr>
-  <tr><td>11</td><td>Sky plot examples for multipath, part of RINEX quality check analysis with BNC</td><td>2.6.5</td></tr>
-  <tr><td>12</td><td>Sky plot examples for signal-to-noise ratio, part of RINEX quality check analysis with BNC</td><td>2.6.5</td></tr>
-  <tr><td>13</td><td>Example for BNC's 'RINEX Editing Options' window</td><td>2.6.7</td></tr>
-  <tr><td>14</td><td>Example for RINEX file concatenation with BNC</td><td>2.6.7</td></tr>
+  <tr><td>9</td><td>Example for creating RINEX quality check analysis graphics output with BNC</td><td>2.6.6</td></tr>
+  <tr><td>10</td><td>Example for satellite availability, elevation and PDOP plots as a result of a RINEX quality check analysis with BNC</td><td>2.6.6</td></tr>
+  <tr><td>11</td><td>Sky plot examples for multipath, part of RINEX quality check analysis with BNC</td><td>2.6.6</td></tr>
+  <tr><td>12</td><td>Sky plot examples for signal-to-noise ratio, part of RINEX quality check analysis with BNC</td><td>2.6.6</td></tr>
+  <tr><td>13</td><td>Example for BNC's 'RINEX Editing Options' window</td><td>2.6.8</td></tr>
+  <tr><td>14</td><td>Example for RINEX file concatenation with BNC</td><td>2.6.8</td></tr>
   <tr><td>15</td><td>Example for comparing two SP3 files with satellite orbit and clock data using BNC</td><td>2.7</td></tr>
   <tr><td>16</td><td>Graphical results from an example comparison of two SP3 files with satellite orbit and clock data using BNC</td><td>2.7.3</td></tr>
@@ -1926,5 +1927,15 @@
 </p>
 
-<p><h4 id="reqclog">2.6.4 Logfile - optional</h4></p>
+<p><h4 id="reqcminele">2.6.4 Minimum Elevation - optional</h4></p>
+<p>
+Select a minimum for satellite elevation angles. Observations from a satellite not reaching or exceeding this minimum
+elevation will be excluded, no matter whether 'Action' is set to 'Edit/Concatenate' or 'Analyze'. Determining a satellite's
+elevation requires specifying a RINEX Navigation input file, see section 'Input Files'.
+</p>
+<p>
+Default is '0 deg', meaning that no elevation mask is applied and all observations are used regardless of the involved satellite's elevation angle.
+</p>
+
+<p><h4 id="reqclog">2.6.5 Logfile - optional</h4></p>
 <p>
 Specify the name of a logfile to save information on RINEX file Editing/Concatenation or Analysis. Default is an empty option field,
@@ -2254,5 +2265,5 @@
 </p>
 
-<p><h4 id="reqcplots">2.6.5 Plots for Signals - mandatory if 'Action' is set to 'Analyze'</h4></p>
+<p><h4 id="reqcplots">2.6.6 Plots for Signals - mandatory if 'Action' is set to 'Analyze'</h4></p>
 <p>
 BNC can produce plots for multipath, signal-to-noise ratio, satellite availability, satellite elevation, and PDOP values.
@@ -2292,5 +2303,5 @@
 <p>Figure 12: Sky plot examples for signal-to-noise ratio, part of RINEX quality check analysis with BNC</p>
 
-<p><h4 id="reqcdir">2.6.6 Directory for Plots - optional if 'Action' is set to 'Analyze'</h4></p>
+<p><h4 id="reqcdir">2.6.7 Directory for Plots - optional if 'Action' is set to 'Analyze'</h4></p>
 <p>
 If 'Analyze' is selected, specifying the path to a directory where plot files will be saved is optional.
@@ -2299,5 +2310,5 @@
 </p>
 
-<p><h4 id="reqcedit">2.6.7 Set Edit Options - mandatory if 'Action' is set to 'Edit/Concatenate'</h4></p>
+<p><h4 id="reqcedit">2.6.8 Set Edit Options - mandatory if 'Action' is set to 'Edit/Concatenate'</h4></p>
 <p>
 Once the 'Edit/Concatenate' action is selected, you have to 'Set Edit Options'.
@@ -2353,5 +2364,5 @@
 <p>Figure 14: Example for RINEX file concatenation with BNC</p>
 
-<p><h4 id="reqccommand">2.6.8 Command Line, No Window - optional</h4></p>
+<p><h4 id="reqccommand">2.6.9 Command Line, No Window - optional</h4></p>
 <p>
 BNC applies options from the configuration file but allows updating every one of them on the command line
@@ -2431,4 +2442,5 @@
 <tr><td>reqcOutObsFile</td><td></td><td>RINEX Observation output file</td></tr>
 <tr><td>reqcOutNavFile</td><td></td><td>RINEX Navigation output file</td></tr>
+<tr><td>reqcMinEle</td><td></td><td>Minimum Elevation</td></tr>
 <tr><td>reqcOutLogFile</td><td></td><td>Logfile</td></tr>
 <tr><td>reqcLogSummaryOnly</td><td></td><td>Summary of Logfile</td></tr>
@@ -6706,4 +6718,5 @@
    reqcOutObsFile        {Output observations file, full path [character string]}
    reqcOutNavFile        {Output navigation file, full path [character string]}
+   reqcMinEle            {Minimum satellite elevation in degrees [integer number: 0-90]}
    reqcOutLogFile        {Output logfile, full path [character string]}
    reqcLogSummaryOnly    {Output only summary of logfile [integer number: 0=no,2=yes]}
Index: /trunk/BNC/src/bncmain.cpp
===================================================================
--- /trunk/BNC/src/bncmain.cpp	(revision 10944)
+++ /trunk/BNC/src/bncmain.cpp	(revision 10945)
@@ -166,4 +166,5 @@
         "   reqcOutObsFile        {Output observations file, full path [character string]}\n"
         "   reqcOutNavFile        {Output navigation file, full path [character string]}\n"
+        "   reqcMinEle            {Minimum satellite elevation in degrees [integer number: 0-90]}\n"
         "   reqcOutLogFile        {Output logfile, full path [character string]}\n"
         "   reqcLogSummaryOnly    {Output only summary of logfile [integer number: 0=no,2=yes]}\n"
Index: /trunk/BNC/src/bncwindow.cpp
===================================================================
--- /trunk/BNC/src/bncwindow.cpp	(revision 10944)
+++ /trunk/BNC/src/bncwindow.cpp	(revision 10945)
@@ -1266,4 +1266,11 @@
   _reqcLogSummaryOnly->setCheckState(Qt::CheckState(settings.value("reqcLogSummaryOnly").toInt()));
 
+  _reqcMinEle = new QSpinBox();
+  _reqcMinEle->setMinimum(0);
+  _reqcMinEle->setMaximum(90);
+  _reqcMinEle->setSingleStep(1);
+  _reqcMinEle->setSuffix(" deg");
+  _reqcMinEle->setValue(settings.value("reqcMinEle").toInt());
+
   ir = 0;
   reqcLayout->addWidget(new QLabel("RINEX file editing, concatenation and quality check.<br>"), ir, 0, 1, 8);
@@ -1293,4 +1300,7 @@
   reqcLayout->addWidget(new QLabel("  Nav"), ir, 4);
   ++ir;
+  reqcLayout->addWidget(new QLabel("Minimum Elevation"), ir, 0);
+  reqcLayout->addWidget(_reqcMinEle, ir, 1);
+  ++ir;
   reqcLayout->addWidget(new QLabel("Logfile"), ir, 0);
   reqcLayout->addWidget(_reqcOutLogLineEdit, ir, 1);
@@ -1543,4 +1553,5 @@
   _reqcOutNavLineEdit->setWhatsThis(tr("<p>Specify the full path to a RINEX Navigation output file.</p><p>Default is an empty option field, meaning that no RINEX Navigation output file will be produced. <i>[key: reqcOutNavFile]</i></p>"));
   _reqcOutLogLineEdit->setWhatsThis(tr("<p>Specify the full path to a logfile.</p><p>Default is an empty option field, meaning that no 'RINEX Editing & QC' logfile will be produced. <i>[key: reqcOutLogFile]</i></p>"));
+  _reqcMinEle->setWhatsThis(tr("<p>Select a Minimum satellite Elevation.</p><p>BNC will ignore an observation if the associated satellite Elevation does not reach or exceed this minimum. This requires a RINEX Navigation input file to compute satellite elevations.</p><p>Default is '0 deg' meaning that no elevation mask is applied. <i>[key: reqcMinEle]</i></p>"));
   _reqcLogSummaryOnly->setWhatsThis(tr("<p>By default BNC produces a detailed 'Logfile' providing all information resulting from editing or analyzing RINEX data. If that is too much information, you can limit the logfile content to a short summary.</p><p>Tick 'Summary only' to suppress full logfile output and instead produce a logfile containing only summary information. <i>[key: reqcLogSummaryOnly]</i></p>"));
   _reqcPlotDirLineEdit->setWhatsThis(tr("<p>Specify a directory for saving plots in PNG format.</p><p>Default is an empty option field, meaning that plots will not be saved on disk. <i>[key: reqcPlotDir]</i></p>"));
@@ -1893,4 +1904,5 @@
   delete _reqcSkyPlotSignals;
   delete _reqcLogSummaryOnly;
+  delete _reqcMinEle;
   delete _reqcEditOptionButton;
   delete _sp3CompFileChooser;
@@ -2392,4 +2404,5 @@
   settings.setValue("reqcSkyPlotSignals", _reqcSkyPlotSignals->text());
   settings.setValue("reqcLogSummaryOnly", _reqcLogSummaryOnly->checkState());
+  settings.setValue("reqcMinEle", _reqcMinEle->value());
   // SP3 Comparison
   settings.setValue("sp3CompFile", _sp3CompFileChooser->fileName());
@@ -3015,4 +3028,5 @@
     enableWidget(enable, _reqcNavFileChooser);
     enableWidget(enable, _reqcOutLogLineEdit);
+    enableWidget(enable, _reqcMinEle);
     enableWidget(enable && enable10, _reqcEditOptionButton);
     enableWidget(enable && enable10, _reqcOutObsLineEdit);
Index: /trunk/BNC/src/bncwindow.h
===================================================================
--- /trunk/BNC/src/bncwindow.h	(revision 10944)
+++ /trunk/BNC/src/bncwindow.h	(revision 10945)
@@ -164,4 +164,5 @@
     QLineEdit* _reqcSkyPlotSignals;
     QCheckBox* _reqcLogSummaryOnly;
+    QSpinBox*  _reqcMinEle;
 
     qtFileChooser* _sp3CompFileChooser;
Index: /trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10944)
+++ /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10945)
@@ -68,4 +68,5 @@
   _obsFileNames    = settings.value("reqcObsFile").toString().split(",", Qt::SkipEmptyParts);
   _navFileNames    = settings.value("reqcNavFile").toString().split(",", Qt::SkipEmptyParts);
+  _minEle          = settings.value("reqcMinEle").toDouble();
   _reqcPlotSignals = settings.value("reqcSkyPlotSignals").toString();
   _defaultSignalTypes << "G:1&2&5" << "R:1&2&3" << "J:1&2" << "E:1&5" << "S:1&5" << "C:2&6" << "I:5&9";
@@ -209,4 +210,8 @@
         t_qcSat& qcSat = qcEpo._qcSat[satObs._prn];
         setQcObs(qcEpo._epoTime, xyzSta, satObs, lastObsTime, qcSat);
+        if (qcSat._eleSet && qcSat._eleDeg < _minEle) {
+          qcEpo._qcSat.remove(satObs._prn);
+          continue;
+        }
         updateQcSat(qcSat, _qcFile._qcSatSum[satObs._prn]);
       }
@@ -986,5 +991,5 @@
           double rho, eleSat, azSat;
           topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
-          if (round(eleSat * 180.0/M_PI) >= 0.0) {
+          if (round(eleSat * 180.0/M_PI) >= _minEle) {
             numExpObs++;
           }
Index: /trunk/BNC/src/rinex/reqcanalyze.h
===================================================================
--- /trunk/BNC/src/rinex/reqcanalyze.h	(revision 10944)
+++ /trunk/BNC/src/rinex/reqcanalyze.h	(revision 10945)
@@ -212,4 +212,5 @@
   QVector<t_rnxObsFile*>     _rnxObsFiles;
   QStringList                _navFileNames;
+  double                     _minEle;
   QString                    _reqcPlotSignals;
   QMap<char, QVector<char> > _signalTypes;
Index: /trunk/BNC/src/rinex/reqcedit.cpp
===================================================================
--- /trunk/BNC/src/rinex/reqcedit.cpp	(revision 10944)
+++ /trunk/BNC/src/rinex/reqcedit.cpp	(revision 10945)
@@ -73,4 +73,5 @@
   }
   _samplingRate   = settings.value("reqcSampling").toString().split("sec").first().toDouble();
+  _minEle         = settings.value("reqcMinEle").toDouble();
   _begTime        = bncTime(settings.value("reqcStartDateTime").toString().toLatin1().data());
   _endTime        = bncTime(settings.value("reqcEndDateTime").toString().toLatin1().data());
@@ -223,4 +224,10 @@
   t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _logStream);
 
+  // Read Ephemerides (needed to apply the elevation mask)
+  // ------------------------------------------------------
+  if (_minEle > 0.0 && _ephs.isEmpty()) {
+    t_reqcEdit::readEphemerides(_navFileNames, _ephs, _logStream, _checkEph);
+  }
+
   // Initialize output observation file
   // ----------------------------------
@@ -361,4 +368,7 @@
         if (sec % (int(_samplingRate)*10) == 0) {
           applyLLI(obsFile, epo);
+          if (_minEle > 0.0) {
+            applyElevationMask(obsFile, epo);
+          }
           outObsFile.writeEpoch(epo);
         }
@@ -518,4 +528,41 @@
 
   _lli.clear();
+}
+
+// Remove satellites below the minimum elevation angle
+////////////////////////////////////////////////////////////////////////////
+void t_reqcEdit::applyElevationMask(const t_rnxObsFile* obsFile,
+                                    t_rnxObsFile::t_rnxEpo* epo) {
+
+  const ColumnVector& xyzSta = obsFile->xyz();
+  if (xyzSta.size() != 3 || (xyzSta(1) == 0.0 && xyzSta(2) == 0.0 && xyzSta(3) == 0.0)) {
+    return;
+  }
+
+  std::vector<t_rnxObsFile::t_rnxSat> keptSats;
+  for (unsigned iSat = 0; iSat < epo->rnxSat.size(); iSat++) {
+    const t_rnxObsFile::t_rnxSat& rnxSat = epo->rnxSat[iSat];
+
+    t_eph* eph = 0;
+    for (int ie = 0; ie < _ephs.size(); ie++) {
+      if (_ephs[ie]->prn() == rnxSat.prn) {
+        eph = _ephs[ie];
+        break;
+      }
+    }
+    if (eph) {
+      ColumnVector xc(6);
+      ColumnVector vv(3);
+      if (eph->getCrd(epo->tt, xc, vv, false) == success) {
+        double rho, eleSat, azSat;
+        topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
+        if (eleSat * 180.0/M_PI < _minEle) {
+          continue;
+        }
+      }
+    }
+    keptSats.push_back(rnxSat);
+  }
+  epo->rnxSat = keptSats;
 }
 
Index: /trunk/BNC/src/rinex/reqcedit.h
===================================================================
--- /trunk/BNC/src/rinex/reqcedit.h	(revision 10944)
+++ /trunk/BNC/src/rinex/reqcedit.h	(revision 10945)
@@ -63,4 +63,5 @@
   void rememberLLI(const t_rnxObsFile* obsFile, const t_rnxObsFile::t_rnxEpo* epo);
   void applyLLI(const t_rnxObsFile* obsFile, t_rnxObsFile::t_rnxEpo* epo);
+  void applyElevationMask(const t_rnxObsFile* obsFile, t_rnxObsFile::t_rnxEpo* epo);
   void addRnxConversionDetails(const t_rnxObsFile* obsFile, QMap<QString, QString>& txtMap);
 
@@ -76,4 +77,5 @@
   double                 _rnxVersion;
   double                 _samplingRate;
+  double                 _minEle;
   bncTime                _begTime;
   bncTime                _endTime;
