- Timestamp:
- Dec 5, 2009, 3:01:36 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2079 r2080 56 56 const double sig_crd_p = 100.0; 57 57 const double sig_clk_0 = 1000.0; 58 const double sig_amb_0 = 100.0; 58 59 59 60 // Constructor 60 61 //////////////////////////////////////////////////////////////////////////// 61 bncParam::bncParam(bncParam::parType typeIn, int indexIn) { 62 type = typeIn; 63 index = indexIn; 64 x0 = 0.0; 65 xx = 0.0; 62 bncParam::bncParam(bncParam::parType typeIn, int indexIn, 63 const QString& prnIn) { 64 type = typeIn; 65 index = indexIn; 66 prn = prnIn; 67 index_old = 0; 68 x0 = 0.0; 69 xx = 0.0; 66 70 } 67 71 … … 73 77 // Partial 74 78 //////////////////////////////////////////////////////////////////////////// 75 double bncParam::partial P3(t_satData* satData) {79 double bncParam::partial(t_satData* satData, const QString& prnIn) { 76 80 if (type == CRD_X) { 77 81 return (x0 - satData->xx(1)) / satData->rho; … … 86 90 return 1.0; 87 91 } 92 else if (type == AMB_L3) { 93 if (prnIn == prn) { 94 return 1.0; 95 } 96 else { 97 return 0.0; 98 } 99 } 88 100 return 0.0; 89 101 } … … 93 105 bncModel::bncModel() { 94 106 _xcBanc.ReSize(4); _xcBanc = 0.0; 95 _params.push_back(new bncParam(bncParam::CRD_X, 1 ));96 _params.push_back(new bncParam(bncParam::CRD_Y, 2 ));97 _params.push_back(new bncParam(bncParam::CRD_Z, 3 ));98 _params.push_back(new bncParam(bncParam::RECCLK, 4 ));107 _params.push_back(new bncParam(bncParam::CRD_X, 1, "")); 108 _params.push_back(new bncParam(bncParam::CRD_Y, 2, "")); 109 _params.push_back(new bncParam(bncParam::CRD_Z, 3, "")); 110 _params.push_back(new bncParam(bncParam::RECCLK, 4, "")); 99 111 _ellBanc.ReSize(3); 100 112 … … 184 196 // Computed Value 185 197 //////////////////////////////////////////////////////////////////////////// 186 double bncModel::cmpValue P3(t_satData* satData) {198 double bncModel::cmpValue(t_satData* satData) { 187 199 188 200 ColumnVector xRec(3); … … 240 252 // Prediction Step of the Filter 241 253 //////////////////////////////////////////////////////////////////////////// 242 void bncModel::predict() { 254 void bncModel::predict(t_epoData* epoData) { 255 256 // Make a copy of QQ and xx, set parameter indices 257 // ----------------------------------------------- 258 SymmetricMatrix QQ_old = _QQ; 259 ColumnVector xx_old = _xx; 260 261 for (int iPar = 1; iPar <= _params.size(); iPar++) { 262 _params[iPar-1]->index_old = _params[iPar-1]->index; 263 _params[iPar-1]->index = 0; 264 } 265 266 // Remove Ambiguity Parameters without observations 267 // ------------------------------------------------ 268 int iPar = 0; 269 QMutableVectorIterator<bncParam*> it(_params); 270 while (it.hasNext()) { 271 bncParam* par = it.next(); 272 bool removed = false; 273 if (par->type == bncParam::AMB_L3) { 274 if (epoData->satData.find(par->prn) == epoData->satData.end()) { 275 removed = true; 276 delete par; 277 it.remove(); 278 } 279 } 280 if (! removed) { 281 ++iPar; 282 par->index = iPar; 283 } 284 } 285 286 // Add new ambiguity parameters 287 // ---------------------------- 288 QMapIterator<QString, t_satData*> itObs(epoData->satData); 289 while (itObs.hasNext()) { 290 itObs.next(); 291 QString prn = itObs.key(); 292 bool found = false; 293 for (int iPar = 1; iPar <= _params.size(); iPar++) { 294 if (_params[iPar-1]->type == bncParam::AMB_L3 && 295 _params[iPar-1]->prn == prn) { 296 found = true; 297 break; 298 } 299 } 300 if (!found) { 301 bncParam* par = new bncParam(bncParam::AMB_L3, _params.size()+1, prn); 302 _params.push_back(par); 303 } 304 } 305 306 int nPar = _params.size(); 307 _xx.ReSize(nPar); _xx = 0.0; 308 _QQ.ReSize(nPar); _QQ = 0.0; 309 for (int i1 = 1; i1 <= nPar; i1++) { 310 bncParam* p1 = _params[i1-1]; 311 if (p1->index_old != 0) { 312 _xx(p1->index) = xx_old(p1->index_old); 313 _QQ(p1->index, p1->index) = QQ_old(p1->index_old, p1->index_old); 314 for (int i2 = 1; i2 <= nPar; i2++) { 315 bncParam* p2 = _params[i2-1]; 316 if (p2->index_old != 0) { 317 _QQ(p1->index, p2->index) = QQ_old(p1->index_old, p2->index_old); 318 } 319 } 320 } 321 } 322 323 for (int ii = 1; ii <= nPar; ii++) { 324 bncParam* par = _params[ii-1]; 325 if (par->index_old == 0) { 326 _QQ(par->index, par->index) = sig_amb_0 * sig_amb_0; 327 } 328 par->index_old = par->index; 329 } 243 330 244 331 // Coordinates … … 274 361 _QQ(4,4) = sig_clk_0 * sig_clk_0; 275 362 363 // Ambiguities 364 // ----------- 365 for (int iPar = 1; iPar <= _params.size(); iPar++) { 366 if (_params[iPar-1]->type == bncParam::AMB_L3) { 367 _params[iPar-1]->x0 += _params[iPar-1]->xx; 368 } 369 } 370 276 371 // Nullify the Solution Vector 277 372 // --------------------------- … … 290 385 } 291 386 292 predict( );387 predict(epoData); 293 388 294 389 unsigned nPar = _params.size(); 295 unsigned nObs = epoData->size();390 unsigned nObs = 2 * epoData->size(); 296 391 297 392 // Create First-Design Matrix … … 307 402 QString prn = itObs.key(); 308 403 t_satData* satData = itObs.value(); 309 ll(iObs) = satData->P3 - cmpValueP3(satData); 310 404 405 double rhoCmp = cmpValue(satData); 406 407 ll(iObs) = satData->P3 - rhoCmp; 311 408 for (int iPar = 1; iPar <= _params.size(); iPar++) { 312 AA(iObs, iPar) = _params[iPar-1]->partialP3(satData); 409 AA(iObs, iPar) = _params[iPar-1]->partial(satData, ""); 410 } 411 412 ++iObs; 413 ll(iObs) = satData->L3 - rhoCmp; 414 for (int iPar = 1; iPar <= _params.size(); iPar++) { 415 if (_params[iPar-1]->type == bncParam::AMB_L3 && 416 _params[iPar-1]->prn == prn) { 417 ll(iObs) -= _params[iPar-1]->x0; 418 } 419 AA(iObs, iPar) = _params[iPar-1]->partial(satData, prn); 313 420 } 314 421 } -
trunk/BNC/bncmodel.h
r2076 r2080 37 37 public: 38 38 enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK, TROPO, AMB_L3}; 39 bncParam(parType typeIn, int indexIn );39 bncParam(parType typeIn, int indexIn, const QString& prn); 40 40 ~bncParam(); 41 double partial P3(t_satData* satData);41 double partial(t_satData* satData, const QString& prnIn); 42 42 bool isCrd() const { 43 43 return (type == CRD_X || type == CRD_Y || type == CRD_Z); … … 49 49 double x0; 50 50 int index; 51 int index_old; 52 QString prn; 51 53 }; 52 54 … … 63 65 64 66 private: 65 double cmpValue P3(t_satData* satData);67 double cmpValue(t_satData* satData); 66 68 double delay_saast(double Ele); 67 void predict( );69 void predict(t_epoData* epoData); 68 70 69 71 QVector<bncParam*> _params;
Note:
See TracChangeset
for help on using the changeset viewer.