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