Changeset 10979 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Jul 31, 2026, 9:44:38 AM (4 weeks ago)
Author:
stuerze
Message:

RINEX version 2 files can be written now from skl files containing RINEX version 3/4 observation types too

Location:
trunk/BNC/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnchelp.html

    r10970 r10979  
    16911691<p>Note that a skeleton file contains RINEX header information such as receiver and antenna types. In case of stream conversion to RINEX Version 3, a skeleton file should also contain information on potentially available observation types. A missing skeleton file will force BNC to only save a default set of RINEX 3 observation types.
    16921692</p>
     1693<p>
     1694A skeleton file carrying only RINEX Version 2 style observation types (2-character codes, e.g. 'C1', 'L1') cannot supply the tracking-mode
     1695attribute a RINEX Version 3/4 header needs, so BNC will not use such a skeleton when producing Version 3/4 files. It is treated the same
     1696way as a missing skeleton: with 'Skeleton mandatory' ticked, no RINEX file is produced for the affected stream; otherwise BNC falls back
     1697to a default set of RINEX 3/4 observation types. Conversely, a skeleton carrying RINEX Version 3/4 style observation types
     1698(3-character codes) is always usable when producing RINEX Version 2 files, because the Version 3/4 codes can be unambiguously mapped
     1699down to Version 2 codes (see section 'Version 2').
     1700</p>
    16931701
    16941702<p><h4 id="sklDir">2.4.7 Skeleton Directory - optional</h4></p>
     
    17181726However, this is not recommended, because such stream cannot be precisely mapped to RINEX Version 3
    17191727as the required information on tracking modes (observation attributes) is not part of RTCM Version 2.
     1728</p>
     1729<p>
     1730For the same reason, a RINEX header skeleton file that only carries RINEX Version 2 style observation types
     1731(2-character codes) cannot be used to build a RINEX Version 3/4 header. BNC ignores such a skeleton for that
     1732purpose and falls back to a default set of RINEX 3/4 observation types instead, see section 'Skeleton Mandatory'.
    17201733</p>
    17211734
  • trunk/BNC/src/bncrinex.cpp

    r10961 r10979  
    447447  // Read Skeleton Header
    448448  // --------------------
    449   if (readSkeleton()) {
     449  bool sklUsable = readSkeleton();
     450  if (sklUsable && intHeaderVers >= 3) {
     451    // A skeleton carrying only 2-char (v2-style) observation codes cannot
     452    // supply the attribute-specific codes a v3 file needs. Judge this from
     453    // the actual codes rather than _sklHeader.version(), which is often
     454    // left at 0.0 for skeleton files that omit "RINEX VERSION / TYPE".
     455    bool haveV3Types = false;
     456    for (int iSys = 0; iSys < _sklHeader.numSys() && !haveV3Types; iSys++) {
     457      char sys = _sklHeader.system(iSys);
     458      QStringList types = _sklHeader.obsTypes(sys);
     459      for (int iType = 0; iType < types.size(); iType++) {
     460        if (types.at(iType).length() >= 3) {
     461          haveV3Types = true;
     462          break;
     463        }
     464      }
     465    }
     466    if (!haveV3Types) {
     467      sklUsable = false;
     468    }
     469  }
     470  if (sklUsable) {
    450471    _header.set(_sklHeader, intHeaderVers);
    451472  }
  • trunk/BNC/src/rinex/rnxobsfile.cpp

    r10619 r10979  
    444444  if (!useObsTypes || useObsTypes->size() == 0) {
    445445    if (int(_version) == int(header._version)) {
    446       _obsTypes = header._obsTypes;
     446      if (_version < 3.0) {
     447        // Sanitize: a source header labeled v2 could still carry malformed
     448        // (e.g. leftover 3-char) codes; always force them through type3to2.
     449        QMap<char, QStringList>::const_iterator it = header._obsTypes.constBegin();
     450        for ( ; it != header._obsTypes.constEnd(); ++it) {
     451          char sys = it.key();
     452          for (int iType = 0; iType < it.value().size(); iType++) {
     453            QString conv = t_rnxObsFile::type3to2(sys, it.value().at(iType));
     454            if (!_obsTypes[sys].contains(conv)) {
     455              _obsTypes[sys].push_back(conv);
     456            }
     457          }
     458        }
     459      }
     460      else {
     461        _obsTypes = header._obsTypes;
     462      }
    447463    }
    448464    else {
Note: See TracChangeset for help on using the changeset viewer.