- Timestamp:
- Aug 2, 2014, 4:59:06 PM (10 years ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/filter.cpp
r5743 r5747 7 7 #include "filter.h" 8 8 #include "parlist.h" 9 #include "ambres.h"10 9 #include "obspool.h" 11 #include "kalman.h"12 10 #include "station.h" 11 #include "pppClient.h" 13 12 14 13 using namespace BNC; … … 31 30 t_irc t_filter::processEpoch(t_obsPool* obsPool) { 32 31 33 _ambFixRate = 0.0;34 32 _numSat = 0; 35 33 … … 42 40 t_obsPool::t_epoch* epoch = obsPool->lastEpoch(); 43 41 if (!epoch) { 44 return t_irc::failure;42 return failure; 45 43 } 46 44 vector<t_satObs*>& obsVector = epoch->obsVector(); … … 113 111 const vector<t_lc::type>& LCsHlp = (ipc == 0 ? LCsCode : LCsPhase); 114 112 if (LCsHlp.size() > 0) { 115 if ( processLC(LCsHlp, obsVector) != t_irc::success ) { 116 return t_irc::failure; 117 } 118 } 119 } 120 121 // Copy Float Solution 122 // ------------------- 123 _QFix = _QFlt; 124 _xFix = _xFlt; 125 126 _ambFixRate = 0.0; 127 128 // Constrain ZD Ambiguities 129 // ------------------------ 130 if (LCsPhase.size() > 0) { 131 Matrix HH(LCsPhase.size(), params.size()); HH = 0.0; 132 ColumnVector hh(LCsPhase.size()); hh = 0.0; 133 DiagonalMatrix Sl(LCsPhase.size()); Sl = 1.e-4; 134 for (unsigned iLC = 0; iLC < LCsPhase.size(); iLC++) { 135 const t_param* ambPar = 0; 136 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 137 const t_param* par = params[iPar]; 138 if (par->type() == t_param::amb && par->tLC() == LCsPhase[iLC] && 139 par->indexOld() != -1 && !par->ambResetCandidate()) { 140 if (ambPar == 0 || ambPar->ambEleSat() < par->ambEleSat()) { 141 ambPar = par; 142 } 143 } 144 } 145 if (ambPar) { 146 HH[iLC][ambPar->indexNew()] = 1.0; 147 hh[iLC] = xFltOld[ambPar->indexOld()]; 148 } 149 } 150 kalman(_QFix, _xFix, HH, hh, Sl); 151 } 152 153 // Ambiguity Resolution 154 // -------------------- 155 if (OPT->ambres()) { 156 if (ambLCs.size() > 1) { 157 t_ambres::ambres(_epoTime, ambLCs, _parlist, _QFix, _xFix, true); 158 } 159 _ambFixRate = t_ambres::ambres(_epoTime, ambLCs, _parlist, _QFix, _xFix, false); 160 161 // Check/Print Fixed Residuals 162 // --------------------------- 163 bool checkResOK = true; 164 string epoTimeStr = string(_epoTime); 165 for (unsigned ii = 0; ii < OPT->LCs().size(); ii++) { 166 const t_lc::type& tLC = OPT->LCs()[ii]; 167 for (unsigned iObs = 0; iObs < obsVector.size(); iObs++) { 168 const t_satObs* obs = obsVector[iObs]; 169 if (obs->isValid() && !obs->outlier()) { 170 ColumnVector AA(params.size()); 171 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 172 const t_param* par = params[iPar]; 173 AA[iPar] = par->partial(_epoTime, obs, tLC); 174 } 175 double ll = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA); 176 double vv = DotProduct(AA, _xFix) - ll; 177 178 bool outlier = false; 179 if (fabs(vv) > (t_lc::includesCode(tLC) ? 1.5 * OPT->maxResCode() : 1.5 * OPT->maxResPhase())) { 180 outlier = true; 181 checkResOK = false; 182 } 183 184 if (OPT->logLevel() > 1) { 185 LOG << epoTimeStr << " XRES " 186 << left << setw(3) << t_lc::toString(tLC) << right << ' ' 187 << obs->prn().toString() << ' ' 188 << setw(8) << setprecision(4) << vv; 189 if (outlier) { 190 LOG << " outlier AR"; 191 } 192 LOG << endl; 193 } 194 } 195 } 196 } 197 if (!checkResOK || _ambFixRate < OPT->ambresMinFixRate()) { 198 _ambFixRate = 0.0; 199 _xFix = _xFlt; 200 _QFix = _QFlt; 201 } 202 } 203 204 _parlist->printResult(_epoTime, _QFix, _xFix, _ambFixRate); 205 206 return t_irc::success; 113 if ( processLC(LCsHlp, obsVector) != success ) { 114 return failure; 115 } 116 } 117 } 118 119 _parlist->printResult(_epoTime, _QFlt, _xFlt, 0); 120 121 return success; 207 122 } 208 123 … … 216 131 // Detect Cycle Slips 217 132 // ------------------ 218 if (detectCycleSlips(LCs, obsVector) != t_irc::success) {219 return t_irc::failure;133 if (detectCycleSlips(LCs, obsVector) != success) { 134 return failure; 220 135 } 221 136 … … 280 195 // ----------------------------------------------- 281 196 if (iObs+1 < OPT->minobs()) { 282 return t_irc::failure;197 return failure; 283 198 } 284 199 AA = AA.Rows(1, iObs+1); … … 361 276 } 362 277 363 return t_irc::success;278 return success; 364 279 } 365 280 … … 430 345 } 431 346 432 return t_irc::success;347 return success; 433 348 } 434 349 … … 437 352 t_irc t_filter::resetAmb(t_prn prn, const vector<t_satObs*>& obsVector, 438 353 SymmetricMatrix* QSav, ColumnVector* xSav) { 439 t_irc irc = t_irc::failure;354 t_irc irc = failure; 440 355 vector<t_param*>& params = _parlist->params(); 441 356 for (unsigned iPar = 0; iPar < params.size(); iPar++) { … … 463 378 } 464 379 _x0[ind] = par->x0(); 465 irc = t_irc::success;380 irc = success; 466 381 } 467 382 } -
trunk/BNC/src/PPP/obspool.cpp
r5743 r5747 46 46 // Constructor 47 47 ///////////////////////////////////////////////////////////////////////////// 48 t_obsPool::t_epoch::t_epoch(const t_time& epoTime, vector<t_satObs*>& obsVector) {48 t_obsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) { 49 49 _epoTime = epoTime; 50 50 for (unsigned ii = 0; ii < obsVector.size(); ii++) { … … 92 92 // 93 93 ///////////////////////////////////////////////////////////////////////////// 94 void t_obsPool::putEpoch(const t_time& epoTime, vector<t_satObs*>& obsVector) {94 void t_obsPool::putEpoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) { 95 95 const unsigned MAXSIZE = 2; 96 96 _epochs.push_back(new t_epoch(epoTime, obsVector)); -
trunk/BNC/src/PPP/ppp.h
r5744 r5747 3 3 4 4 #include <string> 5 #include <vector> 5 6 6 7 #include "bncconst.h" -
trunk/BNC/src/PPP/windup.h
r5743 r5747 6 6 7 7 #include "ppp.h" 8 #include "bnc Time.h"8 #include "bnctime.h" 9 9 10 10 namespace BNC {
Note:
See TracChangeset
for help on using the changeset viewer.