Changeset 7054 in ntrip


Ignore:
Timestamp:
Jul 16, 2015, 9:49:27 AM (9 years ago)
Author:
stuerze
Message:

two methods were added to compute IODs for BDS and SBAS from CRC over broadcasted ephemeris and clock parameters as described in the respective SSR proposal

Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r7014 r7054  
    645645// IOD of Glonass Ephemeris (virtual)
    646646////////////////////////////////////////////////////////////////////////////
    647 int t_ephGlo::IOD() const {
     647unsigned long t_ephGlo::IOD() const {
    648648  bncTime tMoscow = _TOC - _gps_utc + 3 * 3600.0;
    649   return int(tMoscow.daysec() / 900);
     649  return (unsigned long)tMoscow.daysec() / 900;
    650650}
    651651
     
    11301130}
    11311131
     1132// IOD of SBAS Ephemeris (virtual)
     1133////////////////////////////////////////////////////////////////////////////
     1134
     1135unsigned long t_ephSBAS::IOD() const {
     1136  unsigned char buffer[80];
     1137  int size = 0;
     1138  int numbits = 0;
     1139  long long bitbuffer = 0;
     1140  unsigned char *startbuffer = buffer;
     1141
     1142  SBASADDBITSFLOAT(30, this->_x_pos, 0.08)
     1143  SBASADDBITSFLOAT(30, this->_y_pos, 0.08)
     1144  SBASADDBITSFLOAT(25, this->_z_pos, 0.4)
     1145  SBASADDBITSFLOAT(17, this->_x_velocity, 0.000625)
     1146  SBASADDBITSFLOAT(17, this->_y_velocity, 0.000625)
     1147  SBASADDBITSFLOAT(18, this->_z_velocity, 0.004)
     1148  SBASADDBITSFLOAT(10, this->_x_acceleration, 0.0000125)
     1149  SBASADDBITSFLOAT(10, this->_y_acceleration, 0.0000125)
     1150  SBASADDBITSFLOAT(10, this->_z_acceleration, 0.0000625)
     1151  SBASADDBITSFLOAT(12, this->_agf0, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1152  SBASADDBITSFLOAT(8, this->_agf1, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<10))
     1153  SBASADDBITS(5,0); // the last byte is filled by 0-bits to obtain a length of an integer multiple of 8
     1154
     1155  return CRC24(size, startbuffer);
     1156}
     1157
    11321158// Compute SBAS Satellite Position (virtual)
    11331159////////////////////////////////////////////////////////////////////////////
     
    13311357  //         but it seems to be unreliable in RINEX files
    13321358  //_TOT = _TOC.bdssec();
     1359}
     1360
     1361// IOD of BDS Ephemeris (virtual)
     1362////////////////////////////////////////////////////////////////////////////
     1363unsigned long t_ephBDS::IOD() const {
     1364  unsigned char buffer[80];
     1365  int size = 0;
     1366  int numbits = 0;
     1367  long long bitbuffer = 0;
     1368  unsigned char *startbuffer = buffer;
     1369
     1370  BDSADDBITSFLOAT(14, this->_IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     1371  BDSADDBITSFLOAT(11, this->_clock_driftrate, 1.0/static_cast<double>(1<<30)
     1372      /static_cast<double>(1<<30)/static_cast<double>(1<<6))
     1373  BDSADDBITSFLOAT(22, this->_clock_drift, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<20))
     1374  BDSADDBITSFLOAT(24, this->_clock_bias, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<3))
     1375  BDSADDBITSFLOAT(18, this->_Crs, 1.0/static_cast<double>(1<<6))
     1376  BDSADDBITSFLOAT(16, this->_Delta_n, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     1377  BDSADDBITSFLOAT(32, this->_M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1378  BDSADDBITSFLOAT(18, this->_Cuc, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1379  BDSADDBITSFLOAT(32, this->_e, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<3))
     1380  BDSADDBITSFLOAT(18, this->_Cus, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1381  BDSADDBITSFLOAT(32, this->_sqrt_A, 1.0/static_cast<double>(1<<19))
     1382  BDSADDBITSFLOAT(18, this->_Cic, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1383  BDSADDBITSFLOAT(32, this->_OMEGA0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1384  BDSADDBITSFLOAT(18, this->_Cis, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1385  BDSADDBITSFLOAT(32, this->_i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1386  BDSADDBITSFLOAT(18, this->_Crc, 1.0/static_cast<double>(1<<6))
     1387  BDSADDBITSFLOAT(32, this->_omega, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     1388  BDSADDBITSFLOAT(24, this->_OMEGADOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     1389  BDSADDBITS(5, 0)  // the last byte is filled by 0-bits to obtain a length of an integer multiple of 8
     1390
     1391  return CRC24(size, startbuffer);
    13331392}
    13341393
  • trunk/BNC/src/ephemeris.h

    r6843 r7054  
    1111#include "gnss.h"
    1212
     13
    1314class t_orbCorr;
    1415class t_clkCorr;
     
    2425  virtual e_type  type() const = 0;
    2526  virtual QString toString(double version) const = 0;
    26   virtual int    IOD() const = 0;
     27  virtual unsigned long IOD() const = 0;
    2728  virtual int     slotNum() const {return 0;}
    2829  bncTime TOC() const {return _TOC;}
     
    6061  virtual e_type type() const {return (_prn.system() == 'J' ? t_eph::QZSS : t_eph::GPS); }
    6162  virtual QString toString(double version) const;
    62   virtual int  IOD() const { return static_cast<int>(_IODC); }
     63  virtual unsigned long  IOD() const { return static_cast<unsigned long>(_IODC); }
    6364  double TGD() const {return _TGD;} // Timing Group Delay (P1-P2 DCB)
    6465
     
    114115  virtual e_type type() const {return t_eph::GLONASS;}
    115116  virtual QString toString(double version) const;
    116   virtual int  IOD() const;
     117  virtual unsigned long  IOD() const;
    117118  virtual int slotNum() const {return int(_frequency_number);}
    118119
     
    155156  virtual QString toString(double version) const;
    156157  virtual e_type type() const {return t_eph::Galileo;}
    157   virtual int  IOD() const { return static_cast<int>(_IODnav); }
     158  virtual unsigned long  IOD() const { return static_cast<unsigned long>(_IODnav); }
    158159
    159160 private:
     
    217218
    218219  virtual e_type  type() const {return t_eph::SBAS;}
    219   virtual int     IOD() const {return _IODN;}
     220  virtual unsigned long IOD() const;
    220221  virtual QString toString(double version) const;
    221222
     
    253254
    254255  virtual e_type  type() const {return t_eph::BDS;}
    255   virtual int     IOD() const {return _AODC;}
     256  virtual unsigned long IOD() const;
    256257  virtual QString toString(double version) const;
    257258
Note: See TracChangeset for help on using the changeset viewer.