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