Ignore:
Timestamp:
Nov 23, 2026, 9:48:49 PM (8 hours ago)
Author:
stuerze
Message:

improvements regarding ssrqc ephemerides upload and combination

File:
1 edited

Legend:

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

    r11212 r11218  
    4343
    4444const double sigObs        =   0.05;
     45
     46// level of the combined clocks (regularization condition, see createAmat)
     47const double CLK_LEVEL_TAU    = 3600.0; // [s] relaxation of the sum to zero
     48const double CLK_LEVEL_MAXGAP =   60.0; // [s] longer gap: sum set to zero again
    4549
    4650using namespace std;
    … …  
    11771181  // --------------------------------------
    11781182  if (irc == success) {
     1183    if (_method == filter) {
     1184      _prevClk[sys].clear();
     1185      _prevClkTime[sys] = epoTime;
     1186    }
    11791187    for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
    11801188      cmbParam* pp = _params[sys][iPar-1];
    … …  
    11841192          // set clock result
    11851193          masterCorr[pp->prn]->_dClkResult = pp->xx / t_CST::c;
     1194          if (_method == filter && masterCorr[pp->prn]->_eph) {
     1195            t_prevClk& prev = _prevClk[sys][pp->prn];
     1196            prev.clk = pp->xx;
     1197            prev.iod = masterCorr[pp->prn]->_eph->IOD();
     1198          }
    11861199          // Add Code Biases from SINEX File
    11871200          if (_bsx) {
    … …  
    21702183  }
    21712184
    2172   // Regularization
    2173   // --------------
     2185  // Regularization: level of the combined clocks
     2186  // ---------------------------------------------
     2187  // The sum of the combined clocks over the satellites of the epoch is not
     2188  // fixed to zero in each epoch: a satellite missing in one epoch (e.g. its
     2189  // correction of the master AC refers to an ephemeris not yet received, at
     2190  // the BDS ephemeris change every hour) shifted all other clocks of the
     2191  // system by its clock divided by the number of satellites (BDS: up to 1 m).
     2192  // Instead, the sum over the satellites also combined in the previous epoch
     2193  // keeps its value (continuity), relaxing to zero with CLK_LEVEL_TAU, so
     2194  // that the clocks stay referred to the broadcast clocks in the long run
     2195  // and a permanent change of the satellites shifts them only slowly. A
     2196  // previous clock of another ephemeris is converted to the current one
     2197  // (as in switchToLastEph). Without a previous epoch (start, gap longer
     2198  // than CLK_LEVEL_MAXGAP) the sum is zero.
     2199  QSet<int> presetRows;  // conditions with their value set here
    21742200  if (_method == filter) {
    21752201    const double Ph = 1.e6;
    21762202    PP(nObs+1) = Ph;
     2203    const bncTime epoTime = corrs(sys)[0]->_time;
     2204    const double  dtPrev  = _prevClkTime[sys].valid() ? epoTime - _prevClkTime[sys] : -1.0;
     2205    const bool    cont    = dtPrev > 0.0 && dtPrev <= CLK_LEVEL_MAXGAP;
     2206    double target  = 0.0;
     2207    int    nCommon = 0;
     2208    QList<int> allClk;
    21772209    for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
    21782210      cmbParam* pp = _params[sys][iPar-1];
    21792211      if ( AA.Column(iPar).maximum_absolute_value() > 0.0 &&
    21802212           pp->type == cmbParam::clkSat ) {
     2213        allClk << iPar;
     2214        if (!cont || !_prevClk[sys].contains(pp->prn) || !masterCorr.contains(pp->prn)) {
     2215          continue;
     2216        }
     2217        const t_prevClk& prev = _prevClk[sys][pp->prn];
     2218        const t_eph*     eph  = masterCorr[pp->prn]->_eph;
     2219        double prevClk = prev.clk;
     2220        if (eph->IOD() != prev.iod) {
     2221          const t_eph* ephOld = 0;
     2222          for (const t_eph* ee : {(const t_eph*)_ephUser.ephLast(pp->prn), (const t_eph*)_ephUser.ephPrev(pp->prn)}) {
     2223            if (ee && ee != eph && ee->IOD() == prev.iod) {
     2224              ephOld = ee;
     2225            }
     2226          }
     2227          ColumnVector xcNew(6), xcOld(6), vv(3);
     2228          if (!ephOld ||
     2229              eph->getCrd(epoTime, xcNew, vv, false) != success ||
     2230              ephOld->getCrd(epoTime, xcOld, vv, false) != success) {
     2231            continue;
     2232          }
     2233          prevClk -= (xcNew(4) - xcOld(4)) * t_CST::c;
     2234        }
     2235        AA(nObs+1, iPar) = 1.0;
     2236        target += prevClk;
     2237        ++nCommon;
     2238      }
     2239    }
     2240    if (nCommon > 0) {
     2241      ll(nObs+1) = (1.0 - min(1.0, dtPrev / CLK_LEVEL_TAU)) * target - DotProduct(AA.Row(nObs+1), x0);
     2242      presetRows.insert(1);
     2243    }
     2244    else {
     2245      for (int iPar : allClk) {
    21812246        AA(nObs+1, iPar) = 1.0;
    21822247      }
    … …  
    22902355    // filter. Exception: incomplete nominal datum of a satellite (see above).
    22912356    for (int iCon = 1; iCon <= nCon; iCon++) {
    2292       if (!incrementRows.contains(iCon)) {
     2357      if (!incrementRows.contains(iCon) && !presetRows.contains(iCon)) {
    22932358        ll(nObs+iCon) = -DotProduct(AA.Row(nObs+iCon), x0);
    22942359      }
Note: See TracChangeset for help on using the changeset viewer.