Changeset 10945 in ntrip for trunk/BNC/src/rinex/reqcedit.cpp


Ignore:
Timestamp:
Jun 24, 2026, 12:43:35 PM (29 hours ago)
Author:
stuerze
Message:

Added a Minimum Elevation parameter to BNC's RINEX Editing & QC feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/reqcedit.cpp

    r10630 r10945  
    7373  }
    7474  _samplingRate   = settings.value("reqcSampling").toString().split("sec").first().toDouble();
     75  _minEle         = settings.value("reqcMinEle").toDouble();
    7576  _begTime        = bncTime(settings.value("reqcStartDateTime").toString().toLatin1().data());
    7677  _endTime        = bncTime(settings.value("reqcEndDateTime").toString().toLatin1().data());
     
    223224  t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _logStream);
    224225
     226  // Read Ephemerides (needed to apply the elevation mask)
     227  // ------------------------------------------------------
     228  if (_minEle > 0.0 && _ephs.isEmpty()) {
     229    t_reqcEdit::readEphemerides(_navFileNames, _ephs, _logStream, _checkEph);
     230  }
     231
    225232  // Initialize output observation file
    226233  // ----------------------------------
     
    361368        if (sec % (int(_samplingRate)*10) == 0) {
    362369          applyLLI(obsFile, epo);
     370          if (_minEle > 0.0) {
     371            applyElevationMask(obsFile, epo);
     372          }
    363373          outObsFile.writeEpoch(epo);
    364374        }
     
    518528
    519529  _lli.clear();
     530}
     531
     532// Remove satellites below the minimum elevation angle
     533////////////////////////////////////////////////////////////////////////////
     534void t_reqcEdit::applyElevationMask(const t_rnxObsFile* obsFile,
     535                                    t_rnxObsFile::t_rnxEpo* epo) {
     536
     537  const ColumnVector& xyzSta = obsFile->xyz();
     538  if (xyzSta.size() != 3 || (xyzSta(1) == 0.0 && xyzSta(2) == 0.0 && xyzSta(3) == 0.0)) {
     539    return;
     540  }
     541
     542  std::vector<t_rnxObsFile::t_rnxSat> keptSats;
     543  for (unsigned iSat = 0; iSat < epo->rnxSat.size(); iSat++) {
     544    const t_rnxObsFile::t_rnxSat& rnxSat = epo->rnxSat[iSat];
     545
     546    t_eph* eph = 0;
     547    for (int ie = 0; ie < _ephs.size(); ie++) {
     548      if (_ephs[ie]->prn() == rnxSat.prn) {
     549        eph = _ephs[ie];
     550        break;
     551      }
     552    }
     553    if (eph) {
     554      ColumnVector xc(6);
     555      ColumnVector vv(3);
     556      if (eph->getCrd(epo->tt, xc, vv, false) == success) {
     557        double rho, eleSat, azSat;
     558        topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
     559        if (eleSat * 180.0/M_PI < _minEle) {
     560          continue;
     561        }
     562      }
     563    }
     564    keptSats.push_back(rnxSat);
     565  }
     566  epo->rnxSat = keptSats;
    520567}
    521568
Note: See TracChangeset for help on using the changeset viewer.