[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() {
|
---|
[6160] | 13 | _iod = 0;
|
---|
| 14 | _dClk = 0.0;
|
---|
| 15 | _dotDClk = 0.0;
|
---|
| 16 | _dotDotDClk = 0.0;
|
---|
[6144] | 17 | }
|
---|
| 18 |
|
---|
| 19 | //
|
---|
| 20 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6455] | 21 | void t_clkCorr::writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList) {
|
---|
[6456] | 22 | if (!out || corrList.size() == 0) {
|
---|
| 23 | return;
|
---|
| 24 | }
|
---|
[6457] | 25 | out->setf(ios::fixed);
|
---|
| 26 | bncTime epoTime;
|
---|
| 27 | QListIterator<t_clkCorr> it(corrList);
|
---|
| 28 | while (it.hasNext()) {
|
---|
| 29 | const t_clkCorr& corr = it.next();
|
---|
| 30 | if (!epoTime.valid()) {
|
---|
| 31 | epoTime = corr._time;
|
---|
[6459] | 32 | *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
[6458] | 33 | << corrList.size() << ' ' << corr._staID << endl;
|
---|
[6457] | 34 | }
|
---|
| 35 | *out << corr._prn.toString() << ' ' << setw(3) << corr._iod << ' '
|
---|
| 36 | << setw(10) << setprecision(4) << corr._dClk * t_CST::c << ' '
|
---|
| 37 | << setw(10) << setprecision(4) << corr._dotDClk * t_CST::c << ' '
|
---|
| 38 | << setw(10) << setprecision(4) << corr._dotDotDClk * t_CST::c << endl;
|
---|
| 39 | }
|
---|
[6456] | 40 | out->flush();
|
---|
[6144] | 41 | }
|
---|
| 42 |
|
---|
| 43 | //
|
---|
| 44 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6499] | 45 | void t_clkCorr::readEpoch(const string& epoLine, std::istream& in, QList<t_clkCorr>& corrList) {
|
---|
[6502] | 46 | bncTime epoTime;
|
---|
| 47 | int numCorr;
|
---|
| 48 | string staID;
|
---|
| 49 | if (t_corrSSR::readEpoLine(epoLine, epoTime, numCorr, staID) != t_corrSSR::clkCorr) {
|
---|
| 50 | return;
|
---|
| 51 | }
|
---|
[6503] | 52 | for (int ii = 0; ii < numCorr; ii++) {
|
---|
| 53 | t_clkCorr clkCorr;
|
---|
| 54 |
|
---|
| 55 | string line;
|
---|
| 56 | getline(in, line);
|
---|
| 57 | istringstream in(line.c_str());
|
---|
| 58 |
|
---|
| 59 | in >> clkCorr._prn >> clkCorr._iod >> clkCorr._dClk >> clkCorr._dotDClk >> clkCorr._dotDotDClk;
|
---|
| 60 |
|
---|
| 61 | corrList.push_back(clkCorr);
|
---|
| 62 | }
|
---|
[6180] | 63 | }
|
---|
| 64 |
|
---|
[6466] | 65 | // Constructor
|
---|
[6180] | 66 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6466] | 67 | t_orbCorr::t_orbCorr() {
|
---|
| 68 | _iod = 0;
|
---|
| 69 | _system = 'R';
|
---|
[6160] | 70 | _xr.ReSize(3); _xr = 0.0;
|
---|
| 71 | _dotXr.ReSize(3); _dotXr = 0.0;
|
---|
[6144] | 72 | }
|
---|
| 73 |
|
---|
| 74 | //
|
---|
| 75 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6455] | 76 | void t_orbCorr::writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList) {
|
---|
[6456] | 77 | if (!out || corrList.size() == 0) {
|
---|
| 78 | return;
|
---|
| 79 | }
|
---|
[6460] | 80 | out->setf(ios::fixed);
|
---|
| 81 | bncTime epoTime;
|
---|
| 82 | QListIterator<t_orbCorr> it(corrList);
|
---|
| 83 | while (it.hasNext()) {
|
---|
| 84 | const t_orbCorr& corr = it.next();
|
---|
| 85 | if (!epoTime.valid()) {
|
---|
| 86 | epoTime = corr._time;
|
---|
| 87 | *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 88 | << corrList.size() << ' ' << corr._staID << endl;
|
---|
| 89 | }
|
---|
| 90 | *out << corr._prn.toString() << ' ' << setw(3) << corr._iod << ' '
|
---|
| 91 | << setw(10) << setprecision(4) << corr._xr[0] << ' '
|
---|
| 92 | << setw(10) << setprecision(4) << corr._xr[1] << ' '
|
---|
| 93 | << setw(10) << setprecision(4) << corr._xr[2] << " "
|
---|
| 94 | << setw(10) << setprecision(4) << corr._dotXr[0] << ' '
|
---|
| 95 | << setw(10) << setprecision(4) << corr._dotXr[1] << ' '
|
---|
| 96 | << setw(10) << setprecision(4) << corr._dotXr[2] << endl;
|
---|
| 97 | }
|
---|
[6456] | 98 | out->flush();
|
---|
[6144] | 99 | }
|
---|
| 100 |
|
---|
[6455] | 101 | //
|
---|
| 102 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6499] | 103 | void t_orbCorr::readEpoch(const string& epoLine, std::istream& in, QList<t_orbCorr>& corrList) {
|
---|
[6455] | 104 | }
|
---|
[6475] | 105 |
|
---|
| 106 | //
|
---|
| 107 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 108 | void t_satCodeBias::writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList) {
|
---|
[6476] | 109 | if (!out || biasList.size() == 0) {
|
---|
| 110 | return;
|
---|
| 111 | }
|
---|
| 112 | out->setf(ios::fixed);
|
---|
| 113 | bncTime epoTime;
|
---|
| 114 | QListIterator<t_satCodeBias> it(biasList);
|
---|
| 115 | while (it.hasNext()) {
|
---|
| 116 | const t_satCodeBias& satCodeBias = it.next();
|
---|
| 117 | if (!epoTime.valid()) {
|
---|
| 118 | epoTime = satCodeBias._time;
|
---|
| 119 | *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 120 | << biasList.size() << ' ' << satCodeBias._staID << endl;
|
---|
| 121 | }
|
---|
[6477] | 122 | *out << satCodeBias._prn.toString();
|
---|
| 123 | for (unsigned ii = 0; ii < satCodeBias._bias.size(); ii++) {
|
---|
| 124 | const t_frqCodeBias& frqCodeBias = satCodeBias._bias[ii];
|
---|
| 125 | *out << " " << frqCodeBias._rnxType2ch << ' '
|
---|
| 126 | << setw(10) << setprecision(4) << frqCodeBias._value;
|
---|
| 127 | }
|
---|
[6476] | 128 | *out << endl;
|
---|
| 129 | }
|
---|
| 130 | out->flush();
|
---|
[6475] | 131 | }
|
---|
| 132 |
|
---|
| 133 | //
|
---|
| 134 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6499] | 135 | void t_satCodeBias::readEpoch(const string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList) {
|
---|
[6475] | 136 | }
|
---|
[6481] | 137 |
|
---|
| 138 | //
|
---|
| 139 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 140 | void t_satPhaseBias::writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList) {
|
---|
[6493] | 141 | if (!out || biasList.size() == 0) {
|
---|
| 142 | return;
|
---|
| 143 | }
|
---|
| 144 | out->setf(ios::fixed);
|
---|
| 145 | bncTime epoTime;
|
---|
| 146 | QListIterator<t_satPhaseBias> it(biasList);
|
---|
| 147 | while (it.hasNext()) {
|
---|
| 148 | const t_satPhaseBias& satPhaseBias = it.next();
|
---|
| 149 | if (!epoTime.valid()) {
|
---|
| 150 | epoTime = satPhaseBias._time;
|
---|
| 151 | *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 152 | << biasList.size() << ' ' << satPhaseBias._staID << endl;
|
---|
| 153 | }
|
---|
[6494] | 154 | *out << satPhaseBias._prn.toString() << ' '
|
---|
| 155 | << setw(12) << setprecision(8) << satPhaseBias._yawDeg << ' '
|
---|
| 156 | << setw(12) << setprecision(8) << satPhaseBias._yawDegRate << " ";
|
---|
[6493] | 157 | for (unsigned ii = 0; ii < satPhaseBias._bias.size(); ii++) {
|
---|
| 158 | const t_frqPhaseBias& frqPhaseBias = satPhaseBias._bias[ii];
|
---|
| 159 | *out << " " << frqPhaseBias._rnxType2ch << ' '
|
---|
[6494] | 160 | << setw(10) << setprecision(4) << frqPhaseBias._value << ' '
|
---|
| 161 | << setw(3) << frqPhaseBias._fixIndicator << ' '
|
---|
| 162 | << setw(3) << frqPhaseBias._fixWideLaneIndicator << ' '
|
---|
| 163 | << setw(3) << frqPhaseBias._jumpCounter;
|
---|
[6493] | 164 | }
|
---|
| 165 | *out << endl;
|
---|
| 166 | }
|
---|
| 167 | out->flush();
|
---|
[6481] | 168 | }
|
---|
| 169 |
|
---|
| 170 | //
|
---|
| 171 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6499] | 172 | void t_satPhaseBias::readEpoch(const string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList) {
|
---|
[6481] | 173 | }
|
---|
[6482] | 174 |
|
---|
| 175 | //
|
---|
| 176 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 177 | void t_vTec::write(std::ostream* out, const t_vTec& vTec) {
|
---|
[6493] | 178 | if (!out || vTec._layers.size() == 0) {
|
---|
| 179 | return;
|
---|
| 180 | }
|
---|
| 181 | out->setf(ios::fixed);
|
---|
| 182 | bncTime epoTime = vTec._time;
|
---|
| 183 | *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
|
---|
| 184 | << vTec._layers.size() << ' ' << vTec._staID << endl;
|
---|
[6495] | 185 | for (unsigned ii = 0; ii < vTec._layers.size(); ii++) {
|
---|
| 186 | const t_vTecLayer& layer = vTec._layers[ii];
|
---|
[6496] | 187 | *out << setw(2) << ii+1 << ' '
|
---|
| 188 | << setw(2) << layer._C.Nrows() << ' '
|
---|
| 189 | << setw(2) << layer._C.Ncols() << ' '
|
---|
| 190 | << setw(10) << setprecision(1) << layer._height << endl
|
---|
[6495] | 191 | << setw(10) << setprecision(4) << layer._C
|
---|
| 192 | << setw(10) << setprecision(4) << layer._S;
|
---|
| 193 | }
|
---|
[6493] | 194 | out->flush();
|
---|
[6482] | 195 | }
|
---|
| 196 |
|
---|
| 197 | //
|
---|
| 198 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6499] | 199 | void t_vTec::read(const string& epoLine, std::istream& in, t_vTec& vTec) {
|
---|
[6482] | 200 | }
|
---|
[6498] | 201 |
|
---|
| 202 | //
|
---|
| 203 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6501] | 204 | t_corrSSR::e_type t_corrSSR::readEpoLine(const string& line, bncTime& epoTime,
|
---|
| 205 | int& numEntries, string& staID) {
|
---|
[6498] | 206 |
|
---|
[6500] | 207 | istringstream inLine(line.c_str());
|
---|
| 208 |
|
---|
| 209 | char epoChar;
|
---|
| 210 | string typeString;
|
---|
| 211 | int year, month, day, hour, min;
|
---|
| 212 | double sec;
|
---|
| 213 |
|
---|
[6501] | 214 | inLine >> epoChar >> typeString
|
---|
| 215 | >> year >> month >> day >> hour >> min >> sec >> numEntries >> staID;
|
---|
[6500] | 216 |
|
---|
| 217 | if (epoChar == '>') {
|
---|
| 218 | epoTime.set(year, month, day, hour, min, sec);
|
---|
| 219 | if (typeString == "CLOCK") {
|
---|
| 220 | return clkCorr;
|
---|
| 221 | }
|
---|
| 222 | else if (typeString == "ORBIT") {
|
---|
| 223 | return orbCorr;
|
---|
| 224 | }
|
---|
| 225 | else if (typeString == "CODE_BIAS") {
|
---|
| 226 | return codeBias;
|
---|
| 227 | }
|
---|
| 228 | else if (typeString == "PHASE_BIAS") {
|
---|
| 229 | return phaseBias;
|
---|
| 230 | }
|
---|
| 231 | else if (typeString == "VTEC") {
|
---|
| 232 | return vTec;
|
---|
| 233 | }
|
---|
| 234 | }
|
---|
| 235 |
|
---|
| 236 | return unknown;
|
---|
[6498] | 237 | }
|
---|