Changeset 10388 in ntrip


Ignore:
Timestamp:
Mar 12, 2024, 3:10:17 PM (7 weeks ago)
Author:
stuerze
Message:

changes regarding PPP

Location:
trunk/BNC
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/scripts/Bnc.pm

    r10385 r10388  
    493493    my $epochSec     = 0;
    494494    my $epochDiff    = 0;
    495     my ( @hlp, @N, @E, @U, %SATNUM, @TRP, @CLK, @OFF_GLO, @OFF_GAL, @OFF_BDS);
    496     my ( @EPOCH, @EPOCH_CLK, @EPOCH_OFF_GLO, @EPOCH_OFF_GAL, @EPOCH_OFF_BDS );
     495    my ( @hlp, @N, @E, @U, %SATNUM, @TRP, @CLK, @OFF_GPS, @OFF_GLO, @OFF_GAL, @OFF_BDS);
     496    my ( @EPOCH, @EPOCH_CLK, @EPOCH_OFF_GPS, @EPOCH_OFF_GLO, @EPOCH_OFF_GAL, @EPOCH_OFF_BDS );
    497497    my ( %AMB,        %RES,            %ELE,            %ION, %BIA );
    498498    my ( $station,    $lki,            $sys,            $sat, $amb );
     
    588588            push ( @CLK,       $hlp[2] + $hlp[3] );
    589589        }
     590        elsif ( $ln =~ /\bOFF_GPS\b/ ) {                # 2015-08... OFF_GPS 52.6806 -3.8042 +- 9.0077
     591            push ( @EPOCH_OFF_GPS, $epochSec );
     592            push ( @OFF_GPS,       $hlp[2] + $hlp[3] );
     593        }
    590594        elsif ( $ln =~ /\bOFF_GLO\b/ ) {                # 2015-08... OFF_GLO 52.6806 -3.8042 +- 9.0077
    591 #            push ( @EPOCH_OFF_GLO, $epochSec );
     595            push ( @EPOCH_OFF_GLO, $epochSec );
    592596            push ( @OFF_GLO,       $hlp[2] + $hlp[3] );
    593597        }
    594598        elsif ( $ln =~ /\bOFF_GAL\b/ ) {                # 2015-08... OFF_GAL 52.6806 -3.8042 +- 9.0077
    595 #            push ( @EPOCH_OFF_GAL, $epochSec );
     599            push ( @EPOCH_OFF_GAL, $epochSec );
    596600            push ( @OFF_GAL,       $hlp[2] + $hlp[3] );
    597601        }
    598602        elsif ( $ln =~ /\bOFF_BDS\b/ ) {                # 2015-08... OFF_BDS 52.6806 -3.8042 +- 9.0077
    599 #            push ( @EPOCH_OFF_BDS, $epochSec );
     603            push ( @EPOCH_OFF_BDS, $epochSec );
    600604            push ( @OFF_BDS,       $hlp[2] + $hlp[3] );
    601605        }
     
    624628    if ( $nof_epochs != scalar @TRP )                            { LOGDIE "number of epochs and TRP not equal\n" }
    625629    if ( @CLK     && scalar @EPOCH_CLK     != scalar @CLK )      { LOGDIE "number of epochs and CLK not equal\n" }
    626 #    if ( @OFF_GLO && scalar @EPOCH_OFF_GLO != scalar @OFF_GLO )  { LOGDIE "number of epochs and OFF_GLO not equal\n" }
    627 #    if ( @OFF_GAL && scalar @EPOCH_OFF_GAL != scalar @OFF_GAL )  { LOGDIE "number of epochs and OFF_GAL not equal\n" }
    628 #    if ( @OFF_BDS && scalar @EPOCH_OFF_BDS != scalar @OFF_BDS )  { LOGDIE "number of epochs and OFF_BDS not equal\n" }
     630    if ( @OFF_GPS && scalar @EPOCH_OFF_GPS != scalar @OFF_GPS )  { LOGDIE "number of epochs and OFF_GPS not equal\n" }
     631    if ( @OFF_GLO && scalar @EPOCH_OFF_GLO != scalar @OFF_GLO )  { LOGDIE "number of epochs and OFF_GLO not equal\n" }
     632    if ( @OFF_GAL && scalar @EPOCH_OFF_GAL != scalar @OFF_GAL )  { LOGDIE "number of epochs and OFF_GAL not equal\n" }
     633    if ( @OFF_BDS && scalar @EPOCH_OFF_BDS != scalar @OFF_BDS )  { LOGDIE "number of epochs and OFF_BDS not equal\n" }
    629634
    630635    if ( !$station ) { WARN "could not grep stationname from file: $file\n" }
     
    638643                 TRP     => \@TRP,
    639644                 CLK     => \@CLK,
     645                 OFF_GPS => \@OFF_GPS,
    640646                 OFF_GLO => \@OFF_GLO,
    641647                 OFF_GAL => \@OFF_GAL,
  • trunk/BNC/scripts/pppPlot.pl

    r10385 r10388  
    107107    my ( $station, $file ) = Bnc::parsePPPLogfile( $file, $sampling );
    108108    my $EPOCH       = $file->{'EPOCH'};
     109    my $EPOCH_OFF_GPS = $file->{'EPOCH_OFF_GPS'};
    109110    my $EPOCH_OFF_GLO = $file->{'EPOCH_OFF_GLO'};
    110111    my $EPOCH_OFF_GAL = $file->{'EPOCH_OFF_GAL'};
     
    243244        }
    244245
     246        ######### OFF_GPS #####################
     247        if ( grep ( $_ eq "ALL", @plotTypes ) ) {
     248            if ( scalar @{ $file->{'OFF_GPS'} } < 1 ) {
     249                DEBUG "No OFF_GPS found";
     250            }
     251            else {
     252                DEBUG "Plot OFF_GPS";
     253                my $pngName  = sprintf ( "%s_OFF_G.png", $station );
     254                my $chartOFF_GPS = newChart($station);
     255                $chartOFF_GPS->set( output => $pngName );
     256                $chartOFF_GPS->set( ylabel => "Offset GPS [m]" );
     257
     258                $dataset = Chart::Gnuplot::DataSet->new(
     259                                                         xdata   => $EPOCH_OFF_GPS,
     260                                                         ydata   => $file->{'OFF_GPS'},
     261                                                         title   => "Receiver Offset GPS",
     262                                                         timefmt => '%s',
     263                                                         style   => "linespoints",
     264                );
     265                $chartOFF_GPS->plot2d($dataset);    #system ("display $pngName&");
     266                $y = $y - $dy;
     267
     268                if ( $y < 30 / mm ) {
     269                    $page = $pdf->page();
     270                    $page->mediabox('A4');
     271                    $y = $y0;
     272                }
     273                $png = $page->gfx();
     274                LOGDIE("could not find image file: $!\n") unless -e $pngName;
     275                $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
     276            }
     277        }
     278
    245279
    246280        ######### OFF_GLO #####################
     
    257291
    258292                $dataset = Chart::Gnuplot::DataSet->new(
    259                                                          #xdata   => $EPOCH_OFF_GLO,
    260                                                          xdata   => $EPOCH,
     293                                                         xdata   => $EPOCH_OFF_GLO,
    261294                                                         ydata   => $file->{'OFF_GLO'},
    262295                                                         title   => "Receiver Offset GLONASS",
     
    291324
    292325                $dataset = Chart::Gnuplot::DataSet->new(
    293                                                          #xdata   => $EPOCH_OFF_GAL,
    294                                                          xdata   => $EPOCH,
     326                                                         xdata   => $EPOCH_OFF_GAL,
    295327                                                         ydata   => $file->{'OFF_GAL'},
    296328                                                         title   => "Receiver Offset Galileo",
     
    325357
    326358                $dataset = Chart::Gnuplot::DataSet->new(
    327                                                          #xdata   => $EPOCH_OFF_BDS,
    328                                                          xdata   => $EPOCH,
     359                                                         xdata   => $EPOCH_OFF_BDS,
    329360                                                         ydata   => $file->{'OFF_BDS'},
    330361                                                         title   => "Receiver Offset Beidou",
  • trunk/BNC/src/PPP/pppClient.cpp

    r10384 r10388  
    6767    }
    6868  }
     69  _offGps = 0.0;
    6970  _offGlo = 0.0;
    7071  _offGal = 0.0;
     
    301302      const t_pppSatObs* satObs = obsVector.at(ii);
    302303      char sys = satObs->prn().system();
    303       if (satObs->isValid() && 
     304      if (satObs->isValid() &&
    304305          (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) {
    305306        ColumnVector rr = satObs->xc().Rows(1,3) - xyzc.Rows(1,3);
     
    337338  return success;
    338339}
     340
     341// Compute A Priori Gps Clock Offset
     342//////////////////////////////////////////////////////////////////////////////
     343double t_pppClient::cmpOffGps(vector<t_pppSatObs*>& obsVector) {
     344
     345  t_lc::type tLC   = t_lc::dummy;
     346  double     offGps = 0.0;
     347
     348  if (_opt->useSystem('G')) {
     349    while (obsVector.size() > 0) {
     350      offGps = 0.0;
     351      double   maxRes      = 0.0;
     352      int      maxResIndex = -1;
     353      unsigned nObs        = 0;
     354      t_prn    maxResPrn;
     355      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     356        const t_pppSatObs* satObs = obsVector.at(ii);
     357        if (satObs->prn().system() == 'G') {
     358          if (tLC == t_lc::dummy) {
     359            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
     360          }
     361          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {
     362            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
     363            ++nObs;
     364            offGps += ll;
     365            if (fabs(ll) > fabs(maxRes)) {
     366              maxRes      = ll;
     367              maxResIndex = ii;
     368              maxResPrn   = satObs->prn();
     369            }
     370          }
     371        }
     372      }
     373
     374      if (nObs > 0) {
     375        offGps = offGps / nObs;
     376      }
     377      else {
     378        offGps = 0.0;
     379      }
     380
     381      if (fabs(maxRes) > 100.0) {
     382        LOG << "t_pppClient::cmpOffGps outlier " << maxResPrn.toString() << " " << maxRes << endl;
     383        delete obsVector.at(maxResIndex);
     384        obsVector.erase(obsVector.begin() + maxResIndex);
     385      }
     386      else {
     387        break;
     388      }
     389    }
     390  }
     391  return offGps;
     392}
     393
    339394
    340395// Compute A Priori Glonass Clock Offset
     
    443498  return offGal;
    444499}
    445 
    446500// Compute A Priori BDS Clock Offset
    447501//////////////////////////////////////////////////////////////////////////////
     
    638692    }
    639693
     694    _offGps = cmpOffGps(_obsRover);
    640695    _offGlo = cmpOffGlo(_obsRover);
    641696    _offGal = cmpOffGal(_obsRover);
  • trunk/BNC/src/PPP/pppClient.h

    r10384 r10388  
    3636  const bncAntex*     antex() const {return _antex;}
    3737  const t_pppStation* staRover() const {return _staRover;}
     38  double              offGps() const {return _offGps;}
    3839  double              offGlo() const {return _offGlo;}
    3940  double              offGal() const {return _offGal;}
    4041  double              offBds() const {return _offBds;}
     42  void                resetOffGps() {_offGps = 0.0;}
     43  void                resetOffGlo() {_offGlo = 0.0;}
     44  void                resetOffGal() {_offGal = 0.0;}
     45  void                resetOffBds() {_offBds = 0.0;}
    4146
    4247
     
    6166  t_irc cmpBancroft(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
    6267                    ColumnVector& xyzc, bool print);
     68  double cmpOffGps(std::vector<t_pppSatObs*>& obsVector);
    6369  double cmpOffGlo(std::vector<t_pppSatObs*>& obsVector);
    6470  double cmpOffGal(std::vector<t_pppSatObs*>& obsVector);
     
    7379  bncAntex*                 _antex;
    7480  t_pppFilter*              _filter;
     81  double                    _offGps;
    7582  double                    _offGlo;
    7683  double                    _offGal;
  • trunk/BNC/src/PPP/pppFilter.cpp

    r10386 r10388  
    310310  string epoTimeStr = string(_epoTime);
    311311  const vector<t_pppParam*> &params = _parlist->params();
     312  int maxNumberOfReset =  (2.0 * obsVector.size()) - 2.0;
     313  int numberOfReset = 0;
    312314
    313315  for (unsigned ii = 0; ii < LCs.size(); ii++) {
     
    347349
    348350        // Check Pre-Fit Residuals
    349         /* -----------------------
     351        // -----------------------
    350352        else {
    351353          ColumnVector AA(params.size());
     
    358360
    359361          if (fabs(vv) > SLIP) {
     362            numberOfReset++;
    360363            LOG << epoTimeStr << " cycle slip detected " << t_lc::toString(tLC) << ' '
    361364                << obs->prn().toString() << ' ' << setw(8) << setprecision(4) << vv << endl;
    362             resetAmb(obs->prn(), obsVector, tLC);
    363           }
    364         }*/
     365            if (numberOfReset < maxNumberOfReset) {
     366              resetAmb(obs->prn(), obsVector, tLC);
     367            }
     368          }
     369        }
    365370      }
    366371    }
  • trunk/BNC/src/PPP/pppParlist.cpp

    r10387 r10388  
    7474         const t_pppSatObs* obs = obsVector->at(ii);
    7575         if (obs->prn() == _prn) {
     76           double offGps = 0.0;
     77           if (_prn.system() == 'G' && tLC != t_lc::MW) {
     78             offGps = PPP_CLIENT->offGps();
     79           }
    7680           double offGlo = 0.0;
    7781           if (_prn.system() == 'R' && tLC != t_lc::MW) {
     
    8690             offBds = PPP_CLIENT->offBds();
    8791           }
    88            _x0 = floor((obs->obsValue(tLC) - offGlo - offGal - offBds - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
     92           _x0 = floor((obs->obsValue(tLC) - offGps - offGlo - offGal - offBds - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
    8993           break;
    9094         }
    9195       }
    9296     }
     97     break;
     98   case offGps:
     99     _epoSpec = true;
     100     _sigma0  = OPT->_aprSigClkOff;
     101     _x0      = PPP_CLIENT->offGps();
    93102     break;
    94103   case offGlo:
     
    171180    if (tLC == t_lc::GIM) {return 0.0;}
    172181    return 1.0;
     182  case offGps:
     183    if (tLC == t_lc::GIM) {return 0.0;}
     184    return (obs->prn().system() == 'G') ? 1.0 : 0.0;
    173185  case offGlo:
    174186    if (tLC == t_lc::GIM) {return 0.0;}
     
    298310  case rClk:
    299311    ss << "REC_CLK     ";
     312    break;
     313  case offGps:
     314    ss << "OFF_GPS     ";
    300315    break;
    301316  case offGlo:
     
    401416  }
    402417
     418  // check which systems have observations
     419  // -------------------------------------
     420  _usedSystems['G'] = _usedSystems['R'] = _usedSystems['E'] = _usedSystems['C'] = 0;
     421  for (unsigned jj = 0; jj < obsVector.size(); jj++) {
     422    const t_pppSatObs* satObs = obsVector[jj];
     423    char sys = satObs->prn().system();
     424    _usedSystems[sys]++;
     425  }
     426
    403427  // Check whether parameters have observations
    404428  // ------------------------------------------
     
    435459  required.push_back(new t_pppParam(t_pppParam::crdZ, t_prn(), t_lc::dummy));
    436460
    437   // Receiver Clock
    438   // --------------
     461  // Receiver Clocks
     462  // ---------------
    439463  required.push_back(new t_pppParam(t_pppParam::rClk, t_prn(), t_lc::dummy));
    440464
    441465  // GLONASS Clock Offset
    442466  // --------------------
    443   if ((OPT->useSystem('G') && OPT->useSystem('R')) ||
    444       (OPT->useSystem('E') && OPT->useSystem('R')) ||
    445       (OPT->useSystem('C') && OPT->useSystem('R')) ) {
     467  if ( _usedSystems.value('R')  &&
     468      (_usedSystems.value('G') || _usedSystems.value('E') || _usedSystems.value('C'))) {
    446469    required.push_back(new t_pppParam(t_pppParam::offGlo, t_prn(), t_lc::dummy));
     470  }
     471  else {
     472    PPP_CLIENT->resetOffGlo();
    447473  }
    448474
    449475  // Galileo Clock Offset
    450476  // --------------------
    451   if (OPT->useSystem('G') && OPT->useSystem('E')) {
     477  if (_usedSystems.value('E') && _usedSystems.value('G') && _usedSystems.value('G') >= OPT->_minObs) {
    452478    required.push_back(new t_pppParam(t_pppParam::offGal, t_prn(), t_lc::dummy));
     479  }
     480  else {
     481    PPP_CLIENT->resetOffGal();
     482  }
     483
     484  // GPS Clock Offset
     485  // --------------------
     486  if (_usedSystems.value('E') && _usedSystems.value('G') && _usedSystems.value('G') < OPT->_minObs) {
     487    required.push_back(new t_pppParam(t_pppParam::offGps, t_prn(), t_lc::dummy));
     488  }
     489  else {
     490    PPP_CLIENT->resetOffGps();
    453491  }
    454492
    455493  // BDS Clock Offset
    456494  // ----------------
    457   if ((OPT->useSystem('G') && OPT->useSystem('C')) ||
    458       (OPT->useSystem('E') && OPT->useSystem('C'))) {
     495  if (_usedSystems.contains('C')  &&
     496      (_usedSystems.contains('G') || _usedSystems.contains('E'))) {
    459497    required.push_back(new t_pppParam(t_pppParam::offBds, t_prn(), t_lc::dummy));
     498  }
     499  else {
     500    PPP_CLIENT->resetOffBds();
    460501  }
    461502
  • trunk/BNC/src/PPP/pppParlist.h

    r10384 r10388  
    1414class t_pppParam {
    1515 public:
    16   enum e_type {crdX, crdY, crdZ, rClk, offGlo, offGal, offBds, trp, ion, amb,
     16  enum e_type {crdX, crdY, crdZ, rClk, offGps, offGlo, offGal, offBds, trp, ion, amb,
    1717               cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasR1, pBiasE1, pBiasC1,
    1818               cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasR2, pBiasE2, pBiasC2};
     
    104104  const std::vector<t_pppParam*>& params() const {return _params;}
    105105  std::vector<t_pppParam*>& params() {return _params;}
     106  const QMap<char, int>& usedSystems() const {return _usedSystems;}
    106107  void printResult(const bncTime& epoTime, const SymmetricMatrix& QQ,
    107108                   const ColumnVector& xx) const;
     
    110111 private:
    111112  std::vector<t_pppParam*> _params;
     113  QMap<char, int>          _usedSystems;
    112114};
    113115
Note: See TracChangeset for help on using the changeset viewer.