Changeset 5747 in ntrip for trunk/BNC


Ignore:
Timestamp:
Aug 2, 2014, 4:59:06 PM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/PPP
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/filter.cpp

    r5743 r5747  
    77#include "filter.h"
    88#include "parlist.h"
    9 #include "ambres.h"
    109#include "obspool.h"
    11 #include "kalman.h"
    1210#include "station.h"
     11#include "pppClient.h"
    1312
    1413using namespace BNC;
     
    3130t_irc t_filter::processEpoch(t_obsPool* obsPool) {
    3231
    33   _ambFixRate = 0.0;
    3432  _numSat     = 0;
    3533
     
    4240  t_obsPool::t_epoch* epoch = obsPool->lastEpoch();
    4341  if (!epoch) {
    44     return t_irc::failure;
     42    return failure;
    4543  }
    4644  vector<t_satObs*>& obsVector = epoch->obsVector();
     
    113111    const vector<t_lc::type>& LCsHlp = (ipc == 0 ? LCsCode : LCsPhase);
    114112    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;
    207122}
    208123
     
    216131  // Detect Cycle Slips
    217132  // ------------------
    218   if (detectCycleSlips(LCs, obsVector) != t_irc::success) {
    219     return t_irc::failure;
     133  if (detectCycleSlips(LCs, obsVector) != success) {
     134    return failure;
    220135  }
    221136
     
    280195    // -----------------------------------------------
    281196    if (iObs+1 < OPT->minobs()) {
    282       return t_irc::failure;
     197      return failure;
    283198    }
    284199    AA = AA.Rows(1, iObs+1);
     
    361276  }
    362277
    363   return t_irc::success;
     278  return success;
    364279}
    365280
     
    430345  }
    431346
    432   return t_irc::success;
     347  return success;
    433348}
    434349
     
    437352t_irc t_filter::resetAmb(t_prn prn, const vector<t_satObs*>& obsVector,
    438353                         SymmetricMatrix* QSav, ColumnVector* xSav) {
    439   t_irc irc = t_irc::failure;
     354  t_irc irc = failure;
    440355  vector<t_param*>& params = _parlist->params();
    441356  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     
    463378      }
    464379      _x0[ind] = par->x0();
    465       irc = t_irc::success;
     380      irc = success;
    466381    }
    467382  }
  • trunk/BNC/src/PPP/obspool.cpp

    r5743 r5747  
    4646// Constructor
    4747/////////////////////////////////////////////////////////////////////////////
    48 t_obsPool::t_epoch::t_epoch(const t_time& epoTime, vector<t_satObs*>& obsVector) {
     48t_obsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
    4949  _epoTime   = epoTime;
    5050  for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     
    9292//
    9393/////////////////////////////////////////////////////////////////////////////
    94 void t_obsPool::putEpoch(const t_time& epoTime, vector<t_satObs*>& obsVector) {
     94void t_obsPool::putEpoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
    9595  const unsigned MAXSIZE = 2;
    9696  _epochs.push_back(new t_epoch(epoTime, obsVector));
  • trunk/BNC/src/PPP/ppp.h

    r5744 r5747  
    33
    44#include <string>
     5#include <vector>
    56
    67#include "bncconst.h"
  • trunk/BNC/src/PPP/windup.h

    r5743 r5747  
    66
    77#include "ppp.h"
    8 #include "bncTime.h"
     8#include "bnctime.h"
    99
    1010namespace BNC {
Note: See TracChangeset for help on using the changeset viewer.