Changeset 8483 in ntrip


Ignore:
Timestamp:
Sep 17, 2018, 2:53:30 PM (4 weeks ago)
Author:
stuerze
Message:

SSR parameter clock rate, clock drift and URA are added within RTNET format

Location:
trunk/BNC/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP_SSR_I/pppClient.cpp

    r8368 r8483  
    408408    bncTime ToT = satData->tt - prange / t_CST::c - clkSat;
    409409
    410     ColumnVector xc(4);
     410    ColumnVector xc(7);
    411411    ColumnVector vv(3);
    412412    if (getSatPos(ToT, satData->prn, xc, vv) != success) {
  • trunk/BNC/src/RTCM/rtcm_utils.cpp

    r6139 r8483  
    1010
    1111void resolveEpoch (double secsHour,
    12                    int  refWeek,   double  refSecs, 
     12                   int  refWeek,   double  refSecs,
    1313                   int& epochWeek, double& epochSecs) {
    1414
    15   const double secsPerWeek = 604800.0;                           
     15  const double secsPerWeek = 604800.0;
    1616
    1717  epochWeek = refWeek;
    1818  epochSecs = secsHour + 3600.0*(floor((refSecs-secsHour)/3600.0+0.5));
    19  
     19
    2020  if (epochSecs<0          ) { epochWeek--; epochSecs+=secsPerWeek; };
    2121  if (epochSecs>secsPerWeek) { epochWeek++; epochSecs-=secsPerWeek; };
     
    2929           double& xSat, double& ySat, double& zSat, double& clkSat) {
    3030
    31   const double omega_earth = 7292115.1467e-11; 
    32   const double secsPerWeek = 604800.0;                           
     31  const double omega_earth = 7292115.1467e-11;
     32  const double secsPerWeek = 604800.0;
    3333
    3434  // Initial values
    3535  // --------------
    3636  rho = 0.0;
    37   ColumnVector xc(4);
     37  ColumnVector xc(7);
    3838  ColumnVector vv(3);
    3939  eph->getCrd(bncTime(GPSWeek, GPSWeeks), xc, vv, false);
     
    4545  ////cout << "----- cmpRho -----\n";
    4646  ////eph->print(cout);
    47   ////cout << "  pos " << setw(4)  << GPSWeek 
     47  ////cout << "  pos " << setw(4)  << GPSWeek
    4848  ////     << " "      << setw(14) << setprecision(6) << GPSWeeks
    4949  ////     << " "      << setw(13) << setprecision(3) << xSat
     
    5757  do {
    5858    rhoLast = rho;
    59    
     59
    6060    // Correction station position due to Earth Rotation
    6161    // -------------------------------------------------
    6262    double dPhi = omega_earth * rho / c_light;
    63     double xRec = stax * cos(dPhi) - stay * sin(dPhi); 
    64     double yRec = stay * cos(dPhi) + stax * sin(dPhi); 
     63    double xRec = stax * cos(dPhi) - stay * sin(dPhi);
     64    double yRec = stay * cos(dPhi) + stax * sin(dPhi);
    6565    double zRec = staz;
    6666
     
    8181      GPSWeek_tot  += 1;
    8282    }
    83      
     83
    8484    eph->getCrd(bncTime(GPSWeek_tot, GPSWeeks_tot), xc, vv, false);
    8585    xSat   = xc(1);
     
    9494    rho = sqrt(dx*dx + dy*dy + dz*dz);
    9595
    96     ////cout << "  scrd "   << setw(4)  << GPSWeek_tot 
     96    ////cout << "  scrd "   << setw(4)  << GPSWeek_tot
    9797    ////         << " "         << setw(15) << setprecision(8) << GPSWeeks_tot
    9898    ////         << " "         << setw(13) << setprecision(3) << xSat
     
    108108    ////         << " rho "     << setw(13) << setprecision(3) << rho
    109109    ////         << endl;
    110    
     110
    111111
    112112    ////cout.setf(ios::fixed);
    113113    ////
    114     ////cout << "niter " << setw(3) << ++niter 
     114    ////cout << "niter " << setw(3) << ++niter
    115115    ////         << " " << setw(14) << setprecision(3) << rhoLast
    116116    ////         << " " << setw(14) << setprecision(3) << rho
  • trunk/BNC/src/bncclockrinex.cpp

    r8204 r8483  
    4141////////////////////////////////////////////////////////////////////////////
    4242t_irc bncClockRinex::write(int GPSweek, double GPSweeks, const QString& prn,
    43                            double sp3Clk) {
     43                           double clkRnx, double clkRnxRate, double clkRnxAcc,
     44                           double clkRnxSig, double clkRnxRateSig, double clkRnxAccSig) {
    4445
    4546  if (reopen(GPSweek, GPSweeks) == success) {
     
    4849      double sec = fmod(GPSweeks, 60.0);
    4950
     51      int numValues = 1;
     52      if (clkRnxSig && clkRnxRate && clkRnxRateSig) {
     53        numValues += 3;
     54      }
     55      if (clkRnxAcc && clkRnxAccSig) {
     56        numValues += 2;
     57      }
     58
    5059      _out << "AS " << prn.toLatin1().data()
    5160           << datTim.toString("  yyyy MM dd hh mm").toLatin1().data()
    5261           << fixed      << setw(10) << setprecision(6)  << sec
    53            << "  1   "   << fortranFormat(sp3Clk, 19, 12).toLatin1().data() << endl;
     62           << "  " << numValues << "   "
     63           << fortranFormat(clkRnx, 19, 12).toLatin1().data();
     64
     65      if (numValues >=2) {
     66        _out << " " << fortranFormat(clkRnxSig, 19, 12).toLatin1().data() << endl;
     67      }
     68      if (numValues == 4) {
     69        _out << fortranFormat(clkRnxRate, 19, 12).toLatin1().data() << " ";
     70        _out << fortranFormat(clkRnxRateSig, 19, 12).toLatin1().data() << " ";
     71      }
     72      if (numValues == 6) {
     73        _out << fortranFormat(clkRnxAcc, 19, 12).toLatin1().data() << " ";
     74        _out << " " << fortranFormat(clkRnxAccSig, 19, 12).toLatin1().data();
     75      }
     76      _out << endl;
    5477
    5578    return success;
  • trunk/BNC/src/bncclockrinex.h

    r8252 r8483  
    44#include <fstream>
    55#include <newmat.h>
    6 
    7 #include <QDateTime>
     6#include <QtCore>
    87
    98#include "bncoutf.h"
     
    1312  bncClockRinex(const QString& sklFileName, const QString& intr, int sampl);
    1413  virtual ~bncClockRinex();
    15   virtual t_irc write(int GPSweek, double GPSweeks, const QString& prn,
    16                       double sp3Clk);
     14  virtual t_irc write(int GPSweek, double GPSweeks, const QString& prn,
     15      double clkRnx, double clkRnxRate, double clkRnxAcc,
     16      double clkRnxSig, double clkRnxRateSig, double clkRnxAccSig);
    1717
    1818 private:
  • trunk/BNC/src/bncephuser.cpp

    r8368 r8483  
    187187  // Simple Check - check satellite radial distance
    188188  // ----------------------------------------------
    189   ColumnVector xc(4);
     189  ColumnVector xc(7);
    190190  ColumnVector vv(3);
    191191  if (eph->getCrd(eph->TOC(), xc, vv, false) != success) {
  • trunk/BNC/src/bnchelp.html

    r8468 r8483  
    40164016<table>
    40174017  <tr><td><i>Key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i></td><td><i>Values</i></td></tr>
    4018   <tr><td>APC</td><td>Satellite Antenna Phase Center coordinates in meters</td></tr>
    4019   <tr><td>Clk</td><td>Satellite clock correction in meters, relativistic correction applied like in broadcast clocks</td></tr>
    4020   <tr><td>Vel</td><td>Satellite velocity in meters per second</td></tr>
    4021   <tr><td>CoM</td><td>Satellite Center of Mass coordinates in meters</td></tr>
     4018  <tr><td>APC</td><td>Satellite Antenna Phase Center coordinate components in meters</td></tr>
     4019  <tr><td>Clk</td><td>Satellite clock correction components in meters, meters per seconds and meters per sec&#178 (relativistic correction applied like in broadcast clocks)</td></tr>
     4020  <tr><td>ClkSig</td><td>Standard deviation for satellite clock correction components in meters, meters per seconds and meters per sec&#178 (required for Clock RINEX file only) /td></tr>
     4021  <tr><td>Vel</td><td>Satellite velocity components in meters per second</td></tr>
     4022  <tr><td>CoM</td><td>Satellite Center of Mass coordinate components in meters</td></tr>
     4023  <tr><td>Ura</td><td>User range accuracy value in meters</td></tr>
    40224024  <tr><td>CodeBias</td><td>Satellite Code Biases in meters with two characters for frequency and tracking mode per bias as defined in RINEX 3 and preceded by total number of biases</td></tr>
    4023   <tr><td>YawAngle</td><td>Satellite Yaw Angle in radian, restricted to be in [0, 2&#960] which shall be used for the computation of phase wind-up correction</td></tr>
     4025  <tr><td>PhaseBias</td><td>Satellite Phase Biases in meters with two characters for frequency and tracking mode per bias as defined in RINEX 3, preceded by total number of biases and followed by Signal Integer Indicator, Signals Wilde-Lane Integer Indicator as well as Signal Discontinuity Counter</td></tr>
     4026  <tr><td>YawAngle</td><td>Satellite Yaw Angle in radian, restricted to be in [0, 2&#960], which shall be used for the computation of phase wind-up correction</td></tr>
    40244027  <tr><td>YawRate</td><td>Satellite Yaw Rate in radian per second which is the rate of Yaw Angle</td></tr>
    4025   <tr><td>PhaseBias</td><td>Satellite Phase Biases in meters with two characters for frequency and tracking mode per bias as defined in RINEX 3, preceded by total number of biases and followed by Signal Integer Indicator, Signals Wilde-Lane Integer Indicator as well as Signal Discontinuity Counter</td></tr>
    40264028</table>
    40274029<p>
  • trunk/BNC/src/bncsp3.cpp

    r8204 r8483  
    6464////////////////////////////////////////////////////////////////////////////
    6565t_irc bncSP3::write(int GPSweek, double GPSweeks, const QString& prn,
    66                     const ColumnVector& xCoM, double sp3Clk) {
     66                    const ColumnVector& xCoM, double sp3Clk,
     67                    const ColumnVector& v, double sp3ClkRate) {
    6768
    6869  if (reopen(GPSweek, GPSweeks) == success) {
     
    8889
    8990    _out << "P" << prn.toLatin1().data()
    90          << setw(14) << setprecision(6) << xCoM(1) / 1000.0
    91          << setw(14) << setprecision(6) << xCoM(2) / 1000.0
    92          << setw(14) << setprecision(6) << xCoM(3) / 1000.0
    93          << setw(14) << setprecision(6) << sp3Clk * 1e6 << endl;
    94 
     91         << setw(14) << setprecision(6) << xCoM(1) / 1000.0 // [km]
     92         << setw(14) << setprecision(6) << xCoM(2) / 1000.0 // [km]
     93         << setw(14) << setprecision(6) << xCoM(3) / 1000.0 // [km]
     94         << setw(14) << setprecision(6) << sp3Clk * 1e6     // microseconds
     95         << endl;
     96
     97    if (sp3ClkRate) {
     98      _out << "V" << prn.toLatin1().data()
     99           << setw(14) << setprecision(6) << v(1) * 10.0      // [dm/s]
     100           << setw(14) << setprecision(6) << v(2) * 10.0      // [dm/s]
     101           << setw(14) << setprecision(6) << v(3) * 10.0      // [dm/s]
     102           << setw(14) << setprecision(6) << sp3ClkRate * 1e2 // 10^⁻4 microseconds/sec
     103           << endl;
     104    }
    95105    return success;
    96106  }
  • trunk/BNC/src/bncsp3.h

    r6351 r8483  
    1616   public:
    1717    t_sp3Sat() {
    18       _xyz.ReSize(3); 
     18      _xyz.ReSize(3);
    1919      _xyz      = 0.0;
    2020      _clk      = 0.0;
     
    4343  bncSP3(const QString& sklFileName, const QString& intr, int sampl); // output
    4444  virtual ~bncSP3();
    45   t_irc write(int GPSweek, double GPSweeks, const QString& prn,
    46               const ColumnVector& xCoM, double sp3Clk);
     45  t_irc write(int GPSweek, double GPSweeks, const QString& prn,
     46              const ColumnVector& xCoM, double sp3Clk,
     47              const ColumnVector& v, double sp3ClkRate);
    4748  const t_sp3Epoch* nextEpoch();
    4849  const t_sp3Epoch* currEpoch() const {return _currEpoch;}
  • trunk/BNC/src/combination/bnccomb.cpp

    r8447 r8483  
    449449  }
    450450
    451   ColumnVector oldXC(4);
     451  ColumnVector oldXC(7);
    452452  ColumnVector oldVV(3);
    453453  corr->_eph->getCrd(corr->_time, oldXC, oldVV, false);
    454454
    455   ColumnVector newXC(4);
     455  ColumnVector newXC(7);
    456456  ColumnVector newVV(3);
    457457  lastEph->getCrd(corr->_time, newXC, newVV, false);
     
    688688    const t_eph* eph = corr->_eph;
    689689    if (eph) {
    690       ColumnVector xc(4);
     690      ColumnVector xc(7);
    691691      ColumnVector vv(3);
    692692      eph->getCrd(_resTime, xc, vv, false);
     
    740740    clkCorrections.push_back(clkCorr);
    741741
    742     ColumnVector xc(4);
     742    ColumnVector xc(7);
    743743    ColumnVector vv(3);
    744744    corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr));
  • trunk/BNC/src/ephemeris.cpp

    r8456 r8483  
    368368  double tc = tt - _TOC;
    369369  xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
     370
     371  xc[4] = _clock_bias;
     372  xc[5] = _clock_drift;
     373  xc[6] = _clock_driftrate;
    370374
    371375  // Velocity
     
    651655  xc[3] = -_tau + _gamma * dtClk;
    652656
     657  xc[4] = -_tau;
     658  xc[5] = _gamma;
     659  xc[6] = 0.0;
     660
    653661  return success;
    654662}
     
    964972  xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
    965973
     974  xc[4] = _clock_bias;
     975  xc[5] = _clock_drift;
     976  xc[6] = _clock_driftrate;
     977
    966978  // Velocity
    967979  // --------
     
    13061318
    13071319  xc[3] = _agf0 + _agf1 * dt;
     1320
     1321  xc[4] = _agf0;
     1322  xc[5] = _agf1;
     1323  xc[6] = 0.0;
    13081324
    13091325  return success;
     
    16571673  xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
    16581674
     1675  xc[4] = _clock_bias;
     1676  xc[5] = _clock_drift;
     1677  xc[6] = _clock_driftrate;
     1678
    16591679  // dotC  = _clock_drift + _clock_driftrate*tc
    16601680  //       - 4.442807633e-10*_e*sqrt(a0)*cos(E) * dEdM * n;
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r8397 r8483  
    351351  }
    352352  if (eph) {
    353     ColumnVector xc(4);
     353    ColumnVector xc(7);
    354354    ColumnVector vv(3);
    355355    if ( xyzSta.size() == 3 && (xyzSta[0] != 0.0 || xyzSta[1] != 0.0 || xyzSta[2] != 0.0) &&
     
    11011101      for (epoTime = startTime - interval; epoTime < endTime;
    11021102           epoTime = epoTime + interval) {
    1103         ColumnVector xc(4);
     1103        ColumnVector xc(7);
    11041104        ColumnVector vv(3);
    11051105        if ( xyzSta.size() == 3 && (xyzSta[0] != 0.0 || xyzSta[1] != 0.0 || xyzSta[2] != 0.0) &&
  • trunk/BNC/src/satObs.cpp

    r7058 r8483  
    1818}
    1919
    20 // 
     20//
    2121////////////////////////////////////////////////////////////////////////////
    2222void t_clkCorr::writeEpoch(ostream* out, const QList<t_clkCorr>& corrList) {
     
    4343}
    4444
    45 // 
     45//
    4646////////////////////////////////////////////////////////////////////////////
    4747void t_clkCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_clkCorr>& corrList) {
     
    6262    getline(inStream, line);
    6363    istringstream in(line.c_str());
    64    
     64
    6565    in >> corr._prn >> corr._iod >> corr._dClk >> corr._dotDClk >> corr._dotDotDClk;
    6666    if (corr._prn.system() == 'E') {
     
    8585}
    8686
    87 // 
     87//
    8888////////////////////////////////////////////////////////////////////////////
    8989void t_orbCorr::writeEpoch(ostream* out, const QList<t_orbCorr>& corrList) {
     
    113113}
    114114
    115 // 
     115//
    116116////////////////////////////////////////////////////////////////////////////
    117117void t_orbCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_orbCorr>& corrList) {
     
    132132    getline(inStream, line);
    133133    istringstream in(line.c_str());
    134    
     134
    135135    in >> corr._prn      >> corr._iod
    136        >> corr._xr[0]    >> corr._xr[1]    >> corr._xr[2]   
     136       >> corr._xr[0]    >> corr._xr[1]    >> corr._xr[2]
    137137       >> corr._dotXr[0] >> corr._dotXr[1] >> corr._dotXr[2];
    138138
     
    144144}
    145145
    146 //
     146// Constructor
     147////////////////////////////////////////////////////////////////////////////
     148t_URA::t_URA() {
     149  _updateInt  = 0;
     150  _iod        = 0;
     151  _ura        = 0.0;
     152}
     153
     154//
     155////////////////////////////////////////////////////////////////////////////
     156void t_URA::writeEpoch(ostream* out, const QList<t_URA>& corrList) {
     157  if (!out || corrList.size() == 0) {
     158    return;
     159  }
     160  out->setf(ios::fixed);
     161  bncTime epoTime;
     162  QListIterator<t_URA> it(corrList);
     163  while (it.hasNext()) {
     164    const t_URA& corr = it.next();
     165    if (!epoTime.valid()) {
     166      epoTime = corr._time;
     167      *out << "> URA " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
     168          <<  corr._updateInt <<  " "
     169           << corrList.size() << ' ' << corr._staID << endl;
     170    }
     171    *out << corr._prn.toString() << ' ' << setw(11) << corr._iod << ' '
     172         << setw(10) << setprecision(4) << corr._ura << endl;
     173  }
     174  out->flush();
     175}
     176
     177//
     178////////////////////////////////////////////////////////////////////////////
     179void t_URA::readEpoch(const string& epoLine, istream& inStream, QList<t_URA>& corrList) {
     180  bncTime      epoTime;
     181  unsigned int updateInt;
     182  int          numCorr;
     183  string       staID;
     184  if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::URA) {
     185    return;
     186  }
     187  for (int ii = 0; ii < numCorr; ii++) {
     188    t_URA corr;
     189    corr._time      = epoTime;
     190    corr._updateInt = updateInt;
     191    corr._staID     = staID;
     192
     193    string line;
     194    getline(inStream, line);
     195    istringstream in(line.c_str());
     196
     197    in >> corr._prn >> corr._iod >> corr._ura;
     198
     199    corrList.push_back(corr);
     200  }
     201}
     202
     203//
    147204////////////////////////////////////////////////////////////////////////////
    148205void t_satCodeBias::writeEpoch(ostream* out, const QList<t_satCodeBias>& biasList) {
     
    172229}
    173230
    174 // 
     231//
    175232////////////////////////////////////////////////////////////////////////////
    176233void t_satCodeBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satCodeBias>& biasList) {
     
    191248    getline(inStream, line);
    192249    istringstream in(line.c_str());
    193    
     250
    194251    int numBias;
    195252    in >> satCodeBias._prn >> numBias;
     
    207264}
    208265
    209 // 
     266//
    210267////////////////////////////////////////////////////////////////////////////
    211268void t_satPhaseBias::writeEpoch(ostream* out, const QList<t_satPhaseBias>& biasList) {
     
    242299  out->flush();
    243300}
    244  
    245 // 
     301
     302//
    246303////////////////////////////////////////////////////////////////////////////
    247304void t_satPhaseBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satPhaseBias>& biasList) {
     
    290347}
    291348
    292 // 
     349//
    293350////////////////////////////////////////////////////////////////////////////
    294351void t_vTec::write(ostream* out, const t_vTec& vTec) {
     
    306363         << setw(2)  << layer._C.Nrows()-1 << ' '
    307364         << setw(2)  << layer._C.Ncols()-1 << ' '
    308          << setw(10) << setprecision(1) << layer._height << endl 
    309          << setw(10) << setprecision(4) << layer._C 
     365         << setw(10) << setprecision(1) << layer._height << endl
     366         << setw(10) << setprecision(4) << layer._C
    310367         << setw(10) << setprecision(4) << layer._S;
    311368  }
     
    313370}
    314371
    315 // 
     372//
    316373////////////////////////////////////////////////////////////////////////////
    317374void t_vTec::read(const string& epoLine, istream& inStream, t_vTec& vTec) {
     
    357414}
    358415
    359 // 
    360 ////////////////////////////////////////////////////////////////////////////
    361 t_corrSSR::e_type t_corrSSR::readEpoLine(const string& line, bncTime& epoTime, 
     416//
     417////////////////////////////////////////////////////////////////////////////
     418t_corrSSR::e_type t_corrSSR::readEpoLine(const string& line, bncTime& epoTime,
    362419                                         unsigned int& updateInt, int& numEntries,
    363420                                         string& staID) {
     
    370427  double sec;
    371428
    372   inLine >> epoChar >> typeString 
     429  inLine >> epoChar >> typeString
    373430         >> year >> month >> day >> hour >> min >> sec >> updateInt >> numEntries >> staID;
    374431
     
    390447      return vTec;
    391448    }
     449    else if (typeString == "URA") {
     450      return URA;
     451    }
    392452  }
    393453
  • trunk/BNC/src/satObs.h

    r7611 r8483  
    110110};
    111111
     112class t_URA {
     113 public:
     114  t_URA();
     115  static void writeEpoch(std::ostream* out, const QList<t_URA>& corrList);
     116  static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_URA>& corrList);
     117  std::string    _staID;
     118  t_prn          _prn;
     119  unsigned int   _iod;
     120  bncTime        _time;
     121  unsigned int   _updateInt;
     122  double         _ura;
     123};
     124
    112125class t_frqCodeBias {
    113126 public:
     
    189202class t_corrSSR {
    190203 public:
    191   enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, unknown};
     204  enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, URA, unknown};
    192205  static e_type readEpoLine(const std::string& line, bncTime& epoTime,
    193206                            unsigned int& updateInt, int& numEntries, std::string& staID);
  • trunk/BNC/src/upload/bncrtnetuploadcaster.cpp

    r8405 r8483  
    333333  for (int ii = 1; ii < lines.size(); ii++) {
    334334    QString key;  // prn or key VTEC, IND (phase bias indicators)
    335     ColumnVector rtnAPC;
    336     ColumnVector rtnVel;
    337     ColumnVector rtnCoM;
    338     double rtnClk;
     335    double rtnUra;          // [m]
     336    ColumnVector rtnAPC;    // [m, m, m]
     337    ColumnVector rtnVel;    // [m/s, m/s, m/s]]
     338    ColumnVector rtnCoM;    // [m, m, m]
     339    ColumnVector rtnClk;    // [m, m/s, m/s²]
     340    ColumnVector rtnClkSig; // [m, m/s, m/s²]
    339341    t_prn prn;
    340342
     
    435437          }
    436438        }
    437         else if (key == "Clk") {
     439        else if (key == "Ura") {
    438440          in >> numVal;
    439441          if (numVal == 1)
    440             in >> rtnClk;
     442            in >> rtnUra;
     443        }
     444        else if (key == "Clk") {
     445          rtnClk.ReSize(3);
     446          for (int ii = 0; ii < 3; ii++) {
     447            rtnClk[ii] = 0.0;
     448          }
     449          in >> numVal;
     450          for (int ii = 0; ii < numVal; ii++) {
     451            in >> rtnClk[ii];
     452          }
     453        }
     454        else if (key == "ClkSig") {
     455          rtnClkSig.ReSize(3);
     456          for (int ii = 0; ii < 3; ii++) {
     457            rtnClkSig[ii] = 0.0;
     458          }
     459          in >> numVal;
     460          for (int ii = 0; ii < numVal; ii++) {
     461            in >> rtnClkSig[ii];
     462          }
    441463        }
    442464        else if (key == "Vel") {
     
    526548      if (sd) {
    527549        QString outLine;
    528         processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prnStr, rtnAPC,
    529             rtnClk, rtnVel, rtnCoM, sd, outLine);
     550        processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prnStr, rtnAPC, rtnUra,
     551            rtnClk, rtnVel, rtnCoM, rtnClkSig, sd, outLine);
    530552      }
    531553
     
    22432265void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
    22442266    double GPSweeks, const QString& prn, const ColumnVector& rtnAPC,
    2245     double rtnClk, const ColumnVector& rtnVel, const ColumnVector& rtnCoM,
     2267    double rtnUra, const ColumnVector& rtnClk, const ColumnVector& rtnVel,
     2268    const ColumnVector& rtnCoM, const ColumnVector& rtnClkSig,
    22462269    struct ClockOrbit::SatData* sd, QString& outLine) {
    22472270
    22482271  // Broadcast Position and Velocity
    22492272  // -------------------------------
    2250   ColumnVector xB(4);
     2273  ColumnVector xB(7);
    22512274  ColumnVector vB(3);
    22522275  eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
     
    22762299  // Clock Correction
    22772300  // ----------------
    2278   double dClk = rtnClk - (xB(4) - dc) * t_CST::c;
     2301  double dClkA0 = rtnClk(1) - (xB(5) - dc) * t_CST::c;
     2302  double dClkA1 = rtnClk(2) - xB(6) * t_CST::c;
     2303  double dClkA2 = rtnClk(3) - xB(7) * t_CST::c;
    22792304
    22802305  if (sd) {
    22812306    sd->ID = prn.mid(1).toInt();
    22822307    sd->IOD = eph->IOD();
    2283     sd->Clock.DeltaA0 = dClk;
    2284     sd->Clock.DeltaA1 = 0.0; // TODO
    2285     sd->Clock.DeltaA2 = 0.0; // TODO
    2286     sd->Orbit.DeltaRadial = rsw(1);
     2308    sd->Clock.DeltaA0 = dClkA0;
     2309    sd->Clock.DeltaA1 = dClkA1;
     2310    sd->Clock.DeltaA2 = dClkA2;
     2311    sd->UserRangeAccuracy = rtnUra;
     2312    sd->Orbit.DeltaRadial     = rsw(1);
    22872313    sd->Orbit.DeltaAlongTrack = rsw(2);
    22882314    sd->Orbit.DeltaCrossTrack = rsw(3);
    2289     sd->Orbit.DotDeltaRadial = dotRsw(1);
     2315    sd->Orbit.DotDeltaRadial     = dotRsw(1);
    22902316    sd->Orbit.DotDeltaAlongTrack = dotRsw(2);
    22912317    sd->Orbit.DotDeltaCrossTrack = dotRsw(3);
    22922318  }
    22932319
    2294   outLine.sprintf("%d %.1f %s  %u  %10.3f %8.3f %8.3f %8.3f\n", GPSweek,
    2295       GPSweeks, eph->prn().toString().c_str(), eph->IOD(), dClk, rsw(1), rsw(2),
    2296       rsw(3));
     2320  outLine.sprintf("%d %.1f %s  %u  %10.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n", GPSweek,
     2321      GPSweeks, eph->prn().toString().c_str(), eph->IOD(), dClkA0, dClkA1, dClkA2,
     2322      rsw(1), rsw(2), rsw(3));
    22972323
    22982324  double relativity = -2.0 * DotProduct(xP, rtnVel) / t_CST::c;
    2299   double sp3Clk = (rtnClk - relativity) / t_CST::c;  // in seconds
     2325  double clkRnx     = (rtnClk[0] - relativity) / t_CST::c;  // in seconds
     2326  double clkRnxRate = rtnClk[1] / t_CST::c;                 // [s/s = -]
     2327  double clkRnxAcc  = rtnClk[2] / t_CST::c;                 // [s/s² ) -/s]
    23002328
    23012329  if (_rnx) {
    2302     _rnx->write(GPSweek, GPSweeks, prn, sp3Clk);
     2330    double clkRnxSig     = rtnClkSig[0] / t_CST::c;           // in seconds
     2331    double clkRnxRateSig = rtnClkSig[1] / t_CST::c;           // [s/s = -]
     2332    double clkRnxAccSig  = rtnClkSig[2] / t_CST::c;           // [s/s² ) -/s]
     2333    _rnx->write(GPSweek, GPSweeks, prn, clkRnx, clkRnxRate, clkRnxAcc,
     2334                clkRnxSig, clkRnxRateSig, clkRnxAccSig);
    23032335  }
    23042336  if (_sp3) {
    2305     _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, sp3Clk);
     2337    _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, clkRnx, rtnVel, clkRnxRate);
    23062338  }
    23072339}
  • trunk/BNC/src/upload/bncrtnetuploadcaster.h

    r8414 r8483  
    3333                        double GPSweeks, const QString& prn,
    3434                        const ColumnVector& rtnAPC,
    35                         double rtnClk,
     35                        double ura,
     36                        const ColumnVector& rtnClk,
    3637                        const ColumnVector& rtnVel,
    3738                        const ColumnVector& rtnCoM,
     39                        const ColumnVector& rtnClkSig,
    3840                        struct ClockOrbit::SatData* sd,
    3941                        QString& outLine);
Note: See TracChangeset for help on using the changeset viewer.