[2898] | 1 | /* -------------------------------------------------------------------------
|
---|
| 2 | * BKG NTRIP Client
|
---|
| 3 | * -------------------------------------------------------------------------
|
---|
| 4 | *
|
---|
| 5 | * Class: bncComb
|
---|
| 6 | *
|
---|
| 7 | * Purpose: Combinations of Orbit/Clock Corrections
|
---|
| 8 | *
|
---|
| 9 | * Author: L. Mervart
|
---|
| 10 | *
|
---|
| 11 | * Created: 22-Jan-2011
|
---|
| 12 | *
|
---|
[7297] | 13 | * Changes:
|
---|
[2898] | 14 | *
|
---|
| 15 | * -----------------------------------------------------------------------*/
|
---|
| 16 |
|
---|
[2933] | 17 | #include <newmatio.h>
|
---|
[2921] | 18 | #include <iomanip>
|
---|
[3214] | 19 | #include <sstream>
|
---|
[2898] | 20 |
|
---|
| 21 | #include "bnccomb.h"
|
---|
[5070] | 22 | #include "bnccore.h"
|
---|
[3201] | 23 | #include "upload/bncrtnetdecoder.h"
|
---|
[2910] | 24 | #include "bncsettings.h"
|
---|
[2988] | 25 | #include "bncutils.h"
|
---|
[3181] | 26 | #include "bncsp3.h"
|
---|
[3052] | 27 | #include "bncantex.h"
|
---|
[5742] | 28 | #include "t_prn.h"
|
---|
[2898] | 29 |
|
---|
[3455] | 30 | const double sig0_offAC = 1000.0;
|
---|
| 31 | const double sig0_offACSat = 100.0;
|
---|
[3468] | 32 | const double sigP_offACSat = 0.01;
|
---|
[3455] | 33 | const double sig0_clkSat = 100.0;
|
---|
| 34 |
|
---|
| 35 | const double sigObs = 0.05;
|
---|
| 36 |
|
---|
| 37 | using namespace std;
|
---|
| 38 |
|
---|
[2898] | 39 | // Constructor
|
---|
| 40 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 41 | bncComb::cmbParam::cmbParam(parType type_, int index_, const QString& ac_, const QString& prn_) {
|
---|
[3032] | 42 |
|
---|
[3433] | 43 | type = type_;
|
---|
| 44 | index = index_;
|
---|
| 45 | AC = ac_;
|
---|
| 46 | prn = prn_;
|
---|
| 47 | xx = 0.0;
|
---|
[3455] | 48 | eph = 0;
|
---|
[3429] | 49 |
|
---|
[3485] | 50 | if (type == offACgps) {
|
---|
[3455] | 51 | epoSpec = true;
|
---|
| 52 | sig0 = sig0_offAC;
|
---|
| 53 | sigP = sig0;
|
---|
[3429] | 54 | }
|
---|
[3485] | 55 | else if (type == offACglo) {
|
---|
| 56 | epoSpec = true;
|
---|
| 57 | sig0 = sig0_offAC;
|
---|
| 58 | sigP = sig0;
|
---|
| 59 | }
|
---|
[3429] | 60 | else if (type == offACSat) {
|
---|
[3455] | 61 | epoSpec = false;
|
---|
| 62 | sig0 = sig0_offACSat;
|
---|
| 63 | sigP = sigP_offACSat;
|
---|
[3429] | 64 | }
|
---|
| 65 | else if (type == clkSat) {
|
---|
[3455] | 66 | epoSpec = true;
|
---|
| 67 | sig0 = sig0_clkSat;
|
---|
| 68 | sigP = sig0;
|
---|
[3429] | 69 | }
|
---|
[2933] | 70 | }
|
---|
| 71 |
|
---|
| 72 | // Destructor
|
---|
| 73 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 74 | bncComb::cmbParam::~cmbParam() {
|
---|
[2933] | 75 | }
|
---|
| 76 |
|
---|
| 77 | // Partial
|
---|
| 78 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 79 | double bncComb::cmbParam::partial(const QString& AC_, const QString& prn_) {
|
---|
[7297] | 80 |
|
---|
[3485] | 81 | if (type == offACgps) {
|
---|
| 82 | if (AC == AC_ && prn_[0] == 'G') {
|
---|
[2934] | 83 | return 1.0;
|
---|
| 84 | }
|
---|
| 85 | }
|
---|
[3485] | 86 | else if (type == offACglo) {
|
---|
| 87 | if (AC == AC_ && prn_[0] == 'R') {
|
---|
| 88 | return 1.0;
|
---|
| 89 | }
|
---|
| 90 | }
|
---|
[3429] | 91 | else if (type == offACSat) {
|
---|
| 92 | if (AC == AC_ && prn == prn_) {
|
---|
[2933] | 93 | return 1.0;
|
---|
| 94 | }
|
---|
| 95 | }
|
---|
[3429] | 96 | else if (type == clkSat) {
|
---|
| 97 | if (prn == prn_) {
|
---|
[2933] | 98 | return 1.0;
|
---|
| 99 | }
|
---|
| 100 | }
|
---|
| 101 |
|
---|
| 102 | return 0.0;
|
---|
| 103 | }
|
---|
| 104 |
|
---|
[7297] | 105 | //
|
---|
[2990] | 106 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 107 | QString bncComb::cmbParam::toString() const {
|
---|
[2933] | 108 |
|
---|
[2990] | 109 | QString outStr;
|
---|
[7297] | 110 |
|
---|
[3485] | 111 | if (type == offACgps) {
|
---|
| 112 | outStr = "AC offset GPS " + AC;
|
---|
[2990] | 113 | }
|
---|
[3485] | 114 | else if (type == offACglo) {
|
---|
| 115 | outStr = "AC offset GLO " + AC;
|
---|
| 116 | }
|
---|
[3429] | 117 | else if (type == offACSat) {
|
---|
[7008] | 118 | outStr = "Sat Offset " + AC + " " + prn.mid(0,3);
|
---|
[2990] | 119 | }
|
---|
[3429] | 120 | else if (type == clkSat) {
|
---|
[7008] | 121 | outStr = "Clk Corr " + prn.mid(0,3);
|
---|
[2990] | 122 | }
|
---|
[2933] | 123 |
|
---|
[2990] | 124 | return outStr;
|
---|
| 125 | }
|
---|
| 126 |
|
---|
[7299] | 127 | // Singleton
|
---|
| 128 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 129 | bncComb* bncComb::instance() {
|
---|
| 130 | static bncComb _bncComb;
|
---|
| 131 | return &_bncComb;
|
---|
| 132 | }
|
---|
| 133 |
|
---|
[2933] | 134 | // Constructor
|
---|
| 135 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6443] | 136 | bncComb::bncComb() : _ephUser(true) {
|
---|
[2910] | 137 |
|
---|
| 138 | bncSettings settings;
|
---|
| 139 |
|
---|
[7297] | 140 | QStringList cmbStreams = settings.value("cmbStreams").toStringList();
|
---|
[2918] | 141 |
|
---|
[4183] | 142 | _cmbSampl = settings.value("cmbSampl").toInt();
|
---|
| 143 | if (_cmbSampl <= 0) {
|
---|
| 144 | _cmbSampl = 10;
|
---|
| 145 | }
|
---|
| 146 |
|
---|
[3455] | 147 | _masterMissingEpochs = 0;
|
---|
| 148 |
|
---|
[7297] | 149 | if (cmbStreams.size() >= 1 && !cmbStreams[0].isEmpty()) {
|
---|
| 150 | QListIterator<QString> it(cmbStreams);
|
---|
[2910] | 151 | while (it.hasNext()) {
|
---|
| 152 | QStringList hlp = it.next().split(" ");
|
---|
[2918] | 153 | cmbAC* newAC = new cmbAC();
|
---|
| 154 | newAC->mountPoint = hlp[0];
|
---|
| 155 | newAC->name = hlp[1];
|
---|
| 156 | newAC->weight = hlp[2].toDouble();
|
---|
[3453] | 157 | if (_masterOrbitAC.isEmpty()) {
|
---|
| 158 | _masterOrbitAC = newAC->name;
|
---|
| 159 | }
|
---|
[3429] | 160 | _ACs.append(newAC);
|
---|
[2910] | 161 | }
|
---|
| 162 | }
|
---|
[2927] | 163 |
|
---|
[9036] | 164 | QString ssrFormat;
|
---|
[9267] | 165 | _ssrCorr = 0;
|
---|
[9036] | 166 | QListIterator<QString> it(settings.value("uploadMountpointsOut").toStringList());
|
---|
| 167 | while (it.hasNext()) {
|
---|
| 168 | QStringList hlp = it.next().split(",");
|
---|
[9080] | 169 | if (hlp.size() > 5) {
|
---|
| 170 | ssrFormat = hlp[5];
|
---|
[9036] | 171 | }
|
---|
| 172 | }
|
---|
| 173 | if (ssrFormat == "IGS-SSR") {
|
---|
| 174 | _ssrCorr = new SsrCorrIgs();
|
---|
| 175 | }
|
---|
| 176 | else if (ssrFormat == "RTCM-SSR") {
|
---|
| 177 | _ssrCorr = new SsrCorrRtcm();
|
---|
| 178 | }
|
---|
[9267] | 179 | else { // default
|
---|
| 180 | _ssrCorr = new SsrCorrIgs();
|
---|
| 181 | }
|
---|
| 182 |
|
---|
[3211] | 183 | _rtnetDecoder = 0;
|
---|
[3201] | 184 |
|
---|
[7297] | 185 | connect(this, SIGNAL(newMessage(QByteArray,bool)),
|
---|
[5068] | 186 | BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
|
---|
[2933] | 187 |
|
---|
[5583] | 188 | connect(BNC_CORE, SIGNAL(providerIDChanged(QString)),
|
---|
[6155] | 189 | this, SLOT(slotProviderIDChanged(QString)));
|
---|
[5583] | 190 |
|
---|
[6155] | 191 | connect(BNC_CORE, SIGNAL(newOrbCorrections(QList<t_orbCorr>)),
|
---|
| 192 | this, SLOT(slotNewOrbCorrections(QList<t_orbCorr>)));
|
---|
| 193 |
|
---|
| 194 | connect(BNC_CORE, SIGNAL(newClkCorrections(QList<t_clkCorr>)),
|
---|
| 195 | this, SLOT(slotNewClkCorrections(QList<t_clkCorr>)));
|
---|
| 196 |
|
---|
[3470] | 197 | // Combination Method
|
---|
| 198 | // ------------------
|
---|
[3481] | 199 | if (settings.value("cmbMethod").toString() == "Single-Epoch") {
|
---|
| 200 | _method = singleEpoch;
|
---|
[3470] | 201 | }
|
---|
| 202 | else {
|
---|
[3481] | 203 | _method = filter;
|
---|
[3470] | 204 | }
|
---|
[3032] | 205 |
|
---|
[3484] | 206 | // Use Glonass
|
---|
| 207 | // -----------
|
---|
[6174] | 208 | if ( Qt::CheckState(settings.value("cmbUseGlonass").toInt()) == Qt::Checked) {
|
---|
[3484] | 209 | _useGlonass = true;
|
---|
| 210 | }
|
---|
| 211 | else {
|
---|
| 212 | _useGlonass = false;
|
---|
| 213 | }
|
---|
| 214 |
|
---|
[3032] | 215 | // Initialize Parameters (model: Clk_Corr = AC_Offset + Sat_Offset + Clk)
|
---|
| 216 | // ----------------------------------------------------------------------
|
---|
[3470] | 217 | if (_method == filter) {
|
---|
| 218 | int nextPar = 0;
|
---|
| 219 | QListIterator<cmbAC*> it(_ACs);
|
---|
| 220 | while (it.hasNext()) {
|
---|
| 221 | cmbAC* AC = it.next();
|
---|
[3485] | 222 | _params.push_back(new cmbParam(cmbParam::offACgps, ++nextPar, AC->name, ""));
|
---|
[5808] | 223 | for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
|
---|
[7008] | 224 | QString prn = QString("G%1_0").arg(iGps, 2, 10, QChar('0'));
|
---|
[7297] | 225 | _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
|
---|
[3470] | 226 | AC->name, prn));
|
---|
| 227 | }
|
---|
[3483] | 228 | if (_useGlonass) {
|
---|
[3485] | 229 | _params.push_back(new cmbParam(cmbParam::offACglo, ++nextPar, AC->name, ""));
|
---|
[5808] | 230 | for (unsigned iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
|
---|
[7008] | 231 | QString prn = QString("R%1_0").arg(iGlo, 2, 10, QChar('0'));
|
---|
[7297] | 232 | _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
|
---|
[3483] | 233 | AC->name, prn));
|
---|
| 234 | }
|
---|
| 235 | }
|
---|
[3470] | 236 | }
|
---|
[5808] | 237 | for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
|
---|
[7008] | 238 | QString prn = QString("G%1_0").arg(iGps, 2, 10, QChar('0'));
|
---|
[3470] | 239 | _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
|
---|
[2991] | 240 | }
|
---|
[3483] | 241 | if (_useGlonass) {
|
---|
[5808] | 242 | for (unsigned iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
|
---|
[7008] | 243 | QString prn = QString("R%1_0").arg(iGlo, 2, 10, QChar('0'));
|
---|
[3483] | 244 | _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
|
---|
| 245 | }
|
---|
| 246 | }
|
---|
[7297] | 247 |
|
---|
[3470] | 248 | // Initialize Variance-Covariance Matrix
|
---|
| 249 | // -------------------------------------
|
---|
| 250 | _QQ.ReSize(_params.size());
|
---|
| 251 | _QQ = 0.0;
|
---|
| 252 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 253 | cmbParam* pp = _params[iPar-1];
|
---|
| 254 | _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
| 255 | }
|
---|
[2991] | 256 | }
|
---|
[2933] | 257 |
|
---|
[3052] | 258 | // ANTEX File
|
---|
| 259 | // ----------
|
---|
| 260 | _antex = 0;
|
---|
[6667] | 261 | QString antexFileName = settings.value("uploadAntexFile").toString();
|
---|
[3052] | 262 | if (!antexFileName.isEmpty()) {
|
---|
| 263 | _antex = new bncAntex();
|
---|
| 264 | if (_antex->readFile(antexFileName) != success) {
|
---|
| 265 | emit newMessage("wrong ANTEX file", true);
|
---|
| 266 | delete _antex;
|
---|
| 267 | _antex = 0;
|
---|
| 268 | }
|
---|
| 269 | }
|
---|
[3138] | 270 |
|
---|
[3329] | 271 | // Maximal Residuum
|
---|
| 272 | // ----------------
|
---|
| 273 | _MAXRES = settings.value("cmbMaxres").toDouble();
|
---|
| 274 | if (_MAXRES <= 0.0) {
|
---|
| 275 | _MAXRES = 999.0;
|
---|
| 276 | }
|
---|
[2898] | 277 | }
|
---|
| 278 |
|
---|
| 279 | // Destructor
|
---|
| 280 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 281 | bncComb::~bncComb() {
|
---|
[3429] | 282 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 283 | while (icAC.hasNext()) {
|
---|
| 284 | delete icAC.next();
|
---|
[2918] | 285 | }
|
---|
[3201] | 286 | delete _rtnetDecoder;
|
---|
[9036] | 287 | if (_ssrCorr) {
|
---|
| 288 | delete _ssrCorr;
|
---|
| 289 | }
|
---|
[3052] | 290 | delete _antex;
|
---|
[3296] | 291 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 292 | delete _params[iPar-1];
|
---|
| 293 | }
|
---|
[3556] | 294 | QListIterator<bncTime> itTime(_buffer.keys());
|
---|
[3551] | 295 | while (itTime.hasNext()) {
|
---|
[3556] | 296 | bncTime epoTime = itTime.next();
|
---|
| 297 | _buffer.remove(epoTime);
|
---|
[3429] | 298 | }
|
---|
[2898] | 299 | }
|
---|
| 300 |
|
---|
[6155] | 301 | // Remember orbit corrections
|
---|
[2898] | 302 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 303 | void bncComb::slotNewOrbCorrections(QList<t_orbCorr> orbCorrections) {
|
---|
[2906] | 304 | QMutexLocker locker(&_mutex);
|
---|
[2913] | 305 |
|
---|
[6155] | 306 | for (int ii = 0; ii < orbCorrections.size(); ii++) {
|
---|
| 307 | t_orbCorr& orbCorr = orbCorrections[ii];
|
---|
| 308 | QString staID(orbCorr._staID.c_str());
|
---|
[7008] | 309 | QString prn(orbCorr._prn.toInternalString().c_str());
|
---|
[6155] | 310 |
|
---|
| 311 | // Find/Check the AC Name
|
---|
| 312 | // ----------------------
|
---|
| 313 | QString acName;
|
---|
| 314 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 315 | while (icAC.hasNext()) {
|
---|
| 316 | cmbAC* AC = icAC.next();
|
---|
| 317 | if (AC->mountPoint == staID) {
|
---|
| 318 | acName = AC->name;
|
---|
| 319 | break;
|
---|
| 320 | }
|
---|
[3431] | 321 | }
|
---|
[6155] | 322 | if (acName.isEmpty()) {
|
---|
| 323 | continue;
|
---|
| 324 | }
|
---|
[3431] | 325 |
|
---|
[6155] | 326 | // Store the correction
|
---|
| 327 | // --------------------
|
---|
| 328 | QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
|
---|
| 329 | storage[orbCorr._prn] = orbCorr;
|
---|
[2913] | 330 | }
|
---|
[6155] | 331 | }
|
---|
[2913] | 332 |
|
---|
[6155] | 333 | // Process clock corrections
|
---|
| 334 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 335 | void bncComb::slotNewClkCorrections(QList<t_clkCorr> clkCorrections) {
|
---|
| 336 | QMutexLocker locker(&_mutex);
|
---|
| 337 |
|
---|
| 338 | bncTime lastTime;
|
---|
| 339 |
|
---|
| 340 | for (int ii = 0; ii < clkCorrections.size(); ii++) {
|
---|
| 341 | t_clkCorr& clkCorr = clkCorrections[ii];
|
---|
| 342 | QString staID(clkCorr._staID.c_str());
|
---|
[6961] | 343 | QString prn(clkCorr._prn.toInternalString().c_str());
|
---|
[6155] | 344 |
|
---|
| 345 | // Set the last time
|
---|
| 346 | // -----------------
|
---|
| 347 | if (lastTime.undef() || clkCorr._time > lastTime) {
|
---|
| 348 | lastTime = clkCorr._time;
|
---|
[3483] | 349 | }
|
---|
| 350 |
|
---|
[6155] | 351 | // Find/Check the AC Name
|
---|
| 352 | // ----------------------
|
---|
| 353 | QString acName;
|
---|
| 354 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 355 | while (icAC.hasNext()) {
|
---|
| 356 | cmbAC* AC = icAC.next();
|
---|
| 357 | if (AC->mountPoint == staID) {
|
---|
| 358 | acName = AC->name;
|
---|
| 359 | break;
|
---|
| 360 | }
|
---|
[3588] | 361 | }
|
---|
[6155] | 362 | if (acName.isEmpty()) {
|
---|
| 363 | continue;
|
---|
| 364 | }
|
---|
[3588] | 365 |
|
---|
[6155] | 366 | // Check GLONASS
|
---|
| 367 | // -------------
|
---|
| 368 | if (!_useGlonass && clkCorr._prn.system() == 'R') {
|
---|
| 369 | continue;
|
---|
[3590] | 370 | }
|
---|
| 371 |
|
---|
[8176] | 372 | if (
|
---|
| 373 | clkCorr._prn.system() == 'E' ||
|
---|
| 374 | clkCorr._prn.system() == 'C' ||
|
---|
| 375 | clkCorr._prn.system() == 'J' ||
|
---|
| 376 | clkCorr._prn.system() == 'I' ||
|
---|
| 377 | clkCorr._prn.system() == 'S' ) {
|
---|
| 378 | continue;
|
---|
| 379 | }
|
---|
[8484] | 380 |
|
---|
[6155] | 381 | // Check Modulo Time
|
---|
| 382 | // -----------------
|
---|
[8448] | 383 | int sec = int(nint(clkCorr._time.gpssec()*10));
|
---|
| 384 | if (sec % (_cmbSampl*10) != 0.0) {
|
---|
[6155] | 385 | continue;
|
---|
| 386 | }
|
---|
[3274] | 387 |
|
---|
[6155] | 388 | // Check Correction Age
|
---|
| 389 | // --------------------
|
---|
| 390 | if (_resTime.valid() && clkCorr._time <= _resTime) {
|
---|
[7008] | 391 | emit newMessage("bncComb: old correction: " + acName.toAscii() + " " + prn.mid(0,3).toAscii(), true);
|
---|
[6155] | 392 | continue;
|
---|
| 393 | }
|
---|
[7297] | 394 |
|
---|
[6155] | 395 | // Create new correction
|
---|
| 396 | // ---------------------
|
---|
| 397 | cmbCorr* newCorr = new cmbCorr();
|
---|
[6157] | 398 | newCorr->_prn = prn;
|
---|
[6155] | 399 | newCorr->_time = clkCorr._time;
|
---|
| 400 | newCorr->_iod = clkCorr._iod;
|
---|
| 401 | newCorr->_acName = acName;
|
---|
[6159] | 402 | newCorr->_clkCorr = clkCorr;
|
---|
[6155] | 403 |
|
---|
[6156] | 404 | // Check orbit correction
|
---|
| 405 | // ----------------------
|
---|
| 406 | if (!_orbCorrections.contains(acName)) {
|
---|
| 407 | delete newCorr;
|
---|
| 408 | continue;
|
---|
| 409 | }
|
---|
| 410 | else {
|
---|
| 411 | QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
|
---|
[9267] | 412 | if (!storage.contains(clkCorr._prn) ||
|
---|
| 413 | storage[clkCorr._prn]._iod != newCorr->_iod) {
|
---|
[6156] | 414 | delete newCorr;
|
---|
| 415 | continue;
|
---|
| 416 | }
|
---|
| 417 | else {
|
---|
[6159] | 418 | newCorr->_orbCorr = storage[clkCorr._prn];
|
---|
[6156] | 419 | }
|
---|
| 420 | }
|
---|
| 421 |
|
---|
[6155] | 422 | // Check the Ephemeris
|
---|
| 423 | //--------------------
|
---|
[7012] | 424 | t_eph* ephLast = _ephUser.ephLast(prn);
|
---|
| 425 | t_eph* ephPrev = _ephUser.ephPrev(prn);
|
---|
[6443] | 426 | if (ephLast == 0) {
|
---|
[8696] | 427 | emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toAscii(), true);
|
---|
[6155] | 428 | delete newCorr;
|
---|
| 429 | continue;
|
---|
[2986] | 430 | }
|
---|
[9267] | 431 | else if (ephLast->checkState() != t_eph::ok) {
|
---|
| 432 | emit newMessage("bncComb: eph not ok for " + prn.mid(0,3).toLatin1(), true);
|
---|
| 433 | delete newCorr;
|
---|
| 434 | continue;
|
---|
| 435 | }
|
---|
[3029] | 436 | else {
|
---|
[6443] | 437 | if (ephLast->IOD() == newCorr->_iod) {
|
---|
| 438 | newCorr->_eph = ephLast;
|
---|
[6155] | 439 | }
|
---|
[6443] | 440 | else if (ephPrev && ephPrev->IOD() == newCorr->_iod) {
|
---|
| 441 | newCorr->_eph = ephPrev;
|
---|
| 442 | switchToLastEph(ephLast, newCorr);
|
---|
[6155] | 443 | }
|
---|
| 444 | else {
|
---|
[8696] | 445 | emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toAscii() +
|
---|
| 446 | QString(" with IOD %1").arg(newCorr->_iod).toAscii(), true);
|
---|
[6155] | 447 | delete newCorr;
|
---|
| 448 | continue;
|
---|
| 449 | }
|
---|
[2986] | 450 | }
|
---|
[6155] | 451 |
|
---|
| 452 | // Store correction into the buffer
|
---|
| 453 | // --------------------------------
|
---|
| 454 | QVector<cmbCorr*>& corrs = _buffer[newCorr->_time].corrs;
|
---|
| 455 | corrs.push_back(newCorr);
|
---|
[2986] | 456 | }
|
---|
| 457 |
|
---|
[3435] | 458 | // Process previous Epoch(s)
|
---|
| 459 | // -------------------------
|
---|
[7392] | 460 | const double outWait = 1.0 * _cmbSampl;
|
---|
[3556] | 461 | QListIterator<bncTime> itTime(_buffer.keys());
|
---|
[3435] | 462 | while (itTime.hasNext()) {
|
---|
[3556] | 463 | bncTime epoTime = itTime.next();
|
---|
[7392] | 464 | if (epoTime < lastTime - outWait) {
|
---|
[3556] | 465 | _resTime = epoTime;
|
---|
[3435] | 466 | processEpoch();
|
---|
| 467 | }
|
---|
[2927] | 468 | }
|
---|
[2898] | 469 | }
|
---|
| 470 |
|
---|
[7297] | 471 | // Change the correction so that it refers to last received ephemeris
|
---|
[2986] | 472 | ////////////////////////////////////////////////////////////////////////////
|
---|
[7012] | 473 | void bncComb::switchToLastEph(t_eph* lastEph, cmbCorr* corr) {
|
---|
[3028] | 474 |
|
---|
[6155] | 475 | if (corr->_eph == lastEph) {
|
---|
[3429] | 476 | return;
|
---|
| 477 | }
|
---|
| 478 |
|
---|
[8541] | 479 | ColumnVector oldXC(6);
|
---|
[2987] | 480 | ColumnVector oldVV(3);
|
---|
[9267] | 481 | if (corr->_eph->getCrd(corr->_time, oldXC, oldVV, false) != success) {
|
---|
| 482 | return;
|
---|
| 483 | }
|
---|
[2988] | 484 |
|
---|
[8541] | 485 | ColumnVector newXC(6);
|
---|
[2987] | 486 | ColumnVector newVV(3);
|
---|
[9267] | 487 | if (lastEph->getCrd(corr->_time, newXC, newVV, false) != success) {
|
---|
| 488 | return;
|
---|
| 489 | }
|
---|
[2988] | 490 |
|
---|
| 491 | ColumnVector dX = newXC.Rows(1,3) - oldXC.Rows(1,3);
|
---|
[2989] | 492 | ColumnVector dV = newVV - oldVV;
|
---|
| 493 | double dC = newXC(4) - oldXC(4);
|
---|
| 494 |
|
---|
[2988] | 495 | ColumnVector dRAO(3);
|
---|
| 496 | XYZ_to_RSW(newXC.Rows(1,3), newVV, dX, dRAO);
|
---|
[2989] | 497 |
|
---|
| 498 | ColumnVector dDotRAO(3);
|
---|
| 499 | XYZ_to_RSW(newXC.Rows(1,3), newVV, dV, dDotRAO);
|
---|
| 500 |
|
---|
[6963] | 501 | QString msg = "switch corr " + corr->_prn.mid(0,3)
|
---|
[6155] | 502 | + QString(" %1 -> %2 %3").arg(corr->_iod,3).arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
|
---|
[3013] | 503 |
|
---|
[3029] | 504 | emit newMessage(msg.toAscii(), false);
|
---|
[3028] | 505 |
|
---|
[6155] | 506 | corr->_iod = lastEph->IOD();
|
---|
| 507 | corr->_eph = lastEph;
|
---|
| 508 |
|
---|
[6159] | 509 | corr->_orbCorr._xr += dRAO;
|
---|
| 510 | corr->_orbCorr._dotXr += dDotRAO;
|
---|
| 511 | corr->_clkCorr._dClk -= dC;
|
---|
[2986] | 512 | }
|
---|
| 513 |
|
---|
[3429] | 514 | // Process Epoch
|
---|
[2928] | 515 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3429] | 516 | void bncComb::processEpoch() {
|
---|
[2918] | 517 |
|
---|
[2990] | 518 | _log.clear();
|
---|
| 519 |
|
---|
| 520 | QTextStream out(&_log, QIODevice::WriteOnly);
|
---|
| 521 |
|
---|
[7297] | 522 | out << endl << "Combination:" << endl
|
---|
[3472] | 523 | << "------------------------------" << endl;
|
---|
[2990] | 524 |
|
---|
[3433] | 525 | // Observation Statistics
|
---|
| 526 | // ----------------------
|
---|
[3455] | 527 | bool masterPresent = false;
|
---|
[3433] | 528 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 529 | while (icAC.hasNext()) {
|
---|
| 530 | cmbAC* AC = icAC.next();
|
---|
| 531 | AC->numObs = 0;
|
---|
[3434] | 532 | QVectorIterator<cmbCorr*> itCorr(corrs());
|
---|
[3433] | 533 | while (itCorr.hasNext()) {
|
---|
| 534 | cmbCorr* corr = itCorr.next();
|
---|
[6157] | 535 | if (corr->_acName == AC->name) {
|
---|
[3433] | 536 | AC->numObs += 1;
|
---|
[3453] | 537 | if (AC->name == _masterOrbitAC) {
|
---|
| 538 | masterPresent = true;
|
---|
| 539 | }
|
---|
[3433] | 540 | }
|
---|
| 541 | }
|
---|
| 542 | out << AC->name.toAscii().data() << ": " << AC->numObs << endl;
|
---|
| 543 | }
|
---|
| 544 |
|
---|
[3453] | 545 | // If Master not present, switch to another one
|
---|
| 546 | // --------------------------------------------
|
---|
[4889] | 547 | const unsigned switchMasterAfterGap = 1;
|
---|
[3456] | 548 | if (masterPresent) {
|
---|
| 549 | _masterMissingEpochs = 0;
|
---|
| 550 | }
|
---|
| 551 | else {
|
---|
[3455] | 552 | ++_masterMissingEpochs;
|
---|
[4889] | 553 | if (_masterMissingEpochs < switchMasterAfterGap) {
|
---|
[3457] | 554 | out << "Missing Master, Epoch skipped" << endl;
|
---|
[3556] | 555 | _buffer.remove(_resTime);
|
---|
[3455] | 556 | emit newMessage(_log, false);
|
---|
| 557 | return;
|
---|
[3453] | 558 | }
|
---|
[3455] | 559 | else {
|
---|
| 560 | _masterMissingEpochs = 0;
|
---|
| 561 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 562 | while (icAC.hasNext()) {
|
---|
| 563 | cmbAC* AC = icAC.next();
|
---|
| 564 | if (AC->numObs > 0) {
|
---|
| 565 | out << "Switching Master AC "
|
---|
[7297] | 566 | << _masterOrbitAC.toAscii().data() << " --> "
|
---|
| 567 | << AC->name.toAscii().data() << " "
|
---|
| 568 | << _resTime.datestr().c_str() << " "
|
---|
[3455] | 569 | << _resTime.timestr().c_str() << endl;
|
---|
| 570 | _masterOrbitAC = AC->name;
|
---|
| 571 | break;
|
---|
| 572 | }
|
---|
[3452] | 573 | }
|
---|
| 574 | }
|
---|
| 575 | }
|
---|
| 576 |
|
---|
[6157] | 577 | QMap<QString, cmbCorr*> resCorr;
|
---|
[3472] | 578 |
|
---|
| 579 | // Perform the actual Combination using selected Method
|
---|
| 580 | // ----------------------------------------------------
|
---|
| 581 | t_irc irc;
|
---|
[3475] | 582 | ColumnVector dx;
|
---|
[3472] | 583 | if (_method == filter) {
|
---|
[3475] | 584 | irc = processEpoch_filter(out, resCorr, dx);
|
---|
[3472] | 585 | }
|
---|
| 586 | else {
|
---|
[3475] | 587 | irc = processEpoch_singleEpoch(out, resCorr, dx);
|
---|
[3472] | 588 | }
|
---|
| 589 |
|
---|
[3475] | 590 | // Update Parameter Values, Print Results
|
---|
| 591 | // --------------------------------------
|
---|
[3472] | 592 | if (irc == success) {
|
---|
[3475] | 593 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 594 | cmbParam* pp = _params[iPar-1];
|
---|
| 595 | pp->xx += dx(iPar);
|
---|
| 596 | if (pp->type == cmbParam::clkSat) {
|
---|
| 597 | if (resCorr.find(pp->prn) != resCorr.end()) {
|
---|
[6160] | 598 | resCorr[pp->prn]->_dClkResult = pp->xx / t_CST::c;
|
---|
[3475] | 599 | }
|
---|
| 600 | }
|
---|
[7297] | 601 | out << _resTime.datestr().c_str() << " "
|
---|
[3475] | 602 | << _resTime.timestr().c_str() << " ";
|
---|
| 603 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
| 604 | out.setFieldWidth(8);
|
---|
| 605 | out.setRealNumberPrecision(4);
|
---|
| 606 | out << pp->toString() << " "
|
---|
| 607 | << pp->xx << " +- " << sqrt(_QQ(pp->index,pp->index)) << endl;
|
---|
| 608 | out.setFieldWidth(0);
|
---|
| 609 | }
|
---|
[3472] | 610 | printResults(out, resCorr);
|
---|
| 611 | dumpResults(resCorr);
|
---|
| 612 | }
|
---|
| 613 |
|
---|
| 614 | // Delete Data, emit Message
|
---|
| 615 | // -------------------------
|
---|
[3556] | 616 | _buffer.remove(_resTime);
|
---|
[3472] | 617 | emit newMessage(_log, false);
|
---|
| 618 | }
|
---|
| 619 |
|
---|
| 620 | // Process Epoch - Filter Method
|
---|
| 621 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 622 | t_irc bncComb::processEpoch_filter(QTextStream& out,
|
---|
[6157] | 623 | QMap<QString, cmbCorr*>& resCorr,
|
---|
[3475] | 624 | ColumnVector& dx) {
|
---|
[3472] | 625 |
|
---|
[3429] | 626 | // Prediction Step
|
---|
| 627 | // ---------------
|
---|
[3472] | 628 | int nPar = _params.size();
|
---|
[2933] | 629 | ColumnVector x0(nPar);
|
---|
| 630 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
[3455] | 631 | cmbParam* pp = _params[iPar-1];
|
---|
| 632 | if (pp->epoSpec) {
|
---|
[3451] | 633 | pp->xx = 0.0;
|
---|
[3455] | 634 | _QQ.Row(iPar) = 0.0;
|
---|
| 635 | _QQ.Column(iPar) = 0.0;
|
---|
| 636 | _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
[3451] | 637 | }
|
---|
[3455] | 638 | else {
|
---|
| 639 | _QQ(iPar,iPar) += pp->sigP * pp->sigP;
|
---|
| 640 | }
|
---|
[2933] | 641 | x0(iPar) = pp->xx;
|
---|
| 642 | }
|
---|
| 643 |
|
---|
[3487] | 644 | // Check Satellite Positions for Outliers
|
---|
| 645 | // --------------------------------------
|
---|
[3497] | 646 | if (checkOrbits(out) != success) {
|
---|
[3487] | 647 | return failure;
|
---|
| 648 | }
|
---|
[3441] | 649 |
|
---|
[3455] | 650 | // Update and outlier detection loop
|
---|
| 651 | // ---------------------------------
|
---|
[3487] | 652 | SymmetricMatrix QQ_sav = _QQ;
|
---|
[3455] | 653 | while (true) {
|
---|
[3135] | 654 |
|
---|
[3455] | 655 | Matrix AA;
|
---|
| 656 | ColumnVector ll;
|
---|
| 657 | DiagonalMatrix PP;
|
---|
[3429] | 658 |
|
---|
[3455] | 659 | if (createAmat(AA, ll, PP, x0, resCorr) != success) {
|
---|
[3472] | 660 | return failure;
|
---|
[3441] | 661 | }
|
---|
[2933] | 662 |
|
---|
[6169] | 663 | dx.ReSize(nPar); dx = 0.0;
|
---|
[5808] | 664 | kalman(AA, ll, PP, _QQ, dx);
|
---|
[6164] | 665 |
|
---|
[3429] | 666 | ColumnVector vv = ll - AA * dx;
|
---|
[3080] | 667 |
|
---|
[3429] | 668 | int maxResIndex;
|
---|
[7297] | 669 | double maxRes = vv.maximum_absolute_value1(maxResIndex);
|
---|
[3429] | 670 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
[7297] | 671 | out.setRealNumberPrecision(3);
|
---|
[3429] | 672 | out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
|
---|
[3432] | 673 | << " Maximum Residuum " << maxRes << ' '
|
---|
[6962] | 674 | << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn.mid(0,3);
|
---|
[3432] | 675 | if (maxRes > _MAXRES) {
|
---|
| 676 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 677 | cmbParam* pp = _params[iPar-1];
|
---|
[7297] | 678 | if (pp->type == cmbParam::offACSat &&
|
---|
[6157] | 679 | pp->AC == corrs()[maxResIndex-1]->_acName &&
|
---|
[6962] | 680 | pp->prn == corrs()[maxResIndex-1]->_prn.mid(0,3)) {
|
---|
[3432] | 681 | QQ_sav.Row(iPar) = 0.0;
|
---|
| 682 | QQ_sav.Column(iPar) = 0.0;
|
---|
[3455] | 683 | QQ_sav(iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
[3432] | 684 | }
|
---|
| 685 | }
|
---|
| 686 |
|
---|
| 687 | out << " Outlier" << endl;
|
---|
| 688 | _QQ = QQ_sav;
|
---|
[3455] | 689 | corrs().remove(maxResIndex-1);
|
---|
[3432] | 690 | }
|
---|
| 691 | else {
|
---|
| 692 | out << " OK" << endl;
|
---|
[6330] | 693 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
| 694 | out.setRealNumberPrecision(4);
|
---|
| 695 | for (int ii = 0; ii < corrs().size(); ii++) {
|
---|
[8066] | 696 | const cmbCorr* corr = corrs()[ii];
|
---|
[6330] | 697 | out << _resTime.datestr().c_str() << ' '
|
---|
| 698 | << _resTime.timestr().c_str() << " "
|
---|
[6962] | 699 | << corr->_acName << ' ' << corr->_prn.mid(0,3);
|
---|
[6330] | 700 | out.setFieldWidth(10);
|
---|
| 701 | out << " res = " << vv[ii] << endl;
|
---|
| 702 | out.setFieldWidth(0);
|
---|
| 703 | }
|
---|
[3432] | 704 | break;
|
---|
| 705 | }
|
---|
| 706 | }
|
---|
| 707 |
|
---|
[3472] | 708 | return success;
|
---|
[2918] | 709 | }
|
---|
[3011] | 710 |
|
---|
[3201] | 711 | // Print results
|
---|
[3011] | 712 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3429] | 713 | void bncComb::printResults(QTextStream& out,
|
---|
[6157] | 714 | const QMap<QString, cmbCorr*>& resCorr) {
|
---|
[3011] | 715 |
|
---|
[6157] | 716 | QMapIterator<QString, cmbCorr*> it(resCorr);
|
---|
[3011] | 717 | while (it.hasNext()) {
|
---|
| 718 | it.next();
|
---|
[6157] | 719 | cmbCorr* corr = it.value();
|
---|
| 720 | const t_eph* eph = corr->_eph;
|
---|
[3015] | 721 | if (eph) {
|
---|
[8541] | 722 | ColumnVector xc(6);
|
---|
[6109] | 723 | ColumnVector vv(3);
|
---|
| 724 | eph->getCrd(_resTime, xc, vv, false);
|
---|
[3015] | 725 |
|
---|
[7297] | 726 | out << _resTime.datestr().c_str() << " "
|
---|
[3429] | 727 | << _resTime.timestr().c_str() << " ";
|
---|
[3015] | 728 | out.setFieldWidth(3);
|
---|
[6962] | 729 | out << "Full Clock " << corr->_prn.mid(0,3) << " " << corr->_iod << " ";
|
---|
[3015] | 730 | out.setFieldWidth(14);
|
---|
[6160] | 731 | out << (xc(4) + corr->_dClkResult) * t_CST::c << endl;
|
---|
[3370] | 732 | out.setFieldWidth(0);
|
---|
[3015] | 733 | }
|
---|
| 734 | else {
|
---|
| 735 | out << "bncComb::printResuls bug" << endl;
|
---|
| 736 | }
|
---|
[3011] | 737 | }
|
---|
| 738 | }
|
---|
[3202] | 739 |
|
---|
| 740 | // Send results to RTNet Decoder and directly to PPP Client
|
---|
| 741 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6157] | 742 | void bncComb::dumpResults(const QMap<QString, cmbCorr*>& resCorr) {
|
---|
[3202] | 743 |
|
---|
[6161] | 744 | QList<t_orbCorr> orbCorrections;
|
---|
| 745 | QList<t_clkCorr> clkCorrections;
|
---|
| 746 |
|
---|
[5337] | 747 | QString outLines;
|
---|
[3214] | 748 | unsigned year, month, day, hour, minute;
|
---|
| 749 | double sec;
|
---|
[3429] | 750 | _resTime.civil_date(year, month, day);
|
---|
| 751 | _resTime.civil_time(hour, minute, sec);
|
---|
[3214] | 752 |
|
---|
[7297] | 753 | outLines.sprintf("* %4d %2d %2d %d %d %12.8f\n",
|
---|
[5337] | 754 | year, month, day, hour, minute, sec);
|
---|
[3214] | 755 |
|
---|
[6157] | 756 | QMapIterator<QString, cmbCorr*> it(resCorr);
|
---|
[3202] | 757 | while (it.hasNext()) {
|
---|
| 758 | it.next();
|
---|
[6157] | 759 | cmbCorr* corr = it.value();
|
---|
[3202] | 760 |
|
---|
[7013] | 761 | t_orbCorr orbCorr(corr->_orbCorr);
|
---|
| 762 | orbCorr._staID = "INTERNAL";
|
---|
| 763 | orbCorrections.push_back(orbCorr);
|
---|
| 764 |
|
---|
| 765 | t_clkCorr clkCorr(corr->_clkCorr);
|
---|
| 766 | clkCorr._staID = "INTERNAL";
|
---|
| 767 | clkCorr._dClk = corr->_dClkResult;
|
---|
| 768 | clkCorr._dotDClk = 0.0;
|
---|
| 769 | clkCorr._dotDotDClk = 0.0;
|
---|
| 770 | clkCorrections.push_back(clkCorr);
|
---|
| 771 |
|
---|
[8541] | 772 | ColumnVector xc(6);
|
---|
[4978] | 773 | ColumnVector vv(3);
|
---|
[7013] | 774 | corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr));
|
---|
| 775 | corr->_eph->setOrbCorr(dynamic_cast<const t_orbCorr*>(&orbCorr));
|
---|
[7012] | 776 | corr->_eph->getCrd(_resTime, xc, vv, true);
|
---|
| 777 |
|
---|
[4978] | 778 | // Correction Phase Center --> CoM
|
---|
| 779 | // -------------------------------
|
---|
| 780 | ColumnVector dx(3); dx = 0.0;
|
---|
| 781 | if (_antex) {
|
---|
| 782 | double Mjd = _resTime.mjd() + _resTime.daysec()/86400.0;
|
---|
[6157] | 783 | if (_antex->satCoMcorrection(corr->_prn, Mjd, xc.Rows(1,3), dx) != success) {
|
---|
[4992] | 784 | dx = 0;
|
---|
[6970] | 785 | _log += "antenna not found " + corr->_prn.mid(0,3).toAscii() + '\n';
|
---|
[3214] | 786 | }
|
---|
| 787 | }
|
---|
[7012] | 788 |
|
---|
| 789 | outLines += corr->_prn.mid(0,3);
|
---|
[5337] | 790 | QString hlp;
|
---|
| 791 | hlp.sprintf(" APC 3 %15.4f %15.4f %15.4f"
|
---|
| 792 | " Clk 1 %15.4f"
|
---|
| 793 | " Vel 3 %15.4f %15.4f %15.4f"
|
---|
| 794 | " CoM 3 %15.4f %15.4f %15.4f\n",
|
---|
[7012] | 795 | xc(1), xc(2), xc(3),
|
---|
| 796 | xc(4) * t_CST::c,
|
---|
[5337] | 797 | vv(1), vv(2), vv(3),
|
---|
| 798 | xc(1)-dx(1), xc(2)-dx(2), xc(3)-dx(3));
|
---|
| 799 | outLines += hlp;
|
---|
| 800 |
|
---|
[4978] | 801 | QString line;
|
---|
[9036] | 802 | int messageType = _ssrCorr->COTYPE_GPSCOMBINED;
|
---|
[5564] | 803 | int updateInt = 0;
|
---|
[4978] | 804 | line.sprintf("%d %d %d %.1f %s"
|
---|
[7055] | 805 | " %lu"
|
---|
[4978] | 806 | " %8.3f %8.3f %8.3f %8.3f"
|
---|
| 807 | " %10.5f %10.5f %10.5f %10.5f"
|
---|
[5576] | 808 | " %10.5f INTERNAL",
|
---|
[4978] | 809 | messageType, updateInt, _resTime.gpsw(), _resTime.gpssec(),
|
---|
[7012] | 810 | corr->_prn.mid(0,3).toAscii().data(),
|
---|
[6157] | 811 | corr->_iod,
|
---|
[6160] | 812 | corr->_dClkResult * t_CST::c,
|
---|
[6159] | 813 | corr->_orbCorr._xr[0],
|
---|
| 814 | corr->_orbCorr._xr[1],
|
---|
| 815 | corr->_orbCorr._xr[2],
|
---|
[6157] | 816 | 0.0,
|
---|
[6159] | 817 | corr->_orbCorr._dotXr[0],
|
---|
| 818 | corr->_orbCorr._dotXr[1],
|
---|
| 819 | corr->_orbCorr._dotXr[2],
|
---|
[6157] | 820 | 0.0);
|
---|
[3214] | 821 | delete corr;
|
---|
| 822 | }
|
---|
| 823 |
|
---|
[5337] | 824 | outLines += "EOE\n"; // End Of Epoch flag
|
---|
| 825 |
|
---|
[3215] | 826 | if (!_rtnetDecoder) {
|
---|
| 827 | _rtnetDecoder = new bncRtnetDecoder();
|
---|
| 828 | }
|
---|
[3221] | 829 |
|
---|
[3215] | 830 | vector<string> errmsg;
|
---|
[5337] | 831 | _rtnetDecoder->Decode(outLines.toAscii().data(), outLines.length(), errmsg);
|
---|
[3215] | 832 |
|
---|
[5861] | 833 | // Send new Corrections to PPP etc.
|
---|
| 834 | // --------------------------------
|
---|
[6161] | 835 | if (orbCorrections.size() > 0 && clkCorrections.size() > 0) {
|
---|
| 836 | emit newOrbCorrections(orbCorrections);
|
---|
| 837 | emit newClkCorrections(clkCorrections);
|
---|
| 838 | }
|
---|
[3202] | 839 | }
|
---|
[3455] | 840 |
|
---|
| 841 | // Create First Design Matrix and Vector of Measurements
|
---|
| 842 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 843 | t_irc bncComb::createAmat(Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
|
---|
[7297] | 844 | const ColumnVector& x0,
|
---|
[6157] | 845 | QMap<QString, cmbCorr*>& resCorr) {
|
---|
[3455] | 846 |
|
---|
| 847 | unsigned nPar = _params.size();
|
---|
[7297] | 848 | unsigned nObs = corrs().size();
|
---|
[3455] | 849 |
|
---|
| 850 | if (nObs == 0) {
|
---|
| 851 | return failure;
|
---|
| 852 | }
|
---|
| 853 |
|
---|
[5742] | 854 | int maxSat = t_prn::MAXPRN_GPS;
|
---|
[3486] | 855 | // if (_useGlonass) {
|
---|
[5742] | 856 | // maxSat = t_prn::MAXPRN_GPS + t_prn::MAXPRN_GLONASS;
|
---|
[3486] | 857 | // }
|
---|
[3455] | 858 |
|
---|
[5742] | 859 | const int nCon = (_method == filter) ? 1 + maxSat : 0;
|
---|
[3483] | 860 |
|
---|
[3455] | 861 | AA.ReSize(nObs+nCon, nPar); AA = 0.0;
|
---|
| 862 | ll.ReSize(nObs+nCon); ll = 0.0;
|
---|
| 863 | PP.ReSize(nObs+nCon); PP = 1.0 / (sigObs * sigObs);
|
---|
| 864 |
|
---|
| 865 | int iObs = 0;
|
---|
| 866 | QVectorIterator<cmbCorr*> itCorr(corrs());
|
---|
| 867 | while (itCorr.hasNext()) {
|
---|
| 868 | cmbCorr* corr = itCorr.next();
|
---|
[6157] | 869 | QString prn = corr->_prn;
|
---|
[3487] | 870 |
|
---|
[3455] | 871 | ++iObs;
|
---|
| 872 |
|
---|
[6157] | 873 | if (corr->_acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
|
---|
| 874 | resCorr[prn] = new cmbCorr(*corr);
|
---|
[3455] | 875 | }
|
---|
| 876 |
|
---|
| 877 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 878 | cmbParam* pp = _params[iPar-1];
|
---|
[6157] | 879 | AA(iObs, iPar) = pp->partial(corr->_acName, prn);
|
---|
[3455] | 880 | }
|
---|
| 881 |
|
---|
[6160] | 882 | ll(iObs) = corr->_clkCorr._dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
|
---|
[3455] | 883 | }
|
---|
| 884 |
|
---|
| 885 | // Regularization
|
---|
| 886 | // --------------
|
---|
[3474] | 887 | if (_method == filter) {
|
---|
| 888 | const double Ph = 1.e6;
|
---|
| 889 | PP(nObs+1) = Ph;
|
---|
[3461] | 890 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 891 | cmbParam* pp = _params[iPar-1];
|
---|
[3465] | 892 | if ( AA.Column(iPar).maximum_absolute_value() > 0.0 &&
|
---|
[3474] | 893 | pp->type == cmbParam::clkSat ) {
|
---|
| 894 | AA(nObs+1, iPar) = 1.0;
|
---|
[3455] | 895 | }
|
---|
| 896 | }
|
---|
[3474] | 897 | int iCond = 1;
|
---|
[5808] | 898 | for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
|
---|
[7132] | 899 | QString prn = QString("G%1_0").arg(iGps, 2, 10, QChar('0'));
|
---|
[3474] | 900 | ++iCond;
|
---|
| 901 | PP(nObs+iCond) = Ph;
|
---|
| 902 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 903 | cmbParam* pp = _params[iPar-1];
|
---|
[7299] | 904 | if ( pp &&
|
---|
| 905 | AA.Column(iPar).maximum_absolute_value() > 0.0 &&
|
---|
[7297] | 906 | pp->type == cmbParam::offACSat &&
|
---|
[3474] | 907 | pp->prn == prn) {
|
---|
| 908 | AA(nObs+iCond, iPar) = 1.0;
|
---|
| 909 | }
|
---|
| 910 | }
|
---|
| 911 | }
|
---|
[3486] | 912 | // if (_useGlonass) {
|
---|
[9036] | 913 | // for (unsigned iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
|
---|
[7132] | 914 | // QString prn = QString("R%1_0").arg(iGlo, 2, 10, QChar('0'));
|
---|
[3486] | 915 | // ++iCond;
|
---|
| 916 | // PP(nObs+iCond) = Ph;
|
---|
| 917 | // for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 918 | // cmbParam* pp = _params[iPar-1];
|
---|
[7299] | 919 | // if ( pp &&
|
---|
| 920 | // AA.Column(iPar).maximum_absolute_value() > 0.0 &&
|
---|
[7297] | 921 | // pp->type == cmbParam::offACSat &&
|
---|
[3486] | 922 | // pp->prn == prn) {
|
---|
| 923 | // AA(nObs+iCond, iPar) = 1.0;
|
---|
| 924 | // }
|
---|
| 925 | // }
|
---|
| 926 | // }
|
---|
| 927 | // }
|
---|
[3455] | 928 | }
|
---|
| 929 |
|
---|
| 930 | return success;
|
---|
| 931 | }
|
---|
[3470] | 932 |
|
---|
| 933 | // Process Epoch - Single-Epoch Method
|
---|
| 934 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3472] | 935 | t_irc bncComb::processEpoch_singleEpoch(QTextStream& out,
|
---|
[6157] | 936 | QMap<QString, cmbCorr*>& resCorr,
|
---|
[3475] | 937 | ColumnVector& dx) {
|
---|
[3470] | 938 |
|
---|
[3487] | 939 | // Check Satellite Positions for Outliers
|
---|
| 940 | // --------------------------------------
|
---|
[3497] | 941 | if (checkOrbits(out) != success) {
|
---|
[3487] | 942 | return failure;
|
---|
| 943 | }
|
---|
| 944 |
|
---|
[3482] | 945 | // Outlier Detection Loop
|
---|
| 946 | // ----------------------
|
---|
| 947 | while (true) {
|
---|
[7297] | 948 |
|
---|
[3482] | 949 | // Remove Satellites that are not in Master
|
---|
| 950 | // ----------------------------------------
|
---|
| 951 | QMutableVectorIterator<cmbCorr*> it(corrs());
|
---|
| 952 | while (it.hasNext()) {
|
---|
| 953 | cmbCorr* corr = it.next();
|
---|
[6157] | 954 | QString prn = corr->_prn;
|
---|
[3482] | 955 | bool foundMaster = false;
|
---|
| 956 | QVectorIterator<cmbCorr*> itHlp(corrs());
|
---|
| 957 | while (itHlp.hasNext()) {
|
---|
| 958 | cmbCorr* corrHlp = itHlp.next();
|
---|
[6157] | 959 | QString prnHlp = corrHlp->_prn;
|
---|
| 960 | QString ACHlp = corrHlp->_acName;
|
---|
[3482] | 961 | if (ACHlp == _masterOrbitAC && prn == prnHlp) {
|
---|
| 962 | foundMaster = true;
|
---|
| 963 | break;
|
---|
| 964 | }
|
---|
[3476] | 965 | }
|
---|
[3482] | 966 | if (!foundMaster) {
|
---|
[3556] | 967 | delete corr;
|
---|
[3482] | 968 | it.remove();
|
---|
| 969 | }
|
---|
[3473] | 970 | }
|
---|
[7297] | 971 |
|
---|
[3482] | 972 | // Count Number of Observations per Satellite and per AC
|
---|
| 973 | // -----------------------------------------------------
|
---|
| 974 | QMap<QString, int> numObsPrn;
|
---|
| 975 | QMap<QString, int> numObsAC;
|
---|
| 976 | QVectorIterator<cmbCorr*> itCorr(corrs());
|
---|
| 977 | while (itCorr.hasNext()) {
|
---|
| 978 | cmbCorr* corr = itCorr.next();
|
---|
[6157] | 979 | QString prn = corr->_prn;
|
---|
| 980 | QString AC = corr->_acName;
|
---|
[3482] | 981 | if (numObsPrn.find(prn) == numObsPrn.end()) {
|
---|
| 982 | numObsPrn[prn] = 1;
|
---|
| 983 | }
|
---|
| 984 | else {
|
---|
| 985 | numObsPrn[prn] += 1;
|
---|
| 986 | }
|
---|
| 987 | if (numObsAC.find(AC) == numObsAC.end()) {
|
---|
| 988 | numObsAC[AC] = 1;
|
---|
| 989 | }
|
---|
| 990 | else {
|
---|
| 991 | numObsAC[AC] += 1;
|
---|
| 992 | }
|
---|
[3476] | 993 | }
|
---|
[7297] | 994 |
|
---|
[3482] | 995 | // Clean-Up the Paramters
|
---|
| 996 | // ----------------------
|
---|
| 997 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 998 | delete _params[iPar-1];
|
---|
[3474] | 999 | }
|
---|
[3482] | 1000 | _params.clear();
|
---|
[7297] | 1001 |
|
---|
[3482] | 1002 | // Set new Parameters
|
---|
| 1003 | // ------------------
|
---|
| 1004 | int nextPar = 0;
|
---|
[7297] | 1005 |
|
---|
[3482] | 1006 | QMapIterator<QString, int> itAC(numObsAC);
|
---|
| 1007 | while (itAC.hasNext()) {
|
---|
| 1008 | itAC.next();
|
---|
| 1009 | const QString& AC = itAC.key();
|
---|
| 1010 | int numObs = itAC.value();
|
---|
| 1011 | if (AC != _masterOrbitAC && numObs > 0) {
|
---|
[3485] | 1012 | _params.push_back(new cmbParam(cmbParam::offACgps, ++nextPar, AC, ""));
|
---|
| 1013 | if (_useGlonass) {
|
---|
| 1014 | _params.push_back(new cmbParam(cmbParam::offACglo, ++nextPar, AC, ""));
|
---|
| 1015 | }
|
---|
[3482] | 1016 | }
|
---|
[7297] | 1017 | }
|
---|
| 1018 |
|
---|
[3482] | 1019 | QMapIterator<QString, int> itPrn(numObsPrn);
|
---|
| 1020 | while (itPrn.hasNext()) {
|
---|
| 1021 | itPrn.next();
|
---|
| 1022 | const QString& prn = itPrn.key();
|
---|
| 1023 | int numObs = itPrn.value();
|
---|
| 1024 | if (numObs > 0) {
|
---|
| 1025 | _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
|
---|
| 1026 | }
|
---|
[7297] | 1027 | }
|
---|
| 1028 |
|
---|
[3482] | 1029 | int nPar = _params.size();
|
---|
[7297] | 1030 | ColumnVector x0(nPar);
|
---|
[3482] | 1031 | x0 = 0.0;
|
---|
[7297] | 1032 |
|
---|
[3482] | 1033 | // Create First-Design Matrix
|
---|
| 1034 | // --------------------------
|
---|
| 1035 | Matrix AA;
|
---|
| 1036 | ColumnVector ll;
|
---|
| 1037 | DiagonalMatrix PP;
|
---|
| 1038 | if (createAmat(AA, ll, PP, x0, resCorr) != success) {
|
---|
| 1039 | return failure;
|
---|
[3476] | 1040 | }
|
---|
[7297] | 1041 |
|
---|
[3482] | 1042 | ColumnVector vv;
|
---|
| 1043 | try {
|
---|
| 1044 | Matrix ATP = AA.t() * PP;
|
---|
| 1045 | SymmetricMatrix NN; NN << ATP * AA;
|
---|
| 1046 | ColumnVector bb = ATP * ll;
|
---|
| 1047 | _QQ = NN.i();
|
---|
| 1048 | dx = _QQ * bb;
|
---|
| 1049 | vv = ll - AA * dx;
|
---|
[3476] | 1050 | }
|
---|
[3482] | 1051 | catch (Exception& exc) {
|
---|
| 1052 | out << exc.what() << endl;
|
---|
| 1053 | return failure;
|
---|
[3476] | 1054 | }
|
---|
[3474] | 1055 |
|
---|
[3482] | 1056 | int maxResIndex;
|
---|
[7297] | 1057 | double maxRes = vv.maximum_absolute_value1(maxResIndex);
|
---|
[3482] | 1058 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
[7297] | 1059 | out.setRealNumberPrecision(3);
|
---|
[3482] | 1060 | out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
|
---|
| 1061 | << " Maximum Residuum " << maxRes << ' '
|
---|
[7715] | 1062 | << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn.mid(0,3);
|
---|
[3474] | 1063 |
|
---|
[3482] | 1064 | if (maxRes > _MAXRES) {
|
---|
| 1065 | out << " Outlier" << endl;
|
---|
[3556] | 1066 | delete corrs()[maxResIndex-1];
|
---|
[3482] | 1067 | corrs().remove(maxResIndex-1);
|
---|
[3474] | 1068 | }
|
---|
[3482] | 1069 | else {
|
---|
| 1070 | out << " OK" << endl;
|
---|
| 1071 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
[7297] | 1072 | out.setRealNumberPrecision(3);
|
---|
[3482] | 1073 | for (int ii = 0; ii < vv.Nrows(); ii++) {
|
---|
| 1074 | const cmbCorr* corr = corrs()[ii];
|
---|
[7297] | 1075 | out << _resTime.datestr().c_str() << ' '
|
---|
[3482] | 1076 | << _resTime.timestr().c_str() << " "
|
---|
[6962] | 1077 | << corr->_acName << ' ' << corr->_prn.mid(0,3);
|
---|
[3482] | 1078 | out.setFieldWidth(6);
|
---|
[6330] | 1079 | out << " res = " << vv[ii] << endl;
|
---|
[3482] | 1080 | out.setFieldWidth(0);
|
---|
| 1081 | }
|
---|
| 1082 | return success;
|
---|
[3474] | 1083 | }
|
---|
| 1084 |
|
---|
[3473] | 1085 | }
|
---|
[3474] | 1086 |
|
---|
[3482] | 1087 | return failure;
|
---|
[3470] | 1088 | }
|
---|
[3487] | 1089 |
|
---|
| 1090 | // Check Satellite Positions for Outliers
|
---|
| 1091 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3497] | 1092 | t_irc bncComb::checkOrbits(QTextStream& out) {
|
---|
[3487] | 1093 |
|
---|
[3489] | 1094 | const double MAX_DISPLACEMENT = 0.20;
|
---|
[3488] | 1095 |
|
---|
[3502] | 1096 | // Switch to last ephemeris (if possible)
|
---|
| 1097 | // --------------------------------------
|
---|
[3501] | 1098 | QMutableVectorIterator<cmbCorr*> im(corrs());
|
---|
| 1099 | while (im.hasNext()) {
|
---|
| 1100 | cmbCorr* corr = im.next();
|
---|
[6157] | 1101 | QString prn = corr->_prn;
|
---|
[6443] | 1102 |
|
---|
[7012] | 1103 | t_eph* ephLast = _ephUser.ephLast(prn);
|
---|
| 1104 | t_eph* ephPrev = _ephUser.ephPrev(prn);
|
---|
[6443] | 1105 |
|
---|
| 1106 | if (ephLast == 0) {
|
---|
[6962] | 1107 | out << "checkOrbit: missing eph (not found) " << corr->_prn.mid(0,3) << endl;
|
---|
[3556] | 1108 | delete corr;
|
---|
[3501] | 1109 | im.remove();
|
---|
| 1110 | }
|
---|
[6157] | 1111 | else if (corr->_eph == 0) {
|
---|
[6962] | 1112 | out << "checkOrbit: missing eph (zero) " << corr->_prn.mid(0,3) << endl;
|
---|
[3556] | 1113 | delete corr;
|
---|
[3503] | 1114 | im.remove();
|
---|
| 1115 | }
|
---|
[3502] | 1116 | else {
|
---|
[6443] | 1117 | if ( corr->_eph == ephLast || corr->_eph == ephPrev ) {
|
---|
| 1118 | switchToLastEph(ephLast, corr);
|
---|
[3502] | 1119 | }
|
---|
| 1120 | else {
|
---|
[6962] | 1121 | out << "checkOrbit: missing eph (deleted) " << corr->_prn.mid(0,3) << endl;
|
---|
[3556] | 1122 | delete corr;
|
---|
[3502] | 1123 | im.remove();
|
---|
| 1124 | }
|
---|
| 1125 | }
|
---|
[3501] | 1126 | }
|
---|
| 1127 |
|
---|
[3488] | 1128 | while (true) {
|
---|
| 1129 |
|
---|
| 1130 | // Compute Mean Corrections for all Satellites
|
---|
| 1131 | // -------------------------------------------
|
---|
[3489] | 1132 | QMap<QString, int> numCorr;
|
---|
[3488] | 1133 | QMap<QString, ColumnVector> meanRao;
|
---|
| 1134 | QVectorIterator<cmbCorr*> it(corrs());
|
---|
| 1135 | while (it.hasNext()) {
|
---|
| 1136 | cmbCorr* corr = it.next();
|
---|
[6157] | 1137 | QString prn = corr->_prn;
|
---|
[3488] | 1138 | if (meanRao.find(prn) == meanRao.end()) {
|
---|
| 1139 | meanRao[prn].ReSize(4);
|
---|
[6159] | 1140 | meanRao[prn].Rows(1,3) = corr->_orbCorr._xr;
|
---|
[7297] | 1141 | meanRao[prn](4) = 1;
|
---|
[3488] | 1142 | }
|
---|
| 1143 | else {
|
---|
[6159] | 1144 | meanRao[prn].Rows(1,3) += corr->_orbCorr._xr;
|
---|
[7297] | 1145 | meanRao[prn](4) += 1;
|
---|
[3488] | 1146 | }
|
---|
[3489] | 1147 | if (numCorr.find(prn) == numCorr.end()) {
|
---|
| 1148 | numCorr[prn] = 1;
|
---|
| 1149 | }
|
---|
| 1150 | else {
|
---|
| 1151 | numCorr[prn] += 1;
|
---|
| 1152 | }
|
---|
[3487] | 1153 | }
|
---|
[7297] | 1154 |
|
---|
[3488] | 1155 | // Compute Differences wrt Mean, find Maximum
|
---|
| 1156 | // ------------------------------------------
|
---|
| 1157 | QMap<QString, cmbCorr*> maxDiff;
|
---|
| 1158 | it.toFront();
|
---|
| 1159 | while (it.hasNext()) {
|
---|
| 1160 | cmbCorr* corr = it.next();
|
---|
[6157] | 1161 | QString prn = corr->_prn;
|
---|
[3488] | 1162 | if (meanRao[prn](4) != 0) {
|
---|
| 1163 | meanRao[prn] /= meanRao[prn](4);
|
---|
| 1164 | meanRao[prn](4) = 0;
|
---|
| 1165 | }
|
---|
[6159] | 1166 | corr->_diffRao = corr->_orbCorr._xr - meanRao[prn].Rows(1,3);
|
---|
[3488] | 1167 | if (maxDiff.find(prn) == maxDiff.end()) {
|
---|
| 1168 | maxDiff[prn] = corr;
|
---|
| 1169 | }
|
---|
| 1170 | else {
|
---|
[6157] | 1171 | double normMax = maxDiff[prn]->_diffRao.norm_Frobenius();
|
---|
| 1172 | double norm = corr->_diffRao.norm_Frobenius();
|
---|
[3488] | 1173 | if (norm > normMax) {
|
---|
| 1174 | maxDiff[prn] = corr;
|
---|
| 1175 | }
|
---|
[7297] | 1176 | }
|
---|
[3487] | 1177 | }
|
---|
[7297] | 1178 |
|
---|
[3655] | 1179 | if (_ACs.size() == 1) {
|
---|
| 1180 | break;
|
---|
| 1181 | }
|
---|
| 1182 |
|
---|
[3488] | 1183 | // Remove Outliers
|
---|
| 1184 | // ---------------
|
---|
| 1185 | bool removed = false;
|
---|
| 1186 | QMutableVectorIterator<cmbCorr*> im(corrs());
|
---|
| 1187 | while (im.hasNext()) {
|
---|
| 1188 | cmbCorr* corr = im.next();
|
---|
[6157] | 1189 | QString prn = corr->_prn;
|
---|
[3489] | 1190 | if (numCorr[prn] < 2) {
|
---|
[3556] | 1191 | delete corr;
|
---|
[3489] | 1192 | im.remove();
|
---|
| 1193 | }
|
---|
| 1194 | else if (corr == maxDiff[prn]) {
|
---|
[6157] | 1195 | double norm = corr->_diffRao.norm_Frobenius();
|
---|
[3488] | 1196 | if (norm > MAX_DISPLACEMENT) {
|
---|
[3497] | 1197 | out << _resTime.datestr().c_str() << " "
|
---|
| 1198 | << _resTime.timestr().c_str() << " "
|
---|
[7297] | 1199 | << "Orbit Outlier: "
|
---|
| 1200 | << corr->_acName.toAscii().data() << " "
|
---|
[6963] | 1201 | << prn.mid(0,3).toAscii().data() << " "
|
---|
[7297] | 1202 | << corr->_iod << " "
|
---|
[6157] | 1203 | << norm << endl;
|
---|
[3556] | 1204 | delete corr;
|
---|
[3488] | 1205 | im.remove();
|
---|
| 1206 | removed = true;
|
---|
| 1207 | }
|
---|
| 1208 | }
|
---|
[3487] | 1209 | }
|
---|
[7297] | 1210 |
|
---|
[3488] | 1211 | if (!removed) {
|
---|
| 1212 | break;
|
---|
| 1213 | }
|
---|
[3487] | 1214 | }
|
---|
| 1215 |
|
---|
| 1216 | return success;
|
---|
| 1217 | }
|
---|
[3588] | 1218 |
|
---|
[7297] | 1219 | //
|
---|
[3588] | 1220 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5583] | 1221 | void bncComb::slotProviderIDChanged(QString mountPoint) {
|
---|
| 1222 | QMutexLocker locker(&_mutex);
|
---|
| 1223 |
|
---|
[8066] | 1224 | QTextStream out(&_log, QIODevice::WriteOnly);
|
---|
| 1225 |
|
---|
[5583] | 1226 | // Find the AC Name
|
---|
| 1227 | // ----------------
|
---|
| 1228 | QString acName;
|
---|
| 1229 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 1230 | while (icAC.hasNext()) {
|
---|
| 1231 | cmbAC* AC = icAC.next();
|
---|
| 1232 | if (AC->mountPoint == mountPoint) {
|
---|
| 1233 | acName = AC->name;
|
---|
[8066] | 1234 | out << "Provider ID changed: AC " << AC->name.toAscii().data() << " "
|
---|
| 1235 | << _resTime.datestr().c_str() << " "
|
---|
| 1236 | << _resTime.timestr().c_str() << endl;
|
---|
[5583] | 1237 | break;
|
---|
| 1238 | }
|
---|
| 1239 | }
|
---|
| 1240 | if (acName.isEmpty()) {
|
---|
| 1241 | return;
|
---|
| 1242 | }
|
---|
| 1243 |
|
---|
| 1244 | // Remove all corrections of the corresponding AC
|
---|
| 1245 | // ----------------------------------------------
|
---|
| 1246 | QListIterator<bncTime> itTime(_buffer.keys());
|
---|
| 1247 | while (itTime.hasNext()) {
|
---|
| 1248 | bncTime epoTime = itTime.next();
|
---|
| 1249 | QVector<cmbCorr*>& corrVec = _buffer[epoTime].corrs;
|
---|
[5584] | 1250 | QMutableVectorIterator<cmbCorr*> it(corrVec);
|
---|
[5583] | 1251 | while (it.hasNext()) {
|
---|
| 1252 | cmbCorr* corr = it.next();
|
---|
[6157] | 1253 | if (acName == corr->_acName) {
|
---|
[5584] | 1254 | delete corr;
|
---|
| 1255 | it.remove();
|
---|
[5583] | 1256 | }
|
---|
| 1257 | }
|
---|
| 1258 | }
|
---|
[5585] | 1259 |
|
---|
| 1260 | // Reset Satellite Offsets
|
---|
| 1261 | // -----------------------
|
---|
| 1262 | if (_method == filter) {
|
---|
| 1263 | for (int iPar = 1; iPar <= _params.size(); iPar++) {
|
---|
| 1264 | cmbParam* pp = _params[iPar-1];
|
---|
| 1265 | if (pp->AC == acName && pp->type == cmbParam::offACSat) {
|
---|
| 1266 | pp->xx = 0.0;
|
---|
| 1267 | _QQ.Row(iPar) = 0.0;
|
---|
| 1268 | _QQ.Column(iPar) = 0.0;
|
---|
| 1269 | _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
| 1270 | }
|
---|
| 1271 | }
|
---|
| 1272 | }
|
---|
[5583] | 1273 | }
|
---|