Changeset 6841 in ntrip for trunk/BNC/src/rinex/rnxobsfile.cpp


Ignore:
Timestamp:
May 19, 2015, 11:24:19 AM (9 years ago)
Author:
stuerze
Message:

consideration of obs header etries for phase shifts, GLONASS slots and GLONASS biases during merging of RINEX files

File:
1 edited

Legend:

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

    r6817 r6841  
    244244        in >> type >> value;
    245245        if (type.size())
    246           _gloPhaseBiases[type] = value;
     246          _gloBiases[type] = value;
    247247      }
    248248    }
     
    345345////////////////////////////////////////////////////////////////////////////
    346346void t_rnxObsHeader::set(const t_rnxObsHeader& header, int version,
    347                          const QStringList* useObsTypes) {
     347                         const QStringList* useObsTypes,
     348                         const QStringList* phaseShifts,
     349                         const QStringList* gloBiases,
     350                         const QStringList* gloSlots) {
    348351
    349352  if (version <= 2) {
     
    370373  _comments        = header._comments;
    371374  _usedSystems     = header._usedSystems;
    372   if (_version >= 3.0) {
    373     _phaseShifts    = header._phaseShifts;
    374     _gloPhaseBiases = header._gloPhaseBiases;
    375     _gloSlots       = header._gloSlots;
    376   }
     375
    377376  for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) {
    378377    _wlFactorsL1[iPrn] =  header._wlFactorsL1[iPrn];
     
    456455    }
    457456  }
     457
     458  if (_version >= 3.0) {
     459    // set phase shifts
     460    if (!phaseShifts ||  phaseShifts->empty()) {
     461      _phaseShifts = header._phaseShifts;
     462    }
     463    else {
     464      foreach (const QString &str, *phaseShifts) {
     465        QStringList hlp  = str.split("_", QString::SkipEmptyParts);
     466        QStringList hlp1 = hlp.last().split(":", QString::SkipEmptyParts);
     467        QString type = hlp.first();
     468        double shift = hlp1.first().toDouble();
     469        hlp1.removeFirst();
     470        QStringList &satList = hlp1;
     471        QMap<QString, QPair<double, QStringList> >::iterator it = _phaseShifts.find(type);
     472        if ( it != _phaseShifts.end()) {
     473          it.value().second.append(satList);
     474          it.value().second.removeDuplicates();
     475        }
     476        else {
     477          _phaseShifts.insert(type, QPair<double, QStringList>(shift, satList));
     478        }
     479      }
     480    }
     481    // set GLONASS biases
     482    if (!gloBiases || gloBiases->empty()) {
     483      _gloBiases = header._gloBiases;
     484    }
     485    else {
     486      foreach (const QString &str, *gloBiases) {
     487        QStringList hlp = str.split(":", QString::SkipEmptyParts);
     488        QString type = hlp.first();;
     489        double  value = hlp.last().toDouble();
     490        if (type.size())
     491          _gloBiases[type] = value;
     492      }
     493    }
     494    // set GLONASS slots
     495    if (!gloSlots  || gloSlots->empty()) {
     496      _gloSlots = header._gloSlots;
     497    }
     498    else {
     499      foreach (const QString &str, *gloSlots) {
     500        QStringList hlp = str.split(":", QString::SkipEmptyParts);
     501        QString sat = hlp.first();
     502        int    slot = hlp.last().toInt();
     503        t_prn prn;
     504        prn.set(sat.toStdString());
     505        if(sat.size())
     506          _gloSlots[prn] = slot;
     507      }
     508    }
     509  }
    458510}
    459511
     
    646698  if (_version >= 3.0) {
    647699    QString hlp = "";
    648     QMap<QString, double>::const_iterator it = _gloPhaseBiases.begin();
    649     while (it != _gloPhaseBiases.end()){
     700    QMap<QString, double>::const_iterator it = _gloBiases.begin();
     701    while (it != _gloBiases.end()){
    650702      hlp += QString("%1%2").arg(it.key(), 4).arg(it.value(), 9, 'f', 3);
    651703      it++;
     
    723775}
    724776
     777// Number of GLONASS biases
     778////////////////////////////////////////////////////////////////////////////
     779int t_rnxObsHeader::numGloBiases() const {
     780  return _gloBiases.size();
     781}
     782
     783// Number of GLONASS biases
     784////////////////////////////////////////////////////////////////////////////
     785int t_rnxObsHeader::numGloSlots() const {
     786  return _gloSlots.size();
     787}
     788
    725789// Observation Type (satellite-system specific)
    726790////////////////////////////////////////////////////////////////////////////
     
    743807  }
    744808  return "";
     809}
     810
     811//
     812////////////////////////////////////////////////////////////////////////////
     813QStringList t_rnxObsHeader::phaseShifts() const {
     814  QStringList strList;
     815  QMap<QString, QPair<double, QStringList> >::const_iterator it =  _phaseShifts.begin();
     816  while (it != _phaseShifts.end()) {
     817    strList.append(QString("%1_%2:%3").arg(it.key(), 3).arg(it.value().first, 9, 'f', 3).arg(it.value().second.join("")));
     818    it++;
     819  }
     820  return strList;
     821}
     822
     823//
     824////////////////////////////////////////////////////////////////////////////
     825QStringList t_rnxObsHeader::gloBiases() const {
     826  QStringList strList;
     827  QMap<QString, double>::const_iterator it = _gloBiases.begin();
     828  while (it != _gloBiases.end()) {
     829    strList.append(QString("%1:%2").arg(it.key(), 3).arg(it.value(), 9, 'f', 3));
     830    it++;
     831  }
     832  return strList;
     833}
     834
     835//
     836////////////////////////////////////////////////////////////////////////////
     837QStringList t_rnxObsHeader::gloSlots() const {
     838  QStringList strList;
     839  QMap<t_prn, int>::const_iterator it = _gloSlots.begin();
     840  while (it != _gloSlots.end()){
     841    QString prn(it.key().toString().c_str());
     842    strList.append(QString("%1:%2").arg(prn, 3).arg(it.value()));
     843    it++;
     844  }
     845  return strList;
    745846}
    746847
Note: See TracChangeset for help on using the changeset viewer.