Changeset 11196 in ntrip for trunk/BNC/src/PPP/pppFilter.cpp


Ignore:
Timestamp:
Nov 11, 2026, 8:57:49 AM (less than one hour ago)
Author:
stuerze
Message:

some PPP updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppFilter.cpp

    r11195 r11196  
    3737////////////////////////////////////////////////////////////////////////////
    3838t_pppFilter::t_pppFilter() {
    39   _parlist = 0;
     39  _parlist     = 0;
     40  _numSat      = 0;
     41  _fixRatio    = 0.0;
     42  _resRmsCode  = 0.0;
     43  _resRmsPhase = 0.0;
    4044}
    4145
    … …  
    5054t_irc t_pppFilter::processEpoch(t_pppObsPool* obsPool) {
    5155
    52   _numSat = 0;
     56  _numSat      = 0;
     57  _resRmsCode  = 0.0;
     58  _resRmsPhase = 0.0;
    5359  const double maxSolGap = 60.0;
    5460  bool setNeuNoiseToZero = false;
    … …  
    112118  // ----------------------
    113119  cmpDOP(allObs);
     120
     121  // Post-fit Residuals: RMS per epoch
     122  // ---------------------------------
     123  cmpResiduals(allObs);
    114124
    115125  // Ambiguity Resolution
    … …  
    135145
    136146  return success;
     147}
     148
     149// RMS of the post-fit residuals of the epoch (set in processSystem)
     150////////////////////////////////////////////////////////////////////////////
     151void t_pppFilter::cmpResiduals(const vector<t_pppSatObs*>& allObs) {
     152
     153  // RMS of code and phase residuals
     154  // -------------------------------
     155  double   sumCode  = 0.0;
     156  double   sumPhase = 0.0;
     157  unsigned numCode  = 0;
     158  unsigned numPhase = 0;
     159  for (const t_pppSatObs* obs : allObs) {
     160    const vector<t_lc>& LCs = OPT->LCs(obs->prn().system());
     161    for (const t_lc& LC : LCs) {
     162      if (!obs->hasRes(LC)) {
     163        continue;
     164      }
     165      double res = obs->getRes(LC);
     166      if      (LC._type == t_lc::code  || LC._type == t_lc::codeIF) {
     167        sumCode  += res * res;
     168        numCode  += 1;
     169      }
     170      else if (LC._type == t_lc::phase || LC._type == t_lc::phaseIF) {
     171        sumPhase += res * res;
     172        numPhase += 1;
     173      }
     174    }
     175  }
     176  _resRmsCode  = (numCode  > 0) ? sqrt(sumCode  / numCode)  : 0.0;
     177  _resRmsPhase = (numPhase > 0) ? sqrt(sumPhase / numPhase) : 0.0;
     178
     179  LOG << string(_epoTime) << " RMS code "
     180      << setw(8) << setprecision(4) << _resRmsCode  << " (" << numCode  << ") phase "
     181      << setw(8) << setprecision(4) << _resRmsPhase << " (" << numPhase << ")" << endl;
    137182}
    138183
Note: See TracChangeset for help on using the changeset viewer.