[6176] | 1 | #include <iostream>
|
---|
[6177] | 2 | #include <iomanip>
|
---|
[6176] | 3 | #include <sstream>
|
---|
[6495] | 4 | #include <newmatio.h>
|
---|
[6144] | 5 |
|
---|
| 6 | #include "satObs.h"
|
---|
[6178] | 7 |
|
---|
[6144] | 8 | using namespace std;
|
---|
| 9 |
|
---|
[6466] | 10 | // Constructor
|
---|
[6144] | 11 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6466] | 12 | t_clkCorr::t_clkCorr() {
|
---|
[6589] | 13 | _updateInt = 0;
|
---|
[6160] | 14 | _iod = 0;
|
---|
| 15 | _dClk = 0.0;
|
---|
| 16 | _dotDClk = 0.0;
|
---|
| 17 | _dotDotDClk = 0.0;
|
---|
[6144] | 18 | }
|
---|
| 19 |
|
---|
[8483] | 20 | //
|
---|
[6144] | 21 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 22 | void t_clkCorr::writeEpoch(ostream* out, const QList<t_clkCorr>& corrList) {
|
---|
[6456] | 23 | if (!out || corrList.size() == 0) {
|
---|
| 24 | return;
|
---|
| 25 | }
|
---|
[6457] | 26 | out->setf(ios::fixed);
|
---|
| 27 | bncTime epoTime;
|
---|
| 28 | QListIterator<t_clkCorr> it(corrList);
|
---|
| 29 | while (it.hasNext()) {
|
---|
| 30 | const t_clkCorr& corr = it.next();
|
---|
| 31 | if (!epoTime.valid()) {
|
---|
| 32 | epoTime = corr._time;
|
---|
[6556] | 33 | *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 34 | << corr._updateInt << " "
|
---|
[6458] | 35 | << corrList.size() << ' ' << corr._staID << endl;
|
---|
[6457] | 36 | }
|
---|
[7058] | 37 | *out << corr._prn.toString() << ' ' << setw(11) << corr._iod << ' '
|
---|
[10311] | 38 | << setw(10) << setprecision(4) << corr._dClk * t_CST::c << ' ' // m
|
---|
| 39 | << setw(10) << setprecision(4) << corr._dotDClk * t_CST::c * 1.e3 << ' ' // m/s => mm/s
|
---|
| 40 | << setw(10) << setprecision(4) << corr._dotDotDClk * t_CST::c * 1.e3 << endl; // m/s² => mm/s²
|
---|
[6457] | 41 | }
|
---|
[6456] | 42 | out->flush();
|
---|
[6144] | 43 | }
|
---|
| 44 |
|
---|
[8483] | 45 | //
|
---|
[6144] | 46 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 47 | void t_clkCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_clkCorr>& corrList) {
|
---|
[6556] | 48 | bncTime epoTime;
|
---|
| 49 | unsigned int updateInt;
|
---|
| 50 | int numCorr;
|
---|
| 51 | string staID;
|
---|
| 52 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::clkCorr) {
|
---|
[6502] | 53 | return;
|
---|
| 54 | }
|
---|
[6503] | 55 | for (int ii = 0; ii < numCorr; ii++) {
|
---|
[6504] | 56 | t_clkCorr corr;
|
---|
[6556] | 57 | corr._time = epoTime;
|
---|
| 58 | corr._updateInt = updateInt;
|
---|
| 59 | corr._staID = staID;
|
---|
[6503] | 60 |
|
---|
| 61 | string line;
|
---|
[6507] | 62 | getline(inStream, line);
|
---|
[6503] | 63 | istringstream in(line.c_str());
|
---|
[8483] | 64 |
|
---|
[6504] | 65 | in >> corr._prn >> corr._iod >> corr._dClk >> corr._dotDClk >> corr._dotDotDClk;
|
---|
[10599] | 66 |
|
---|
| 67 | char sys = corr._prn.system();
|
---|
| 68 | int num = corr._prn.number();
|
---|
| 69 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
---|
| 70 | corr._prn.setFlag(flag);
|
---|
| 71 |
|
---|
[10565] | 72 | corr._dClk /= (t_CST::c);
|
---|
| 73 | corr._dotDClk /= (t_CST::c * 1.e3);
|
---|
| 74 | corr._dotDotDClk /= (t_CST::c * 1.e3);
|
---|
[7014] | 75 |
|
---|
[6504] | 76 | corrList.push_back(corr);
|
---|
[6503] | 77 | }
|
---|
[6180] | 78 | }
|
---|
| 79 |
|
---|
[6466] | 80 | // Constructor
|
---|
[6180] | 81 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6466] | 82 | t_orbCorr::t_orbCorr() {
|
---|
[6589] | 83 | _updateInt = 0;
|
---|
| 84 | _iod = 0;
|
---|
| 85 | _system = 'R';
|
---|
[6160] | 86 | _xr.ReSize(3); _xr = 0.0;
|
---|
| 87 | _dotXr.ReSize(3); _dotXr = 0.0;
|
---|
[6144] | 88 | }
|
---|
| 89 |
|
---|
[8483] | 90 | //
|
---|
[6144] | 91 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 92 | void t_orbCorr::writeEpoch(ostream* out, const QList<t_orbCorr>& corrList) {
|
---|
[6456] | 93 | if (!out || corrList.size() == 0) {
|
---|
| 94 | return;
|
---|
| 95 | }
|
---|
[6460] | 96 | out->setf(ios::fixed);
|
---|
| 97 | bncTime epoTime;
|
---|
| 98 | QListIterator<t_orbCorr> it(corrList);
|
---|
| 99 | while (it.hasNext()) {
|
---|
| 100 | const t_orbCorr& corr = it.next();
|
---|
| 101 | if (!epoTime.valid()) {
|
---|
| 102 | epoTime = corr._time;
|
---|
[6556] | 103 | *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 104 | << corr._updateInt << " "
|
---|
[6460] | 105 | << corrList.size() << ' ' << corr._staID << endl;
|
---|
| 106 | }
|
---|
[7058] | 107 | *out << corr._prn.toString() << ' ' << setw(11) << corr._iod << ' '
|
---|
[6460] | 108 | << setw(10) << setprecision(4) << corr._xr[0] << ' '
|
---|
| 109 | << setw(10) << setprecision(4) << corr._xr[1] << ' '
|
---|
| 110 | << setw(10) << setprecision(4) << corr._xr[2] << " "
|
---|
[9685] | 111 | << setw(10) << setprecision(4) << corr._dotXr[0] * 1.e3 << ' ' // m/s => mm/s
|
---|
| 112 | << setw(10) << setprecision(4) << corr._dotXr[1] * 1.e3 << ' ' // m/s => mm/s
|
---|
| 113 | << setw(10) << setprecision(4) << corr._dotXr[2] * 1.e3 << endl; // m/s => mm/s
|
---|
[6460] | 114 | }
|
---|
[6456] | 115 | out->flush();
|
---|
[6144] | 116 | }
|
---|
| 117 |
|
---|
[8483] | 118 | //
|
---|
[6455] | 119 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 120 | void t_orbCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_orbCorr>& corrList) {
|
---|
[6556] | 121 | bncTime epoTime;
|
---|
| 122 | unsigned int updateInt;
|
---|
| 123 | int numCorr;
|
---|
| 124 | string staID;
|
---|
| 125 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::orbCorr) {
|
---|
[6504] | 126 | return;
|
---|
| 127 | }
|
---|
| 128 | for (int ii = 0; ii < numCorr; ii++) {
|
---|
| 129 | t_orbCorr corr;
|
---|
[6556] | 130 | corr._time = epoTime;
|
---|
| 131 | corr._updateInt = updateInt;
|
---|
| 132 | corr._staID = staID;
|
---|
[6504] | 133 |
|
---|
| 134 | string line;
|
---|
[6507] | 135 | getline(inStream, line);
|
---|
[6504] | 136 | istringstream in(line.c_str());
|
---|
[8483] | 137 |
|
---|
[7003] | 138 | in >> corr._prn >> corr._iod
|
---|
[8483] | 139 | >> corr._xr[0] >> corr._xr[1] >> corr._xr[2]
|
---|
[6504] | 140 | >> corr._dotXr[0] >> corr._dotXr[1] >> corr._dotXr[2];
|
---|
| 141 |
|
---|
[10599] | 142 | char sys = corr._prn.system();
|
---|
| 143 | int num = corr._prn.number();
|
---|
| 144 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
---|
| 145 | corr._prn.setFlag(flag);
|
---|
| 146 |
|
---|
[9685] | 147 | corr._dotXr[0] /= 1.e3; // mm/s => m/s
|
---|
| 148 | corr._dotXr[1] /= 1.e3; // mm/s => m/s
|
---|
| 149 | corr._dotXr[2] /= 1.e3; // mm/s => m/s
|
---|
[9682] | 150 |
|
---|
[6504] | 151 | corrList.push_back(corr);
|
---|
| 152 | }
|
---|
[6455] | 153 | }
|
---|
[6475] | 154 |
|
---|
[8483] | 155 | // Constructor
|
---|
[6475] | 156 | ////////////////////////////////////////////////////////////////////////////
|
---|
[8483] | 157 | t_URA::t_URA() {
|
---|
| 158 | _updateInt = 0;
|
---|
| 159 | _iod = 0;
|
---|
| 160 | _ura = 0.0;
|
---|
| 161 | }
|
---|
| 162 |
|
---|
| 163 | //
|
---|
| 164 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 165 | void t_URA::writeEpoch(ostream* out, const QList<t_URA>& corrList) {
|
---|
| 166 | if (!out || corrList.size() == 0) {
|
---|
| 167 | return;
|
---|
| 168 | }
|
---|
| 169 | out->setf(ios::fixed);
|
---|
| 170 | bncTime epoTime;
|
---|
| 171 | QListIterator<t_URA> it(corrList);
|
---|
| 172 | while (it.hasNext()) {
|
---|
| 173 | const t_URA& corr = it.next();
|
---|
| 174 | if (!epoTime.valid()) {
|
---|
| 175 | epoTime = corr._time;
|
---|
| 176 | *out << "> URA " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 177 | << corr._updateInt << " "
|
---|
| 178 | << corrList.size() << ' ' << corr._staID << endl;
|
---|
| 179 | }
|
---|
| 180 | *out << corr._prn.toString() << ' ' << setw(11) << corr._iod << ' '
|
---|
| 181 | << setw(10) << setprecision(4) << corr._ura << endl;
|
---|
| 182 | }
|
---|
| 183 | out->flush();
|
---|
| 184 | }
|
---|
| 185 |
|
---|
| 186 | //
|
---|
| 187 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 188 | void t_URA::readEpoch(const string& epoLine, istream& inStream, QList<t_URA>& corrList) {
|
---|
| 189 | bncTime epoTime;
|
---|
| 190 | unsigned int updateInt;
|
---|
| 191 | int numCorr;
|
---|
| 192 | string staID;
|
---|
| 193 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::URA) {
|
---|
| 194 | return;
|
---|
| 195 | }
|
---|
| 196 | for (int ii = 0; ii < numCorr; ii++) {
|
---|
| 197 | t_URA corr;
|
---|
| 198 | corr._time = epoTime;
|
---|
| 199 | corr._updateInt = updateInt;
|
---|
| 200 | corr._staID = staID;
|
---|
| 201 |
|
---|
| 202 | string line;
|
---|
| 203 | getline(inStream, line);
|
---|
| 204 | istringstream in(line.c_str());
|
---|
| 205 |
|
---|
| 206 | in >> corr._prn >> corr._iod >> corr._ura;
|
---|
| 207 |
|
---|
[10599] | 208 | char sys = corr._prn.system();
|
---|
| 209 | int num = corr._prn.number();
|
---|
| 210 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
---|
| 211 | corr._prn.setFlag(flag);
|
---|
| 212 |
|
---|
[8483] | 213 | corrList.push_back(corr);
|
---|
| 214 | }
|
---|
| 215 | }
|
---|
| 216 |
|
---|
| 217 | //
|
---|
| 218 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 219 | void t_satCodeBias::writeEpoch(ostream* out, const QList<t_satCodeBias>& biasList) {
|
---|
[6476] | 220 | if (!out || biasList.size() == 0) {
|
---|
| 221 | return;
|
---|
| 222 | }
|
---|
| 223 | out->setf(ios::fixed);
|
---|
| 224 | bncTime epoTime;
|
---|
| 225 | QListIterator<t_satCodeBias> it(biasList);
|
---|
| 226 | while (it.hasNext()) {
|
---|
| 227 | const t_satCodeBias& satCodeBias = it.next();
|
---|
| 228 | if (!epoTime.valid()) {
|
---|
| 229 | epoTime = satCodeBias._time;
|
---|
[6556] | 230 | *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 231 | << satCodeBias._updateInt << " "
|
---|
[6476] | 232 | << biasList.size() << ' ' << satCodeBias._staID << endl;
|
---|
| 233 | }
|
---|
[6567] | 234 | *out << satCodeBias._prn.toString() << " " << setw(2) << satCodeBias._bias.size();
|
---|
[6477] | 235 | for (unsigned ii = 0; ii < satCodeBias._bias.size(); ii++) {
|
---|
| 236 | const t_frqCodeBias& frqCodeBias = satCodeBias._bias[ii];
|
---|
| 237 | *out << " " << frqCodeBias._rnxType2ch << ' '
|
---|
| 238 | << setw(10) << setprecision(4) << frqCodeBias._value;
|
---|
| 239 | }
|
---|
[6476] | 240 | *out << endl;
|
---|
| 241 | }
|
---|
| 242 | out->flush();
|
---|
[6475] | 243 | }
|
---|
| 244 |
|
---|
[8483] | 245 | //
|
---|
[6475] | 246 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 247 | void t_satCodeBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satCodeBias>& biasList) {
|
---|
[6556] | 248 | bncTime epoTime;
|
---|
| 249 | unsigned int updateInt;
|
---|
| 250 | int numSat;
|
---|
| 251 | string staID;
|
---|
| 252 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::codeBias) {
|
---|
[6505] | 253 | return;
|
---|
| 254 | }
|
---|
| 255 | for (int ii = 0; ii < numSat; ii++) {
|
---|
| 256 | t_satCodeBias satCodeBias;
|
---|
[6556] | 257 | satCodeBias._time = epoTime;
|
---|
| 258 | satCodeBias._updateInt = updateInt;
|
---|
| 259 | satCodeBias._staID = staID;
|
---|
[6505] | 260 |
|
---|
| 261 | string line;
|
---|
[6507] | 262 | getline(inStream, line);
|
---|
[6505] | 263 | istringstream in(line.c_str());
|
---|
[8483] | 264 |
|
---|
[6567] | 265 | int numBias;
|
---|
| 266 | in >> satCodeBias._prn >> numBias;
|
---|
[6505] | 267 |
|
---|
[10599] | 268 | char sys = satCodeBias._prn.system();
|
---|
| 269 | int num = satCodeBias._prn.number();
|
---|
| 270 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
---|
| 271 | satCodeBias._prn.setFlag(flag);
|
---|
| 272 |
|
---|
[6505] | 273 | while (in.good()) {
|
---|
| 274 | t_frqCodeBias frqCodeBias;
|
---|
| 275 | in >> frqCodeBias._rnxType2ch >> frqCodeBias._value;
|
---|
| 276 | if (!frqCodeBias._rnxType2ch.empty()) {
|
---|
| 277 | satCodeBias._bias.push_back(frqCodeBias);
|
---|
| 278 | }
|
---|
| 279 | }
|
---|
| 280 |
|
---|
| 281 | biasList.push_back(satCodeBias);
|
---|
| 282 | }
|
---|
[6475] | 283 | }
|
---|
[6481] | 284 |
|
---|
[8483] | 285 | //
|
---|
[6481] | 286 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 287 | void t_satPhaseBias::writeEpoch(ostream* out, const QList<t_satPhaseBias>& biasList) {
|
---|
[6493] | 288 | if (!out || biasList.size() == 0) {
|
---|
| 289 | return;
|
---|
| 290 | }
|
---|
| 291 | out->setf(ios::fixed);
|
---|
| 292 | bncTime epoTime;
|
---|
| 293 | QListIterator<t_satPhaseBias> it(biasList);
|
---|
| 294 | while (it.hasNext()) {
|
---|
| 295 | const t_satPhaseBias& satPhaseBias = it.next();
|
---|
| 296 | if (!epoTime.valid()) {
|
---|
| 297 | epoTime = satPhaseBias._time;
|
---|
[6556] | 298 | *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 299 | << satPhaseBias._updateInt << " "
|
---|
[6857] | 300 | << biasList.size() << ' ' << satPhaseBias._staID << endl;
|
---|
[6859] | 301 | *out << " " << satPhaseBias._dispBiasConstistInd << " "
|
---|
| 302 | << satPhaseBias._MWConsistInd << endl;
|
---|
[6493] | 303 | }
|
---|
[6494] | 304 | *out << satPhaseBias._prn.toString() << ' '
|
---|
[8617] | 305 | << setw(12) << setprecision(8) << satPhaseBias._yaw * 180.0 / M_PI << ' '
|
---|
| 306 | << setw(12) << setprecision(8) << satPhaseBias._yawRate * 180.0 / M_PI<< " "
|
---|
[6567] | 307 | << setw(2) << satPhaseBias._bias.size();
|
---|
[6493] | 308 | for (unsigned ii = 0; ii < satPhaseBias._bias.size(); ii++) {
|
---|
| 309 | const t_frqPhaseBias& frqPhaseBias = satPhaseBias._bias[ii];
|
---|
| 310 | *out << " " << frqPhaseBias._rnxType2ch << ' '
|
---|
[6494] | 311 | << setw(10) << setprecision(4) << frqPhaseBias._value << ' '
|
---|
| 312 | << setw(3) << frqPhaseBias._fixIndicator << ' '
|
---|
| 313 | << setw(3) << frqPhaseBias._fixWideLaneIndicator << ' '
|
---|
| 314 | << setw(3) << frqPhaseBias._jumpCounter;
|
---|
[6493] | 315 | }
|
---|
| 316 | *out << endl;
|
---|
| 317 | }
|
---|
| 318 | out->flush();
|
---|
[6481] | 319 | }
|
---|
[8483] | 320 |
|
---|
| 321 | //
|
---|
[6481] | 322 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 323 | void t_satPhaseBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satPhaseBias>& biasList) {
|
---|
[6556] | 324 | bncTime epoTime;
|
---|
| 325 | unsigned int updateInt;
|
---|
| 326 | int numSat;
|
---|
| 327 | string staID;
|
---|
[6859] | 328 | unsigned int dispInd;
|
---|
| 329 | unsigned int mwInd;
|
---|
[6556] | 330 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::phaseBias) {
|
---|
[6506] | 331 | return;
|
---|
| 332 | }
|
---|
[6859] | 333 | for (int ii = 0; ii <= numSat; ii++) {
|
---|
[6506] | 334 | t_satPhaseBias satPhaseBias;
|
---|
[6556] | 335 | satPhaseBias._time = epoTime;
|
---|
| 336 | satPhaseBias._updateInt = updateInt;
|
---|
| 337 | satPhaseBias._staID = staID;
|
---|
[6506] | 338 |
|
---|
| 339 | string line;
|
---|
[6507] | 340 | getline(inStream, line);
|
---|
[6506] | 341 | istringstream in(line.c_str());
|
---|
[6857] | 342 |
|
---|
[6859] | 343 | if (ii == 0) {
|
---|
| 344 | in >> dispInd >> mwInd;
|
---|
| 345 | continue;
|
---|
| 346 | }
|
---|
| 347 | satPhaseBias._dispBiasConstistInd = dispInd;
|
---|
| 348 | satPhaseBias._MWConsistInd = mwInd;
|
---|
| 349 |
|
---|
[6567] | 350 | int numBias;
|
---|
[8617] | 351 | double yawDeg, yawDegRate;
|
---|
| 352 | in >> satPhaseBias._prn >> yawDeg >> yawDegRate >> numBias;
|
---|
| 353 | satPhaseBias._yaw = yawDeg * M_PI / 180.0;
|
---|
| 354 | satPhaseBias._yawRate = yawDegRate * M_PI / 180.0;
|
---|
[6506] | 355 |
|
---|
[10599] | 356 | char sys = satPhaseBias._prn.system();
|
---|
| 357 | int num = satPhaseBias._prn.number();
|
---|
| 358 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
---|
| 359 | satPhaseBias._prn.setFlag(flag);
|
---|
| 360 |
|
---|
[6506] | 361 | while (in.good()) {
|
---|
| 362 | t_frqPhaseBias frqPhaseBias;
|
---|
| 363 | in >> frqPhaseBias._rnxType2ch >> frqPhaseBias._value
|
---|
| 364 | >> frqPhaseBias._fixIndicator >> frqPhaseBias._fixWideLaneIndicator
|
---|
| 365 | >> frqPhaseBias._jumpCounter;
|
---|
| 366 | if (!frqPhaseBias._rnxType2ch.empty()) {
|
---|
| 367 | satPhaseBias._bias.push_back(frqPhaseBias);
|
---|
| 368 | }
|
---|
| 369 | }
|
---|
| 370 |
|
---|
| 371 | biasList.push_back(satPhaseBias);
|
---|
| 372 | }
|
---|
[6481] | 373 | }
|
---|
[6482] | 374 |
|
---|
[8483] | 375 | //
|
---|
[6482] | 376 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 377 | void t_vTec::write(ostream* out, const t_vTec& vTec) {
|
---|
[6493] | 378 | if (!out || vTec._layers.size() == 0) {
|
---|
| 379 | return;
|
---|
| 380 | }
|
---|
| 381 | out->setf(ios::fixed);
|
---|
| 382 | bncTime epoTime = vTec._time;
|
---|
[6556] | 383 | *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 384 | << vTec._updateInt << " "
|
---|
[6493] | 385 | << vTec._layers.size() << ' ' << vTec._staID << endl;
|
---|
[6495] | 386 | for (unsigned ii = 0; ii < vTec._layers.size(); ii++) {
|
---|
| 387 | const t_vTecLayer& layer = vTec._layers[ii];
|
---|
[6496] | 388 | *out << setw(2) << ii+1 << ' '
|
---|
[6878] | 389 | << setw(2) << layer._C.Nrows()-1 << ' '
|
---|
| 390 | << setw(2) << layer._C.Ncols()-1 << ' '
|
---|
[8483] | 391 | << setw(10) << setprecision(1) << layer._height << endl
|
---|
| 392 | << setw(10) << setprecision(4) << layer._C
|
---|
[6495] | 393 | << setw(10) << setprecision(4) << layer._S;
|
---|
| 394 | }
|
---|
[6493] | 395 | out->flush();
|
---|
[6482] | 396 | }
|
---|
| 397 |
|
---|
[8483] | 398 | //
|
---|
[6482] | 399 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6507] | 400 | void t_vTec::read(const string& epoLine, istream& inStream, t_vTec& vTec) {
|
---|
[6556] | 401 | bncTime epoTime;
|
---|
| 402 | unsigned int updateInt;
|
---|
| 403 | int numLayers;
|
---|
| 404 | string staID;
|
---|
| 405 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numLayers, staID) != t_corrSSR::vTec) {
|
---|
[6507] | 406 | return;
|
---|
| 407 | }
|
---|
| 408 | if (numLayers <= 0) {
|
---|
| 409 | return;
|
---|
| 410 | }
|
---|
[6556] | 411 | vTec._time = epoTime;
|
---|
| 412 | vTec._updateInt = updateInt;
|
---|
| 413 | vTec._staID = staID;
|
---|
[6507] | 414 | for (int ii = 0; ii < numLayers; ii++) {
|
---|
| 415 | t_vTecLayer layer;
|
---|
| 416 |
|
---|
| 417 | string line;
|
---|
| 418 | getline(inStream, line);
|
---|
| 419 | istringstream in(line.c_str());
|
---|
| 420 |
|
---|
| 421 | int dummy, maxDeg, maxOrd;
|
---|
[6515] | 422 | in >> dummy >> maxDeg >> maxOrd >> layer._height;
|
---|
[6507] | 423 |
|
---|
[6878] | 424 | layer._C.ReSize(maxDeg+1, maxOrd+1);
|
---|
| 425 | layer._S.ReSize(maxDeg+1, maxOrd+1);
|
---|
[6507] | 426 |
|
---|
[6878] | 427 | for (int iDeg = 0; iDeg <= maxDeg; iDeg++) {
|
---|
| 428 | for (int iOrd = 0; iOrd <= maxOrd; iOrd++) {
|
---|
[6508] | 429 | inStream >> layer._C[iDeg][iOrd];
|
---|
| 430 | }
|
---|
| 431 | }
|
---|
[6878] | 432 | for (int iDeg = 0; iDeg <= maxDeg; iDeg++) {
|
---|
| 433 | for (int iOrd = 0; iOrd <= maxOrd; iOrd++) {
|
---|
[6508] | 434 | inStream >> layer._S[iDeg][iOrd];
|
---|
| 435 | }
|
---|
| 436 | }
|
---|
[6507] | 437 |
|
---|
| 438 | vTec._layers.push_back(layer);
|
---|
| 439 | }
|
---|
[6482] | 440 | }
|
---|
[6498] | 441 |
|
---|
[8483] | 442 | //
|
---|
[6498] | 443 | ////////////////////////////////////////////////////////////////////////////
|
---|
[8483] | 444 | t_corrSSR::e_type t_corrSSR::readEpoLine(const string& line, bncTime& epoTime,
|
---|
[6556] | 445 | unsigned int& updateInt, int& numEntries,
|
---|
| 446 | string& staID) {
|
---|
[6498] | 447 |
|
---|
[6500] | 448 | istringstream inLine(line.c_str());
|
---|
| 449 |
|
---|
| 450 | char epoChar;
|
---|
| 451 | string typeString;
|
---|
| 452 | int year, month, day, hour, min;
|
---|
| 453 | double sec;
|
---|
| 454 |
|
---|
[8483] | 455 | inLine >> epoChar >> typeString
|
---|
[6556] | 456 | >> year >> month >> day >> hour >> min >> sec >> updateInt >> numEntries >> staID;
|
---|
[6500] | 457 |
|
---|
| 458 | if (epoChar == '>') {
|
---|
| 459 | epoTime.set(year, month, day, hour, min, sec);
|
---|
| 460 | if (typeString == "CLOCK") {
|
---|
| 461 | return clkCorr;
|
---|
| 462 | }
|
---|
| 463 | else if (typeString == "ORBIT") {
|
---|
| 464 | return orbCorr;
|
---|
| 465 | }
|
---|
| 466 | else if (typeString == "CODE_BIAS") {
|
---|
| 467 | return codeBias;
|
---|
| 468 | }
|
---|
| 469 | else if (typeString == "PHASE_BIAS") {
|
---|
| 470 | return phaseBias;
|
---|
| 471 | }
|
---|
| 472 | else if (typeString == "VTEC") {
|
---|
| 473 | return vTec;
|
---|
| 474 | }
|
---|
[8483] | 475 | else if (typeString == "URA") {
|
---|
| 476 | return URA;
|
---|
| 477 | }
|
---|
[6500] | 478 | }
|
---|
| 479 |
|
---|
| 480 | return unknown;
|
---|
[6498] | 481 | }
|
---|
[10599] | 482 |
|
---|
| 483 | // Set NAV type to force NAVtype usage according SSR standard
|
---|
| 484 | /////////////////////////////////////////////////////////////
|
---|
| 485 | t_eph::e_type t_corrSSR::getSsrNavTypeFlag(char sys, int num) {
|
---|
| 486 |
|
---|
| 487 | t_eph::e_type flag = t_eph::undefined;
|
---|
| 488 |
|
---|
| 489 | switch (sys) {
|
---|
| 490 | case 'G':
|
---|
| 491 | case 'J':
|
---|
| 492 | flag = t_eph::LNAV;
|
---|
| 493 | break;
|
---|
| 494 | case 'R':
|
---|
| 495 | flag = t_eph::FDMA_M;
|
---|
| 496 | break;
|
---|
| 497 | case 'E':
|
---|
| 498 | flag = t_eph::INAV;
|
---|
| 499 | break;
|
---|
| 500 | case 'C':
|
---|
| 501 | if (num < 6) {// GEO
|
---|
| 502 | flag = t_eph::D2;
|
---|
| 503 | }
|
---|
| 504 | else if (num > 58 && num < 63) { // GEO
|
---|
| 505 | flag = t_eph::D2;
|
---|
| 506 | }
|
---|
| 507 | else {
|
---|
| 508 | flag = t_eph::D1;
|
---|
| 509 | }
|
---|
| 510 | break;
|
---|
| 511 | case 'S':
|
---|
| 512 | flag = t_eph::SBASL1;
|
---|
| 513 | break;
|
---|
| 514 | }
|
---|
| 515 |
|
---|
| 516 | return flag;
|
---|
| 517 | }
|
---|