| 1 | #ifndef SATOBS_H
|
|---|
| 2 | #define SATOBS_H
|
|---|
| 3 |
|
|---|
| 4 | #include <string>
|
|---|
| 5 | #include <vector>
|
|---|
| 6 | #include <newmat.h>
|
|---|
| 7 |
|
|---|
| 8 | #include <QtCore>
|
|---|
| 9 |
|
|---|
| 10 | #include "bncconst.h"
|
|---|
| 11 | #include "bnctime.h"
|
|---|
| 12 | #include "t_prn.h"
|
|---|
| 13 |
|
|---|
| 14 | class t_frqObs {
|
|---|
| 15 | public:
|
|---|
| 16 | t_frqObs() {
|
|---|
| 17 | _code = 0.0;
|
|---|
| 18 | _codeValid = false;
|
|---|
| 19 | _phase = 0.0;
|
|---|
| 20 | _phaseValid = false;
|
|---|
| 21 | _doppler = 0.0;
|
|---|
| 22 | _dopplerValid = false;
|
|---|
| 23 | _snr = 0.0;
|
|---|
| 24 | _snrValid = false;
|
|---|
| 25 | _lockTime = -1.0;
|
|---|
| 26 | _lockTimeValid = false;
|
|---|
| 27 | _slip = false;
|
|---|
| 28 | _slipCounter = 0;
|
|---|
| 29 | _biasJumpCounter = 0;
|
|---|
| 30 | _lockTimeIndicator = -1;
|
|---|
| 31 | }
|
|---|
| 32 | std::string _rnxType2ch;
|
|---|
| 33 | double _code;
|
|---|
| 34 | bool _codeValid;
|
|---|
| 35 | double _phase;
|
|---|
| 36 | bool _phaseValid;
|
|---|
| 37 | double _doppler;
|
|---|
| 38 | bool _dopplerValid;
|
|---|
| 39 | double _snr;
|
|---|
| 40 | bool _snrValid;
|
|---|
| 41 | double _lockTime;
|
|---|
| 42 | bool _lockTimeValid;
|
|---|
| 43 | bool _slip; // RINEX
|
|---|
| 44 | int _slipCounter; // RTCM2 or converted from RTCM3
|
|---|
| 45 | int _lockTimeIndicator; // RTCM3
|
|---|
| 46 | int _biasJumpCounter; // ??
|
|---|
| 47 | };
|
|---|
| 48 |
|
|---|
| 49 | class t_satObs {
|
|---|
| 50 | public:
|
|---|
| 51 | t_satObs() {
|
|---|
| 52 | _type = 0;
|
|---|
| 53 | }
|
|---|
| 54 | t_satObs(const t_satObs& old) { // copy constructor (deep copy)
|
|---|
| 55 | _staID = old._staID;
|
|---|
| 56 | _prn = old._prn;
|
|---|
| 57 | _time = old._time;
|
|---|
| 58 | _type = old._type;
|
|---|
| 59 | for (unsigned ii = 0; ii < old._obs.size(); ii++) {
|
|---|
| 60 | _obs.push_back(new t_frqObs(*old._obs[ii]));
|
|---|
| 61 | }
|
|---|
| 62 | }
|
|---|
| 63 | /**
|
|---|
| 64 | * Destructor of satellite measurement storage class
|
|---|
| 65 | */
|
|---|
| 66 | ~t_satObs() {
|
|---|
| 67 | clear();
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | /**
|
|---|
| 71 | * Cleanup function resets all elements to initial state.
|
|---|
| 72 | */
|
|---|
| 73 | inline void clear(void) {
|
|---|
| 74 | for (unsigned ii = 0; ii < _obs.size(); ii++)
|
|---|
| 75 | delete _obs[ii];
|
|---|
| 76 | _obs.clear();
|
|---|
| 77 | _obs.resize(0);
|
|---|
| 78 | _time.reset();
|
|---|
| 79 | _prn.clear();
|
|---|
| 80 | _staID.clear();
|
|---|
| 81 | _type = 0;
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | std::string _staID;
|
|---|
| 85 | t_prn _prn;
|
|---|
| 86 | bncTime _time;
|
|---|
| 87 | int _type;
|
|---|
| 88 | std::vector<t_frqObs*> _obs;
|
|---|
| 89 | };
|
|---|
| 90 |
|
|---|
| 91 | class t_orbCorr {
|
|---|
| 92 | public:
|
|---|
| 93 | t_orbCorr();
|
|---|
| 94 | t_orbCorr(const t_orbCorr& old) { // copy constructor (deep copy)
|
|---|
| 95 | _staID = old._staID;
|
|---|
| 96 | _prn = old._prn;
|
|---|
| 97 | _iod = old._iod;
|
|---|
| 98 | _time = old._time;
|
|---|
| 99 | _updateInt = old._updateInt;
|
|---|
| 100 | _system = old._system;
|
|---|
| 101 | _xr = old._xr;
|
|---|
| 102 | _dotXr = old._dotXr;
|
|---|
| 103 | }
|
|---|
| 104 | static void writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList);
|
|---|
| 105 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_orbCorr>& corrList);
|
|---|
| 106 | std::string _staID;
|
|---|
| 107 | t_prn _prn;
|
|---|
| 108 | unsigned int _iod;
|
|---|
| 109 | bncTime _time;
|
|---|
| 110 | unsigned int _updateInt;
|
|---|
| 111 | char _system;
|
|---|
| 112 | ColumnVector _xr;
|
|---|
| 113 | ColumnVector _dotXr;
|
|---|
| 114 | };
|
|---|
| 115 |
|
|---|
| 116 | class t_clkCorr {
|
|---|
| 117 | public:
|
|---|
| 118 | t_clkCorr();
|
|---|
| 119 | t_clkCorr(const t_clkCorr& old) { // copy constructor (deep copy)
|
|---|
| 120 | _staID = old._staID;
|
|---|
| 121 | _prn = old._prn;
|
|---|
| 122 | _iod = old._iod;
|
|---|
| 123 | _time = old._time;
|
|---|
| 124 | _updateInt = old._updateInt;
|
|---|
| 125 | _dClk = old._dClk;
|
|---|
| 126 | _dotDClk = old._dotDClk;
|
|---|
| 127 | _dotDotDClk = old._dotDotDClk;
|
|---|
| 128 | }
|
|---|
| 129 | static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList);
|
|---|
| 130 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_clkCorr>& corrList);
|
|---|
| 131 | std::string _staID;
|
|---|
| 132 | t_prn _prn;
|
|---|
| 133 | unsigned int _iod;
|
|---|
| 134 | bncTime _time;
|
|---|
| 135 | unsigned int _updateInt;
|
|---|
| 136 | double _dClk;
|
|---|
| 137 | double _dotDClk;
|
|---|
| 138 | double _dotDotDClk;
|
|---|
| 139 | };
|
|---|
| 140 |
|
|---|
| 141 | class t_URA {
|
|---|
| 142 | public:
|
|---|
| 143 | t_URA();
|
|---|
| 144 | static void writeEpoch(std::ostream* out, const QList<t_URA>& corrList);
|
|---|
| 145 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_URA>& corrList);
|
|---|
| 146 | std::string _staID;
|
|---|
| 147 | t_prn _prn;
|
|---|
| 148 | unsigned int _iod;
|
|---|
| 149 | bncTime _time;
|
|---|
| 150 | unsigned int _updateInt;
|
|---|
| 151 | double _ura;
|
|---|
| 152 | };
|
|---|
| 153 |
|
|---|
| 154 | class t_frqCodeBias {
|
|---|
| 155 | public:
|
|---|
| 156 | t_frqCodeBias() {
|
|---|
| 157 | _value = 0.0;
|
|---|
| 158 | }
|
|---|
| 159 | std::string _rnxType2ch;
|
|---|
| 160 | double _value;
|
|---|
| 161 | };
|
|---|
| 162 |
|
|---|
| 163 | class t_satCodeBias {
|
|---|
| 164 | public:
|
|---|
| 165 | t_satCodeBias() {
|
|---|
| 166 | _updateInt = 0;
|
|---|
| 167 | }
|
|---|
| 168 | t_satCodeBias(const t_satCodeBias& old) { // copy constructor (deep copy)
|
|---|
| 169 | _staID = old._staID;
|
|---|
| 170 | _prn = old._prn;
|
|---|
| 171 | _time = old._time;
|
|---|
| 172 | _updateInt = old._updateInt;
|
|---|
| 173 | for (unsigned ii = 0; ii < old._bias.size(); ii++) {
|
|---|
| 174 | _bias.push_back(old._bias[ii]);
|
|---|
| 175 | }
|
|---|
| 176 | }
|
|---|
| 177 | static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList);
|
|---|
| 178 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList);
|
|---|
| 179 | std::string _staID;
|
|---|
| 180 | t_prn _prn;
|
|---|
| 181 | bncTime _time;
|
|---|
| 182 | unsigned int _updateInt;
|
|---|
| 183 | std::vector<t_frqCodeBias> _bias;
|
|---|
| 184 | };
|
|---|
| 185 |
|
|---|
| 186 | class t_frqPhaseBias {
|
|---|
| 187 | public:
|
|---|
| 188 | t_frqPhaseBias() {
|
|---|
| 189 | _value = 0.0;
|
|---|
| 190 | _fixIndicator = 0;
|
|---|
| 191 | _fixWideLaneIndicator = 0;
|
|---|
| 192 | _jumpCounter = 0;
|
|---|
| 193 | }
|
|---|
| 194 | std::string _rnxType2ch;
|
|---|
| 195 | double _value;
|
|---|
| 196 | int _fixIndicator;
|
|---|
| 197 | int _fixWideLaneIndicator;
|
|---|
| 198 | int _jumpCounter;
|
|---|
| 199 | };
|
|---|
| 200 |
|
|---|
| 201 | class t_satPhaseBias {
|
|---|
| 202 | public:
|
|---|
| 203 | t_satPhaseBias() {
|
|---|
| 204 | _updateInt = 0;
|
|---|
| 205 | _dispBiasConstistInd = 0;
|
|---|
| 206 | _MWConsistInd = 0;
|
|---|
| 207 | _yaw = 0.0;
|
|---|
| 208 | _yawRate = 0.0;
|
|---|
| 209 | }
|
|---|
| 210 | t_satPhaseBias(const t_satPhaseBias& old) { // copy constructor (deep copy)
|
|---|
| 211 | _staID = old._staID;
|
|---|
| 212 | _prn = old._prn;
|
|---|
| 213 | _time = old._time;
|
|---|
| 214 | _updateInt = old._updateInt;
|
|---|
| 215 | _dispBiasConstistInd = old._dispBiasConstistInd;
|
|---|
| 216 | _MWConsistInd = old._MWConsistInd;
|
|---|
| 217 | _yaw = old._yaw;
|
|---|
| 218 | _yawRate = old._yawRate;
|
|---|
| 219 | for (unsigned ii = 0; ii < old._bias.size(); ii++) {
|
|---|
| 220 | _bias.push_back(old._bias[ii]);
|
|---|
| 221 | }
|
|---|
| 222 | }
|
|---|
| 223 | static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList);
|
|---|
| 224 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList);
|
|---|
| 225 | std::string _staID;
|
|---|
| 226 | t_prn _prn;
|
|---|
| 227 | bncTime _time;
|
|---|
| 228 | unsigned int _updateInt; // not satellite specific
|
|---|
| 229 | unsigned int _dispBiasConstistInd; // not satellite specific
|
|---|
| 230 | unsigned int _MWConsistInd; // not satellite specific
|
|---|
| 231 | double _yaw;
|
|---|
| 232 | double _yawRate;
|
|---|
| 233 | std::vector<t_frqPhaseBias> _bias;
|
|---|
| 234 | };
|
|---|
| 235 |
|
|---|
| 236 | class t_vTecLayer {
|
|---|
| 237 | public:
|
|---|
| 238 | t_vTecLayer() {
|
|---|
| 239 | _height = 0.0;
|
|---|
| 240 | }
|
|---|
| 241 | double _height;
|
|---|
| 242 | Matrix _C;
|
|---|
| 243 | Matrix _S;
|
|---|
| 244 | };
|
|---|
| 245 |
|
|---|
| 246 | class t_vTec {
|
|---|
| 247 | public:
|
|---|
| 248 | t_vTec(){
|
|---|
| 249 | _updateInt = 0;
|
|---|
| 250 | }
|
|---|
| 251 | t_vTec(const t_vTec& old) { // copy constructor (deep copy)
|
|---|
| 252 | _staID = old._staID;
|
|---|
| 253 | _time = old._time;
|
|---|
| 254 | _updateInt = old._updateInt;
|
|---|
| 255 | for (unsigned ii = 0; ii < old._layers.size(); ii++) {
|
|---|
| 256 | _layers.push_back(old._layers[ii]);
|
|---|
| 257 | }
|
|---|
| 258 | }
|
|---|
| 259 | static void write(std::ostream* out, const t_vTec& vTec);
|
|---|
| 260 | static void read(const std::string& epoLine, std::istream& in, t_vTec& vTec);
|
|---|
| 261 | std::string _staID;
|
|---|
| 262 | bncTime _time;
|
|---|
| 263 | unsigned int _updateInt;
|
|---|
| 264 | std::vector<t_vTecLayer> _layers;
|
|---|
| 265 | };
|
|---|
| 266 |
|
|---|
| 267 | class t_corrSSR {
|
|---|
| 268 | public:
|
|---|
| 269 | enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, URA, unknown};
|
|---|
| 270 | static e_type readEpoLine(const std::string& line, bncTime& epoTime,
|
|---|
| 271 | unsigned int& updateInt, int& numEntries, std::string& staID);
|
|---|
| 272 | };
|
|---|
| 273 |
|
|---|
| 274 | #endif
|
|---|