Changeset 6841 in ntrip


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

Location:
trunk/BNC/src/rinex
Files:
3 edited

Legend:

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

    r6809 r6841  
    244244  }
    245245
     246  // Put together all phase shifts
     247  // -----------------------------
     248  QStringList phaseShifts;
     249  if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) {
     250    for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
     251      t_rnxObsFile* obsFile = _rnxObsFiles[ii];
     252      phaseShifts << obsFile->phaseShifts();
     253    }
     254    phaseShifts.removeDuplicates();
     255  }
     256
     257  // Put together all GLONASS biases
     258  // -------------------------------
     259  QStringList gloBiases;
     260  if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) {
     261    for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
     262      t_rnxObsFile* obsFile = _rnxObsFiles[ii];
     263      if (ii == 0 &&  obsFile->numGloBiases() == 4) {
     264        break;
     265      }
     266      else {
     267        gloBiases << obsFile->gloBiases();
     268      }
     269    }
     270    gloBiases.removeDuplicates();
     271  }
     272
     273  // Put together all GLONASS slots
     274  // -----------------------------
     275  QStringList gloSlots;
     276  if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) {
     277    for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
     278      t_rnxObsFile* obsFile = _rnxObsFiles[ii];
     279      if (ii == 0 &&
     280          obsFile->numGloSlots() == signed(t_prn::MAXPRN_GLONASS)) {
     281        break;
     282      }
     283      else {
     284        gloSlots << obsFile->gloSlots();
     285      }
     286    }
     287    gloSlots.removeDuplicates();
     288  }
     289
    246290  // Loop over all input observation files
    247291  // -------------------------------------
     
    254298    }
    255299    if (ii == 0) {
    256       outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes);
     300      outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes,
     301          &phaseShifts, &gloBiases, &gloSlots);
    257302      if (_begTime.valid() && _begTime > outObsFile.startTime()) {
    258303        outObsFile.setStartTime(_begTime);
  • 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
  • trunk/BNC/src/rinex/rnxobsfile.h

    r6815 r6841  
    5353  t_irc       read(QTextStream* stream, int maxLines = 0);
    5454  void        setDefault(const QString& markerName, int version);
    55   void        set(const t_rnxObsHeader& header, int version, const QStringList* useObsTypes = 0);
     55  void        set(const t_rnxObsHeader& header, int version,
     56                  const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0,
     57                  const QStringList* gloBiases = 0, const QStringList* gloSlots = 0);
    5658  int         numSys() const;
    5759  char        system(int iSys) const;
    5860  int         nTypes(char sys) const;
     61  int         numGloBiases() const;
     62  int         numGloSlots() const;
    5963  QString     obsType(char sys, int index, double version = 0.0) const;
     64  QStringList phaseShifts() const;
     65  QStringList gloBiases() const;
     66  QStringList gloSlots() const;
    6067  void        write(QTextStream* stream, const QMap<QString, QString>* txtMap = 0) const;
    6168  bncTime     startTime() const {return _startTime;}
     
    8390  QMap<char, QStringList> _obsTypes;
    8491  QMap<t_prn, int>        _gloSlots;
    85   QMap<QString, double>   _gloPhaseBiases;
     92  QMap<QString, double>   _gloBiases;
    8693  int                     _wlFactorsL1[t_prn::MAXPRN_GPS+1];
    8794  int                     _wlFactorsL2[t_prn::MAXPRN_GPS+1];
     
    134141  char           system(int iSys) const {return _header.system(iSys);}
    135142  int            nTypes(char sys) const {return _header.nTypes(sys);}
     143  int            numGloBiases() const {return _header.numGloBiases();}
     144  int            numGloSlots() const {return _header.numGloSlots();}
    136145  const QString& fileName() const {return _fileName;}
    137146  QString obsType(char sys, int index, double version = 0.0) const {
    138147    return _header.obsType(sys, index, version);
    139148  }
     149  QStringList phaseShifts() const {return _header.phaseShifts();}
     150  QStringList gloBiases() const {return _header.gloBiases();}
     151  QStringList gloSlots() const {return _header.gloSlots();}
    140152  const QString& antennaName() const {return _header._antennaName;}
    141153  const QString& antennaNumber() const {return _header._antennaNumber;}
     
    175187  const t_rnxObsHeader& header() const {return _header;}
    176188
    177   void setHeader(const t_rnxObsHeader& header, int version, const QStringList* useObsTypes = 0) {
    178     _header.set(header, version, useObsTypes);
     189  void setHeader(const t_rnxObsHeader& header, int version,
     190      const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0,
     191      const QStringList* gloBiases = 0, const QStringList* gloSlots = 0) {
     192    _header.set(header, version, useObsTypes, phaseShifts, gloBiases, gloSlots);
    179193  }
    180194
Note: See TracChangeset for help on using the changeset viewer.