Changeset 3308 in ntrip


Ignore:
Timestamp:
Jun 21, 2011, 6:10:42 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmodel.cpp

    r3307 r3308  
    919919// Outlier Detection
    920920////////////////////////////////////////////////////////////////////////////
    921 int bncModel::outlierDetection(const SymmetricMatrix& QQsav,
     921int bncModel::outlierDetection(int phase, const SymmetricMatrix& QQsav,
    922922                               const ColumnVector& vv,
    923923                               QMap<QString, t_satData*>& satDataGPS,
     
    935935  int irc = 0;
    936936
    937   // Check GPS Code
    938   // --------------
    939   if (irc == 0) {
    940     findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
    941     if (maxResCode > MAXRES_CODE_GPS) {
    942       satDataGPS.remove(prnCode);
    943       prnRemoved = prnCode;
    944       maxRes     = maxResCode;
    945       irc        = 1;
    946     }
    947   }
    948 
    949   // Check Galileo Code
    950   // ------------------
    951   if (irc == 0) {
    952     findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
    953     if (maxResCode > MAXRES_CODE_GAL) {
    954       satDataGal.remove(prnCode);
    955       prnRemoved = prnCode;
    956       maxRes     = maxResCode;
    957       irc        = 1;
    958     }
    959   }
    960 
    961   // Check Glonass Phase
    962   // -------------------
    963   if (irc == 0) {
    964     findMaxRes(vv,satDataGlo, prnCode, maxResCode, prnPhase, maxResPhase);
    965     if (maxResPhase > MAXRES_PHASE_GLO) {
    966       satDataGlo.remove(prnPhase);
    967       prnRemoved = prnPhase;
    968       maxRes     = maxResPhase;
    969       irc        = 1;
    970     }
    971   }
    972 
    973   // Check Galileo Phase
    974   // -------------------
    975   if (irc == 0) {
    976     findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
    977     if      (maxResPhase > MAXRES_PHASE_GAL) {
    978       satDataGal.remove(prnPhase);
    979       prnRemoved = prnPhase;
    980       maxRes     = maxResPhase;
    981       irc        = 1;
    982     }
    983   }
    984 
    985   // Check GPS Phase
    986   // ---------------
    987   if (irc == 0) {
    988     findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
    989     if      (maxResPhase > MAXRES_PHASE_GPS) {
    990       satDataGPS.remove(prnPhase);
    991       prnRemoved = prnPhase;
    992       maxRes     = maxResPhase;
    993       irc        = 1;
     937  if (phase == 0) {
     938
     939    // Check GPS Code
     940    // --------------
     941    if (irc == 0) {
     942      findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
     943      if (maxResCode > MAXRES_CODE_GPS) {
     944        satDataGPS.remove(prnCode);
     945        prnRemoved = prnCode;
     946        maxRes     = maxResCode;
     947        irc        = 1;
     948      }
     949    }
     950   
     951    // Check Galileo Code
     952    // ------------------
     953    if (irc == 0) {
     954      findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
     955      if (maxResCode > MAXRES_CODE_GAL) {
     956        satDataGal.remove(prnCode);
     957        prnRemoved = prnCode;
     958        maxRes     = maxResCode;
     959        irc        = 1;
     960      }
     961    }
     962  }
     963
     964  else {
     965    // Check Glonass Phase
     966    // -------------------
     967    if (irc == 0) {
     968      findMaxRes(vv,satDataGlo, prnCode, maxResCode, prnPhase, maxResPhase);
     969      if (maxResPhase > MAXRES_PHASE_GLO) {
     970        satDataGlo.remove(prnPhase);
     971        prnRemoved = prnPhase;
     972        maxRes     = maxResPhase;
     973        irc        = 1;
     974      }
     975    }
     976   
     977    // Check Galileo Phase
     978    // -------------------
     979    if (irc == 0) {
     980      findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
     981      if      (maxResPhase > MAXRES_PHASE_GAL) {
     982        satDataGal.remove(prnPhase);
     983        prnRemoved = prnPhase;
     984        maxRes     = maxResPhase;
     985        irc        = 1;
     986      }
     987    }
     988   
     989    // Check GPS Phase
     990    // ---------------
     991    if (irc == 0) {
     992      findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
     993      if      (maxResPhase > MAXRES_PHASE_GPS) {
     994        satDataGPS.remove(prnPhase);
     995        prnRemoved = prnPhase;
     996        maxRes     = maxResPhase;
     997        irc        = 1;
     998      }
    994999    }
    9951000  }
     
    12121217//
    12131218///////////////////////////////////////////////////////////////////////////
    1214 void bncModel::printRes(const ColumnVector& vv,
     1219void bncModel::printRes(int phase, const ColumnVector& vv,
    12151220                        ostringstream& str, t_satData* satData) {
    1216   if (satData->indexPhase) {
     1221  if (phase) {
    12171222    str << _time.timestr(1)
    12181223        << " RES " << satData->prn.toAscii().data() << "   L3 "
    12191224        << setw(9) << setprecision(4) << vv(satData->indexPhase) << endl;
    12201225  }
    1221   if (satData->indexCode) {
     1226  else {
    12221227    str << _time.timestr(1)
    12231228        << " RES " << satData->prn.toAscii().data() << "   P3 "
     
    12611266  ColumnVector    vv;
    12621267
    1263   for (int iPhase = 0; iPhase <= 1; iPhase++) {
     1268  for (int iPhase = 0; iPhase <= (_usePhase ? 1 : 0); iPhase++) {
    12641269
    12651270    do {
     
    12731278          return failure;
    12741279        }
     1280      }
    12751281     
    1276         // Status Prediction
    1277         // -----------------
    1278         predict(epoData);
    1279       }
     1282      // Status Prediction
     1283      // -----------------
     1284      predict(epoData);
    12801285     
    12811286      // Create First-Design Matrix
     
    12831288      unsigned nPar = _params.size();
    12841289      unsigned nObs = 0;
    1285       nObs = epoData->sizeGPS() + epoData->sizeGal(); // Glonass code not used
     1290      if (iPhase == 0) {
     1291        nObs = epoData->sizeGPS() + epoData->sizeGal(); // Glonass code not used
     1292      }
     1293      else {
     1294        nObs = epoData->sizeGPS() + epoData->sizeGal() + epoData->sizeGlo();
     1295      }
    12861296   
    12871297      Matrix          AA(nObs, nPar);  // first design matrix
     
    13001310      }
    13011311   
     1312      // Glonass
     1313      // -------
     1314      if (iPhase == 1) {
     1315        QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
     1316        while (itGlo.hasNext()) {
     1317          itGlo.next();
     1318          t_satData* satData = itGlo.value();
     1319          addObs(iPhase, iObs, satData, AA, ll, PP);
     1320        }
     1321      }
     1322
    13021323      // Galileo
    13031324      // -------
     
    13161337   
    13171338      vv = ll - AA * dx;
    1318    
     1339
    13191340      // Print Residuals
    13201341      // ---------------
     
    13271348          itGPS.next();
    13281349          t_satData* satData = itGPS.value();
    1329           printRes(vv, str, satData);
    1330         }
    1331         QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
    1332         while (itGlo.hasNext()) {
    1333           itGlo.next();
    1334           t_satData* satData = itGlo.value();
    1335           printRes(vv, str, satData);
     1350          printRes(iPhase, vv, str, satData);
     1351        }
     1352        if (iPhase == 1) {
     1353          QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
     1354          while (itGlo.hasNext()) {
     1355            itGlo.next();
     1356            t_satData* satData = itGlo.value();
     1357            printRes(iPhase, vv, str, satData);
     1358          }
    13361359        }
    13371360        QMapIterator<QString, t_satData*> itGal(epoData->satDataGal);
     
    13391362          itGal.next();
    13401363          t_satData* satData = itGal.value();
    1341           printRes(vv, str, satData);
     1364          printRes(iPhase, vv, str, satData);
    13421365        }
    13431366        _log += str.str().c_str();
    13441367      }
    13451368   
    1346     } while (outlierDetection(QQsav, vv, epoData->satDataGPS,
     1369    } while (outlierDetection(iPhase, QQsav, vv, epoData->satDataGPS,
    13471370                              epoData->satDataGlo, epoData->satDataGal) != 0);
    13481371  }
  • trunk/BNC/bncmodel.h

    r3307 r3308  
    9898  void   addObs(int phase, unsigned& iObs, t_satData* satData,
    9999                Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP);
    100   void   printRes(const ColumnVector& vv,
     100  void   printRes(int phase, const ColumnVector& vv,
    101101                  std::ostringstream& str, t_satData* satData);
    102102  void   findMaxRes(const ColumnVector& vv,
     
    108108  void   predict(t_epoData* epoData);
    109109  t_irc  update_p(t_epoData* epoData, ColumnVector& dx);
    110   int    outlierDetection(const SymmetricMatrix& QQsav,
     110  int    outlierDetection(int phase, const SymmetricMatrix& QQsav,
    111111                          const ColumnVector& vv,
    112112                          QMap<QString, t_satData*>& satDataGPS,
  • trunk/BNC/ppp.gpt

    r3139 r3308  
    2525
    2626set ylabel "meters"
    27 set yrange [-0.5:0.5]
     27set yrange [-1.0:1.0]
    2828
    2929set ytics nomirror
Note: See TracChangeset for help on using the changeset viewer.