Changeset 11196 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Nov 11, 2026, 8:57:49 AM (3 weeks ago)
Author:
stuerze
Message:

some PPP updates

Location:
trunk/BNC/src
Files:
9 edited

Legend:

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

    r11195 r11196  
    2727//
    2828//////////////////////////////////////////////////////////////////////////////////////////
    29 bool AmbRes::isResolvable(const t_pppParam* amb) {
    30   if ( amb->ambNumEpo() >= OPT->_ar._minNumEpo && amb->ambEleSat() >= OPT->_ar._minEle) {
    31     return true;
    32   }
    33   else {
     29bool AmbRes::isResolvable(const bncTime& epoTime, const t_pppParam* amb, std::ostream& msg) {
     30
     31  // Satellite not observed in the current epoch (parameter kept up to 60 s)
     32  // -----------------------------------------------------------------------
     33  if (amb->lastObsTime() != epoTime) {
     34    msg << "  " << amb->prn().toString() << ' ' << amb->LC().toString()
     35        << " not observed, not resolvable" << endl;
    3436    return false;
    3537  }
     38
     39  if ( amb->ambNumEpo() < OPT->_ar._minNumEpo || amb->ambEleSat() < OPT->_ar._minEle) {
     40    return false;
     41  }
     42  return true;
    3643}
    3744
    … …  
    113120    for (const auto& par : params) {
    114121      if (par->type() == t_pppParam::amb && par->prn().system() == system) {
    115         if (isResolvable(par)) {
     122        if (isResolvable(epoTime, par, msg)) {
    116123          addToGroup(par);
    117124        }
  • trunk/BNC/src/PPP/ambres.h

    r11195 r11196  
    5050    };
    5151
    52     static bool isResolvable(const t_pppParam* amb);
     52    static bool isResolvable(const bncTime& epoTime, const t_pppParam* amb, std::ostream& msg);
    5353    static bool isFixable(double xx, double sigma, bool* checked = 0);
    5454
  • trunk/BNC/src/PPP/pppClient.cpp

    r11123 r11196  
    406406  _output->_numSat = 0;
    407407  _output->_hDop   = 0.0;
     408  _output->_resRmsCode  = 0.0;
     409  _output->_resRmsPhase = 0.0;
    408410  _output->_error  = false;
    409411}
    … …  
    446448    _output->_numSat   = _filter->numSat();
    447449    _output->_hDop     = _filter->HDOP();
     450    _output->_resRmsCode  = _filter->resRmsCode();
     451    _output->_resRmsPhase = _filter->resRmsPhase();
    448452    _output->_error = false;
    449453  }
  • 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
  • trunk/BNC/src/PPP/pppFilter.h

    r11051 r11196  
    3131  double GDOP() const {return _dop.G;}
    3232  double fixRatio() const {return _fixRatio;}
     33  double resRmsCode() const {return _resRmsCode;}
     34  double resRmsPhase() const {return _resRmsPhase;}
    3335  double trp() const {
    3436    const std::vector<t_pppParam*>& par = _parlist->params();
    … …  
    7476  };
    7577
     78  void  cmpResiduals(const std::vector<t_pppSatObs*>& allObs);
    7679  t_irc processSystem(const std::vector<t_lc>& LCs,
    7780                      const std::vector<t_pppSatObs*>& obsVector,
    … …  
    105108  bncTime         _lastEpoTimeOK;
    106109  double          _fixRatio;
     110  double          _resRmsCode;
     111  double          _resRmsPhase;
    107112};
    108113
  • trunk/BNC/src/PPP/pppSatObs.h

    r11041 r11196  
    4848    void                setRes(t_lc LC, double res);
    4949    double              getRes(t_lc LC) const;
     50    bool                hasRes(t_lc LC) const {return _res.find(LC) != _res.end();}
    5051    bool                setPseudoObsIono(t_frequency::type freq, double stecRefSat);
    5152    void                resetGIM() {_stecSat = 0.0;}
  • trunk/BNC/src/bnchelp.html

    r11192 r11196  
    28292829  <ul>
    28302830    <li>'ppp_position': 'x', 'y', 'z', 'dn', 'de', 'du', 'trp0', 'trp', 'trp_stdev', 'num_sat',
    2831         'hdop', 'fixed' (true/false), 'fix_percent'; 'ppp_epoch_failed' (warning) if no solution was computed,</li>
     2831        'hdop', 'fixed' (true/false), 'fix_percent', 'res_rms_code' and 'res_rms_phase' (RMS of the post-fit code and
     2832        phase residuals of the epoch, 0 if there is none of that kind); 'ppp_epoch_failed' (warning) if no solution was computed,</li>
    28322833    <li>'stream_format': 'decoder' (RTCM2, RTCM3, ZERO, ZERO2FILE, RTNET) and 'format' (format entry of the stream),</li>
    28332834    <li>'stream_timeout' (warning): data timeout, BNC reconnects,</li>
    … …  
    28562857  <pre><p style="font-family:Monospace">
    28572858{"time":"2025-11-17T13:48:51.000Z","level":"info","component":"stream","event":"stream_format","mp":"BCEP00BKG0","decoder":"RTCM3","format":"RTCM_3.3","msg":"Get data in RTCM 3.x format","v":1}
    2858 {"time":"2025-11-17T13:49:40.000Z","epoch":"2025-11-17T13:49:10.000","level":"info","component":"ppp","event":"ppp_position","mp":"WTZR00DEU0","x":4075580.2172,"y":931854.1555,"z":4801568.3403,"dn":0.0000,"de":0.0000,"du":0.0001,"trp0":2.1833,"trp":0.0019,"trp_stdev":0.0993,"num_sat":17,"hdop":0.59,"fixed":false,"fix_percent":0,"msg":"PPP position","v":1}
     2859{"time":"2025-11-17T13:49:40.000Z","epoch":"2025-11-17T13:49:10.000","level":"info","component":"ppp","event":"ppp_position","mp":"WTZR00DEU0","x":4075580.2172,"y":931854.1555,"z":4801568.3403,"dn":0.0000,"de":0.0000,"du":0.0001,"trp0":2.1833,"trp":0.0019,"trp_stdev":0.0993,"num_sat":17,"hdop":0.59,"fixed":false,"fix_percent":0,"res_rms_code":0.4071,"res_rms_phase":0.0042,"msg":"PPP position","v":1}
    28592860</pre>
    28602861  </p>
    … …  
    28642865  <pre><p style="font-family:Monospace">
    28652866time=2025-11-17T13:48:51.000Z level=info component=stream event=stream_format mp=BCEP00BKG0 decoder=RTCM3 format=RTCM_3.3 msg="Get data in RTCM 3.x format" v=1
    2866 time=2025-11-17T13:49:40.000Z epoch=2025-11-17T13:49:10.000 level=info component=ppp event=ppp_position mp=WTZR00DEU0 x=4075580.2172 y=931854.1555 z=4801568.3403 dn=0.0000 de=0.0000 du=0.0001 trp0=2.1833 trp=0.0019 trp_stdev=0.0993 num_sat=17 hdop=0.59 fixed=false fix_percent=0 msg="PPP position" v=1
     2867time=2025-11-17T13:49:40.000Z epoch=2025-11-17T13:49:10.000 level=info component=ppp event=ppp_position mp=WTZR00DEU0 x=4075580.2172 y=931854.1555 z=4801568.3403 dn=0.0000 de=0.0000 du=0.0001 trp0=2.1833 trp=0.0019 trp_stdev=0.0993 num_sat=17 hdop=0.59 fixed=false fix_percent=0 res_rms_code=0.4071 res_rms_phase=0.0042 msg="PPP position" v=1
    28672868</pre>
    28682869  </p>
    … …  
    703870392026-07-28_15:12:14.000 RES lC6 C36   0.0020
    703970402026-07-28_15:12:14.000 RES lC6 C37  -0.0009
     70412026-07-28_15:12:14.000 RMS code   0.1615 (68) phase   0.0034 (68)
    704070422026-07-28_15:12:14.000 Ambiguity Resolution (BIE)
    70417043  Group lC2
    … …  
    80028004    <li>Ambiguities are grouped per system/LC into zero-difference sets if minimum number of tracked epochs (see <a
    80038005        href="#ppparmin">Min # Epo</a>) and the minimum elevation (see <a href=#pppmineleva>Minimum Elevation</a>) is
    8004       exceeded.</li>
     8006      exceeded, the satellite is observed in the current epoch (an ambiguity parameter is kept for 60 s after the last
     8007      observation).</li>
    80058008    <li>One reference ambiguity per group is hard-constrained to its rounded value with a tiny σ (sigCon = 1e-4 cycles,
    80068009      turning the rest into single-differences (SD).</li>
  • trunk/BNC/src/pppInclude.h

    r10938 r11196  
    4141  std::string  _log;
    4242  double       _fixRatio;
     43  double       _resRmsCode;   // RMS of the code post-fit residuals [m]
     44  double       _resRmsPhase;  // RMS of the phase post-fit residuals [m]
    4345  bool         _error;
    4446};
  • trunk/BNC/src/pppRun.cpp

    r11189 r11196  
    487487           .add("hdop", output._hDop, 2)
    488488           .add("fixed", output._fixRatio > 0.0)
    489            .add("fix_percent", int(100*output._fixRatio));
     489           .add("fix_percent", int(100*output._fixRatio))
     490           .add("res_rms_code", output._resRmsCode, 4)
     491           .add("res_rms_phase", output._resRmsPhase, 4);
    490492        emit newLogRecord(rec, true);
    491493      }
Note: See TracChangeset for help on using the changeset viewer.