Changeset 3032 in ntrip


Ignore:
Timestamp:
Feb 24, 2011, 6:12:38 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncephuser.h

    r3029 r3032  
    6969  bool         dClkSet;
    7070  const t_eph* eph;
    71   QString      AC;
    7271};
    7372
  • trunk/BNC/combination/bnccomb.cpp

    r3031 r3032  
    3030// Constructor
    3131////////////////////////////////////////////////////////////////////////////
    32 cmbParam::cmbParam(cmbParam::parType typeIn, int indexIn,
    33                    const QString& acIn, const QString& prnIn) {
    34   type  = typeIn;
    35   index = indexIn;
    36   AC    = acIn;
    37   prn   = prnIn;
     32cmbParam::cmbParam(cmbParam::parType type_, int index_,
     33                   const QString& ac_, const QString& prn_,
     34                   double sig_0_, double sig_P_) {
     35
     36  type  = type_;
     37  index = index_;
     38  AC    = ac_;
     39  prn   = prn_;
     40  sig_0 = sig_0_;
     41  sig_P = sig_P_;
    3842  xx    = 0.0;
    39   iod   = -1;
    4043}
    4144
     
    4750// Partial
    4851////////////////////////////////////////////////////////////////////////////
    49 double cmbParam::partial(const QString& acIn, t_corr* corr) {
     52double cmbParam::partial(const QString& AC_, t_corr* corr) {
    5053 
    5154  if      (type == AC_offset) {
    52     if (AC == acIn) {
     55    if (AC == AC_) {
    5356      return 1.0;
    5457    }
    5558  }
    5659  else if (type == Sat_offset) {
    57     if (AC == acIn && prn == corr->prn) {
     60    if (AC == AC_ && prn == corr->prn) {
    5861      return 1.0;
    5962    }
     
    9497
    9598  QStringList combineStreams = settings.value("combineStreams").toStringList();
     99
     100  _masterAC = "BKG"; // TODO: make it an option
    96101
    97102  if (combineStreams.size() >= 2) {
     
    112117          ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
    113118
    114   // Initialize Parameters
    115   // ---------------------
     119
     120  // A Priori Sigmas (in Meters)
     121  // ---------------------------
     122  double sigAC_0  = 100.0;
     123  double sigAC_P  = 100.0;
     124  double sigSat_0 = 100.0;
     125  double sigSat_P =   0.0;
     126  double sigClk_0 = 100.0;
     127  double sigClk_P = 100.0;
     128
     129  // Initialize Parameters (model: Clk_Corr = AC_Offset + Sat_Offset + Clk)
     130  // ----------------------------------------------------------------------
    116131  int nextPar = 0;
    117132  QMapIterator<QString, cmbAC*> it(_ACs);
    118   it.next(); // skip first AC
    119133  while (it.hasNext()) {
    120134    it.next();
    121135    cmbAC* AC = it.value();
    122     _params.push_back(new cmbParam(cmbParam::AC_offset, ++nextPar, AC->name, ""));
    123   }
    124   it.toFront();
    125   it.next();
    126   while (it.hasNext()) {
    127     it.next();
    128     cmbAC* AC = it.value();
    129     for (int iGps = 1; iGps <= 32; iGps++) {
    130       QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    131       _params.push_back(new cmbParam(cmbParam::Sat_offset, ++nextPar, AC->name, prn));
     136    if (AC->name != _masterAC) {
     137      _params.push_back(new cmbParam(cmbParam::AC_offset, ++nextPar,
     138                                     AC->name, "", sigAC_0, sigAC_P));
     139      for (int iGps = 1; iGps <= 32; iGps++) {
     140        QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
     141        _params.push_back(new cmbParam(cmbParam::Sat_offset, ++nextPar,
     142                                       AC->name, prn, sigSat_0, sigSat_P));
     143      }
    132144    }
    133145  }
    134146  for (int iGps = 1; iGps <= 32; iGps++) {
    135147    QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    136     _params.push_back(new cmbParam(cmbParam::clk, ++nextPar, "", prn));
    137   }
    138 
    139   unsigned nPar = _params.size();
    140   _QQ.ReSize(nPar);
     148    _params.push_back(new cmbParam(cmbParam::clk, ++nextPar, "", prn,
     149                                   sigClk_0, sigClk_P));
     150  }
     151
     152  // Initialize Variance-Covariance Matrix
     153  // -------------------------------------
     154  _QQ.ReSize(_params.size());
    141155  _QQ = 0.0;
    142 
    143   // Clk_Corr = AC_Offset + Sat_Offset + Clk
    144   // ---------------------------------------
    145   _sigACOff  = 100.0; // per analysis center stream and epoch, sigma in meters
    146   _sigSatOff = 100.0; // per analysis center stream and satellite, sigma in meters
    147   _sigClk    = 100.0; // per satellite and epoch, sigma in meters
    148 
    149156  for (int iPar = 1; iPar <= _params.size(); iPar++) {
    150157    cmbParam* pp = _params[iPar-1];
    151     if      (pp->type == cmbParam::AC_offset) {
    152       _QQ(iPar,iPar) = _sigACOff * _sigACOff;
    153     }
    154     else if (pp->type == cmbParam::Sat_offset) {
    155       _QQ(iPar,iPar) = _sigSatOff * _sigSatOff;
    156     }
    157     else if (pp->type == cmbParam::clk) {
    158       _QQ(iPar,iPar) = _sigClk * _sigClk;
    159     }
     158    _QQ(iPar,iPar) = pp->sig_0 * pp->sig_0;
    160159  }
    161160}
     
    192191  }
    193192
    194   newCorr->AC = AC->name;
    195    
    196193  // Reject delayed corrections
    197194  // --------------------------
     
    221218    }
    222219  }
    223    
    224220
    225221  // Process all older Epochs (if there are any)
     
    397393  corr->dotRao += dDotRAO;
    398394  corr->dClk   -= dC;
    399 
    400 //  for (int iPar = 1; iPar <= _params.size(); iPar++) {
    401 //    cmbParam* pp = _params[iPar-1];
    402 //    if (pp->type == cmbParam::Sat_offset           &&
    403 //        pp->prn == corr->prn && pp->AC == corr->AC) {
    404 //      if (pp->iod != corr->iod) {
    405 //        pp->xx  += dC * t_CST::c;
    406 //        pp->iod = corr->iod;
    407 //      }
    408 //    }
    409 //  }
    410395}
    411396
     
    425410  for (int iPar = 1; iPar <= _params.size(); iPar++) {
    426411    cmbParam* pp = _params[iPar-1];
    427     if  (pp->type == cmbParam::AC_offset || pp->type == cmbParam::clk) {
     412    if (pp->sig_P != 0.0) {
    428413      pp->xx = 0.0;
    429414      for (int jj = 1; jj <= _params.size(); jj++) {
    430415        _QQ(iPar, jj) = 0.0;
    431416      }
    432     }
    433     if      (pp->type == cmbParam::AC_offset) {
    434      _QQ(iPar,iPar) = _sigACOff * _sigACOff;
    435     }
    436     else if (pp->type == cmbParam::clk) {
    437      _QQ(iPar,iPar) = _sigClk * _sigClk;
     417      _QQ(iPar,iPar) = pp->sig_P * pp->sig_P;
    438418    }
    439419  }
     
    461441      t_corr* corr = itCorr.value();
    462442
    463       // Switch to new ephemeris
    464       // -----------------------
     443      // Switch to last ephemeris
     444      // ------------------------
    465445      t_eph* lastEph = _eph[corr->prn]->last;
    466446      if (lastEph == corr->eph) {     
     
    495475        t_corr* corr = itCorr.value();
    496476
    497         //// beg test
    498         if (epo->acName == "BKG") {
     477        if (epo->acName == _masterAC) {
    499478          resCorr[corr->prn] = new t_corr(*corr);
    500479        }
    501         //// end test
    502480
    503481        for (int iPar = 1; iPar <= _params.size(); iPar++) {
  • trunk/BNC/combination/bnccomb.h

    r3029 r3032  
    1111 public:
    1212  enum parType {AC_offset, Sat_offset, clk};
    13   cmbParam(parType typeIn, int indexIn,
    14            const QString& acIn, const QString& prnIn);
     13  cmbParam(parType type_, int index_, const QString& ac_,
     14           const QString& prn_, double sig_0_, double sig_P_);
    1515  ~cmbParam();
    16   double partial(const QString& acIn, t_corr* corr);
     16  double partial(const QString& AC_, t_corr* corr);
    1717  QString toString() const;
    1818  parType type;
     
    2121  QString prn;
    2222  double  xx;
    23   int     iod;
     23  double  sig_0;
     24  double  sig_P;
    2425};
    2526
     
    7879  cmbCaster*            _caster;
    7980  QVector<cmbParam*>    _params;
    80   double                _sigACOff;
    81   double                _sigSatOff;
    82   double                _sigClk;
    8381  SymmetricMatrix       _QQ;
    8482  QByteArray            _log;
     83  QString               _masterAC;
    8584};
    8685
Note: See TracChangeset for help on using the changeset viewer.