Changeset 11214 in ntrip for trunk/BNC/src/ssrQc.cpp


Ignore:
Timestamp:
Nov 18, 2026, 8:21:50 PM (less than one hour ago)
Author:
stuerze
Message:

SSR QC improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/ssrQc.cpp

    r11212 r11214  
    259259           << " completeness w.r.t. healthy broadcast ephemerides," << endl
    260260           << "IOD matching, code and phase bias signals, phase bias indicators, Melbourne-Wuebbena consistency"
    261            << " with the other ACs, yaw angle, code biases of the reference signals, clock jumps > "
     261           << " with the other ACs, yaw angle, code biases of the reference signals,"
     262           << " code biases of APC and CoM streams, clock jumps > "
    262263           << MAX_CLK_JUMP << " m, largest orbit corrections, VTEC models (system V)" << endl
    263264           << "Reference signals of the clocks: " << t_ssrRefSig::currentString().toStdString() << endl;
    … …  
    457458      storeHist(&corr, 0);
    458459    }
     460    _orbFormat[QString::fromStdString(corr._staID)] = corr._ssrFormat;
    459461    if (!selected(corr._staID)) continue;
    460462    QString prn = QString::fromStdString(corr._prn.toString());
    … …  
    979981      }
    980982      deviating(compare(1, QString()), QString("the median of the other ACs (at least %1 solutions)").arg(MIN_VOTE));
     983    }
     984  }
     985}
     986
     987// Code biases of an APC stream compared with the CoM stream of the same
     988// solution and format (SSRA00GMV0 / SSRC00GMV0), IGS-SSR and old RTCM-SSR
     989// only (new RTCM-SSR carries its own satellite antenna model, and the
     990// reference point is left to the provider). Following the IGS SSR
     991// convention, users of an APC stream reduce the satellite PCOs of all
     992// frequencies by the PCO of the reference frequency themselves, so the code
     993// biases of both streams have to be equal. Differences equal to
     994// z(f) - z(ref) of the ANTEX file show frequency-dependent PCO differences in
     995// the biases of the APC stream, which such users apply twice (ionosphere-free
     996// combination of the reference signal biases z(IF) - z(ref) instead of 0).
     997////////////////////////////////////////////////////////////////////////////
     998void t_ssrQc::compareApcComBiases(const QString& staID, char sys, const bncTime& tt, QStringList& lines) {
     999  const double MAX_DIFF = 0.02;  // [m] equal biases (resolution 0.01 m, slightly different epochs)
     1000  if (!staID.startsWith("SSRA")) {
     1001    return;
     1002  }
     1003  const QString comID = "SSRC" + staID.mid(4);
     1004  if (!_cbLast.contains(staID) || !_cbLast.contains(comID)) {
     1005    return;
     1006  }
     1007  // format of the latest orbit corrections (IGS-SSR: ssrUnknown)
     1008  if (_orbFormat.value(staID, ssrUnknown) == ssrRtcmNew || _orbFormat.value(comID, ssrUnknown) == ssrRtcmNew) {
     1009    return;
     1010  }
     1011  // reference frequency of the APC (IGS SSR v1.00, table 2)
     1012  t_frequency::type refFrq;
     1013  switch (sys) {
     1014    case 'G': refFrq = t_frequency::G1; break;
     1015    case 'R': refFrq = t_frequency::R1; break;
     1016    case 'E': refFrq = t_frequency::E1; break;
     1017    case 'C': refFrq = t_frequency::C2; break;
     1018    case 'J': refFrq = t_frequency::J1; break;
     1019    case 'S': refFrq = t_frequency::S1; break;
     1020    case 'I': refFrq = t_frequency::I5; break;
     1021    default: return;
     1022  }
     1023  QSet<QString> sats;
     1024  unsigned numBias = 0, numPco = 0;
     1025  double   sumSqr = 0.0, sumSqrRes = 0.0, maxDiff = 0.0;
     1026  QString  maxStr;
     1027  const QMap<QString, QMap<QString, double> >& apc = _cbLast[staID];
     1028  const QMap<QString, QMap<QString, double> >& com = _cbLast[comID];
     1029  for (auto itP = apc.constBegin(); itP != apc.constEnd(); ++itP) {
     1030    const QString& prn = itP.key();
     1031    if (prn[0].toLatin1() != sys || !com.contains(prn)) {
     1032      continue;
     1033    }
     1034    const QMap<QString, double>& bc = com[prn];
     1035    for (auto itS = itP.value().constBegin(); itS != itP.value().constEnd(); ++itS) {
     1036      const QString& sig = itS.key();
     1037      if (!bc.contains(sig) || sig.isEmpty()) {
     1038        continue;
     1039      }
     1040      double diff = itS.value() - bc[sig];
     1041      sats.insert(prn);
     1042      numBias++;
     1043      sumSqr += diff * diff;
     1044      if (fabs(diff) > fabs(maxDiff)) {
     1045        maxDiff = diff;
     1046        maxStr  = QString("%1 C%2").arg(prn).arg(sig);
     1047      }
     1048      if (_antex) {
     1049        // satCorr() at nadir 0 (PCV pattern at zenith 0 of the satellite) gives -z(f)
     1050        bool foundF = false, foundR = false;
     1051        double corrF = _antex->satCorr(prn, t_frequency::toFreq(sys, sig[0].toLatin1()), M_PI / 2.0, 0.0, foundF, tt);
     1052        double corrR = _antex->satCorr(prn, refFrq, M_PI / 2.0, 0.0, foundR, tt);
     1053        if (foundF && foundR) {
     1054          double res = diff - (corrR - corrF);   // expected z(f) - z(ref)
     1055          sumSqrRes += res * res;
     1056          numPco++;
     1057        }
     1058      }
     1059    }
     1060  }
     1061  if (numBias == 0) {
     1062    return;
     1063  }
     1064  double rms = sqrt(sumSqr / numBias);
     1065  if (fabs(maxDiff) <= MAX_DIFF) {
     1066    lines << QString("code biases equal to those of the CoM stream %1 (%2 satellites, %3 biases)")
     1067             .arg(comID).arg(sats.size()).arg(numBias);
     1068    return;
     1069  }
     1070  lines << QString("code biases differ from those of the CoM stream %1: RMS %2 m, max %3 m (%4) "
     1071                   "(%5 satellites, %6 biases)")
     1072           .arg(comID).arg(rms, 0, 'f', 3).arg(maxDiff, 0, 'f', 3).arg(maxStr).arg(sats.size()).arg(numBias);
     1073  if (numPco > 0) {
     1074    double rmsRes = sqrt(sumSqrRes / numPco);
     1075    if (rmsRes < MAX_DIFF || rmsRes < 0.2 * rms) {
     1076      lines << QString("code bias differences APC - CoM equal the satellite PCO differences z(f) - z(ref) of the "
     1077                       "ANTEX file (RMS of the residuals %1 m, %2 biases): frequency-dependent PCOs in the biases "
     1078                       "of the APC stream, applied twice by users reducing the PCOs by the PCO of the reference "
     1079                       "frequency (IGS SSR convention)").arg(rmsRes, 0, 'f', 3).arg(numPco);
     1080    }
     1081    else {
     1082      lines << QString("code bias differences APC - CoM not explained by the satellite PCO differences of the "
     1083                       "ANTEX file (RMS of the residuals %1 m, %2 biases)").arg(rmsRes, 0, 'f', 3).arg(numPco);
    9811084    }
    9821085  }
    … …  
    18191922      }
    18201923      compareCodeBiases(staID, sys, lines);
     1924      compareApcComBiases(staID, sys, endTime, lines);
    18211925      if (_phaseSignals.contains(staSys)) {
    18221926        QStringList sigs = _phaseSignals[staSys].values();
Note: See TracChangeset for help on using the changeset viewer.