Ignore:
Timestamp:
Sep 30, 2026, 10:52:22 PM (17 hours ago)
Author:
stuerze
Message:

some more fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/combination/bnccomb.cpp

    r11047 r11058  
    535535
    536536
     537// True if every AC has delivered clock corrections for an epoch after epoTime
     538////////////////////////////////////////////////////////////////////////////
     539bool bncComb::allACsBeyond(const bncTime& epoTime) const {
     540  QListIterator<cmbAC*> itAC(_ACs);
     541  while (itAC.hasNext()) {
     542    const cmbAC* AC = itAC.next();
     543    bncTime acLast = _acLastClkTime.value(AC->name);
     544    if (!acLast.valid() || !(acLast > epoTime)) {
     545      return false;
     546    }
     547  }
     548  return true;
     549}
     550
    537551// Process clock corrections
    538552////////////////////////////////////////////////////////////////////////////
    … …  
    552566    if (!_cmbSysPrn.contains(sys)){
    553567      continue;
     568    }
     569
     570    // Remember the latest correction epoch of each AC (whether or not the
     571    // correction is used), to know when an AC has finished an epoch
     572    // --------------------------------------------------------------------
     573    QListIterator<cmbAC*> itAC(_ACs);
     574    while (itAC.hasNext()) {
     575      cmbAC* AC = itAC.next();
     576      if (AC->mountPoint == QString(newClk._staID.c_str())) {
     577        bncTime& acLast = _acLastClkTime[AC->name];
     578        if (!acLast.valid() || newClk._time > acLast) {
     579          acLast = newClk._time;
     580        }
     581        break;
     582      }
    554583    }
    555584
    … …  
    665694      }
    666695    }
    667     // Process the front epoch
    668     // -----------------------
    669     if (epoTime < (_lastClkCorrTime - outWait)) {
     696    // Process the front epoch as soon as all ACs have delivered corrections
     697    // for a later epoch (i.e. have finished this one), at the latest when
     698    // the newest correction is maxWait newer (an AC may be late or missing).
     699    // Waiting only outWait after the newest correction lost the corrections
     700    // of ACs with a few seconds more latency ("old correction").
     701    // -----------------------------------------------------------------------
     702    const double maxWait = max(10.0, outWait);
     703    if (allACsBeyond(epoTime) || epoTime < (_lastClkCorrTime - maxWait)) {
    670704      _resTime = epoTime;
    671705      processEpoch(_resTime, clkCorrVec);
    … …  
    834868              codeBiasesRefSig[frqType] = bias._value;
    835869            }
     870          }
     871        }
     872        // Code biases present, but not for both reference signals (e.g.
     873        // Galileo HAS): the AC clocks cannot be referred to the reference
     874        // signals and are used as they are - warn (at most once per hour
     875        // per AC and system)
     876        if (codeBiasesRefSig.size() < 2) {
     877          QString key = acName + sys;
     878          bncTime& warned = _refBiasWarned[key];
     879          if (!warned.valid() || _newCorr->_time - warned >= 3600.0) {
     880            warned = _newCorr->_time;
     881            QString refSig;
     882            for (unsigned ii = 1; ii < cmbRefSig::cIF; ii++) {
     883              t_frequency::type frqType = cmbRefSig::toFreq(sys, static_cast<cmbRefSig::type>(ii));
     884              refSig += QString(" C%1%2").arg(t_frequency::toString(frqType)[1])
     885                                         .arg(cmbRefSig::toAttrib(sys, static_cast<cmbRefSig::type>(ii)));
     886            }
     887            emit newMessage("bncComb: " + acName.toLatin1() + " provides no code biases for the " +
     888                            QByteArray(1, sys) + " reference signals" + refSig.toLatin1() +
     889                            " - its clocks are combined without referring them to these signals", false);
    836890          }
    837891        }
    … …  
    13981452    double dC_apriori_corr = dC_orb;// + dC_att; can be added if useful values are provided by the ACs
    13991453
    1400     ll(iObs) = ((corr->_clkCorr._dClk * t_CST::c) - dC_apriori_corr - corr->_satCodeBiasIF) - DotProduct(AA.Row(iObs), x0);
     1454    // Clock referred to the ionosphere-free combination of the reference
     1455    // signals: dt - (alpha b1 + beta b2) with biases in Bias-SINEX sign
     1456    // (subtracted from observations, Banville et al. 2020, Eq. 1). The code
     1457    // biases taken from the SSR streams have the opposite sign (added to
     1458    // observations), hence + _satCodeBiasIF.
     1459    ll(iObs) = ((corr->_clkCorr._dClk * t_CST::c) - dC_apriori_corr + corr->_satCodeBiasIF) - DotProduct(AA.Row(iObs), x0);
    14011460
    14021461    PP(iObs, iObs) *= 1.0 / (corr->_weightFactor * corr->_weightFactor);
Note: See TracChangeset for help on using the changeset viewer.