source: ntrip/trunk/BNC/RTCM3/ephemeris.h@ 3000

Last change on this file since 3000 was 2770, checked in by mervart, 14 years ago
File size: 4.8 KB
Line 
1#ifndef EPHEMERIS_H
2#define EPHEMERIS_H
3
4#include <newmat.h>
5
6#include <stdio.h>
7#include <string>
8extern "C" {
9#include "rtcm3torinex.h"
10}
11
12class t_eph {
13 public:
14 virtual ~t_eph() {};
15
16 bool isNewerThan(const t_eph* eph) const;
17 std::string prn() const {return _prn;}
18
19 int GPSweek() const { return _GPSweek; }
20 double GPSweeks() const { return _GPSweeks; }
21
22 virtual void position(int GPSweek, double GPSweeks,
23 double* xc, double* vv) const = 0;
24
25 void position(int GPSweek, double GPSweeks,
26 double& xx, double& yy, double& zz, double& cc) const {
27 double tmp_xx[4];
28 double tmp_vv[4];
29
30 position(GPSweek, GPSweeks, tmp_xx, tmp_vv);
31
32 xx = tmp_xx[0];
33 yy = tmp_xx[1];
34 zz = tmp_xx[2];
35 cc = tmp_xx[3];
36 }
37
38 virtual int IOD() const = 0;
39
40 protected:
41 std::string _prn;
42 int _GPSweek;
43 double _GPSweeks;
44};
45
46
47class t_ephGPS : public t_eph {
48 public:
49 t_ephGPS() { }
50 virtual ~t_ephGPS() {}
51 double TOC() const {return _TOC;}
52
53 void set(const gpsephemeris* ee);
54
55 virtual void position(int GPSweek, double GPSweeks,
56 double* xc,
57 double* vv) const;
58
59 virtual int IOD() const { return static_cast<int>(_IODC); }
60
61 private:
62 double _TOW; // [s]
63 double _TOC; // [s]
64 double _TOE; // [s]
65 double _IODE;
66 double _IODC;
67
68 double _clock_bias; // [s]
69 double _clock_drift; // [s/s]
70 double _clock_driftrate; // [s/s^2]
71
72 double _Crs; // [m]
73 double _Delta_n; // [rad/s]
74 double _M0; // [rad]
75 double _Cuc; // [rad]
76 double _e; //
77 double _Cus; // [rad]
78 double _sqrt_A; // [m^0.5]
79 double _Cic; // [rad]
80 double _OMEGA0; // [rad]
81 double _Cis; // [rad]
82 double _i0; // [rad]
83 double _Crc; // [m]
84 double _omega; // [rad]
85 double _OMEGADOT; // [rad/s]
86 double _IDOT; // [rad/s]
87
88 double _TGD; // [s]
89};
90
91class t_ephGlo : public t_eph {
92 public:
93 t_ephGlo() { _xv.ReSize(6); }
94
95 virtual ~t_ephGlo() {}
96
97 virtual void position(int GPSweek, double GPSweeks,
98 double* xc,
99 double* vv) const;
100
101 virtual int IOD() const;
102
103 void set(const glonassephemeris* ee);
104
105 private:
106 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
107 double* acc);
108
109 mutable double _tt; // time in seconds of GPSweek
110 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt
111
112 double _E; // [days]
113 double _tau; // [s]
114 double _gamma; //
115 double _x_pos; // [km]
116 double _x_velocity; // [km/s]
117 double _x_acceleration; // [km/s^2]
118 double _y_pos; // [km]
119 double _y_velocity; // [km/s]
120 double _y_acceleration; // [km/s^2]
121 double _z_pos; // [km]
122 double _z_velocity; // [km/s]
123 double _z_acceleration; // [km/s^2]
124 double _health; // 0 = O.K.
125 double _frequency_number; // ICD-GLONASS data position
126 double _tki; // message frame time
127};
128
129class t_ephGal : public t_eph {
130 public:
131 t_ephGal() { }
132 virtual ~t_ephGal() {}
133 double TOC() const {return _TOC;}
134
135 void set(const galileoephemeris* ee);
136
137 virtual void position(int GPSweek, double GPSweeks,
138 double* xc,
139 double* vv) const;
140
141 virtual int IOD() const { return static_cast<int>(_IODnav); }
142
143 private:
144 double _IODnav;
145 double _TOC; // [s]
146 double _TOE; // [s]
147 double _clock_bias; // [s]
148 double _clock_drift; // [s/s]
149 double _clock_driftrate; // [s/s^2]
150 double _Crs; // [m]
151 double _Delta_n; // [rad/s]
152 double _M0; // [rad]
153 double _Cuc; // [rad]
154 double _e; //
155 double _Cus; // [rad]
156 double _sqrt_A; // [m^0.5]
157 double _Cic; // [rad]
158 double _OMEGA0; // [rad]
159 double _Cis; // [rad]
160 double _i0; // [rad]
161 double _Crc; // [m]
162 double _omega; // [rad]
163 double _OMEGADOT; // [rad/s]
164 double _IDOT; // [rad/s]
165 double _BGD_1_5A; // group delay [s]
166 int _SISA; // Signal In Space Accuracy
167 int _E5aHS; // E5a Health Status
168
169};
170
171#endif
Note: See TracBrowser for help on using the repository browser.