Ignore:
Timestamp:
Sep 14, 2014, 10:53:36 AM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/combination/bnccomb.cpp

    r6156 r6157  
    357357    // ---------------------
    358358    cmbCorr* newCorr  = new cmbCorr();
    359     newCorr->_prn     = clkCorr._prn;
     359    newCorr->_prn     = prn;
    360360    newCorr->_time    = clkCorr._time;
    361361    newCorr->_iod     = clkCorr._iod;
     
    490490    while (itCorr.hasNext()) {
    491491      cmbCorr* corr = itCorr.next();
    492       if (corr->acName == AC->name) {
     492      if (corr->_acName == AC->name) {
    493493        AC->numObs += 1;
    494494        if (AC->name == _masterOrbitAC) {
     
    532532  }
    533533
    534   QMap<QString, t_corr*> resCorr;
     534  QMap<QString, cmbCorr*> resCorr;
    535535
    536536  // Perform the actual Combination using selected Method
     
    553553      if (pp->type == cmbParam::clkSat) {
    554554        if (resCorr.find(pp->prn) != resCorr.end()) {
    555           resCorr[pp->prn]->dClk = pp->xx / t_CST::c;
     555          resCorr[pp->prn]->_dClk = pp->xx / t_CST::c;
    556556        }
    557557      }
     
    578578////////////////////////////////////////////////////////////////////////////
    579579t_irc bncComb::processEpoch_filter(QTextStream& out,
    580                                    QMap<QString, t_corr*>& resCorr,
     580                                   QMap<QString, cmbCorr*>& resCorr,
    581581                                   ColumnVector& dx) {
    582582
     
    628628    out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
    629629        << " Maximum Residuum " << maxRes << ' '
    630         << corrs()[maxResIndex-1]->acName << ' ' << corrs()[maxResIndex-1]->prn;
     630        << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn;
    631631
    632632    if (maxRes > _MAXRES) {
     
    634634        cmbParam* pp = _params[iPar-1];
    635635        if (pp->type == cmbParam::offACSat            &&
    636             pp->AC   == corrs()[maxResIndex-1]->acName &&
    637             pp->prn  == corrs()[maxResIndex-1]->prn) {
     636            pp->AC   == corrs()[maxResIndex-1]->_acName &&
     637            pp->prn  == corrs()[maxResIndex-1]->_prn) {
    638638          QQ_sav.Row(iPar)    = 0.0;
    639639          QQ_sav.Column(iPar) = 0.0;
     
    658658////////////////////////////////////////////////////////////////////////////
    659659void bncComb::printResults(QTextStream& out,
    660                            const QMap<QString, t_corr*>& resCorr) {
    661 
    662   QMapIterator<QString, t_corr*> it(resCorr);
     660                           const QMap<QString, cmbCorr*>& resCorr) {
     661
     662  QMapIterator<QString, cmbCorr*> it(resCorr);
    663663  while (it.hasNext()) {
    664664    it.next();
    665     t_corr* corr = it.value();
    666     const t_eph* eph = corr->eph;
     665    cmbCorr* corr = it.value();
     666    const t_eph* eph = corr->_eph;
    667667    if (eph) {
    668668      ColumnVector xc(4);
     
    673673          << _resTime.timestr().c_str() << " ";
    674674      out.setFieldWidth(3);
    675       out << "Full Clock " << corr->prn << " " << corr->iod << " ";
     675      out << "Full Clock " << corr->_prn << " " << corr->_iod << " ";
    676676      out.setFieldWidth(14);
    677       out << (xc(4) + corr->dClk) * t_CST::c << endl;
     677      out << (xc(4) + corr->_dClk) * t_CST::c << endl;
    678678      out.setFieldWidth(0);
    679679    }
     
    686686// Send results to RTNet Decoder and directly to PPP Client
    687687////////////////////////////////////////////////////////////////////////////
    688 void bncComb::dumpResults(const QMap<QString, t_corr*>& resCorr) {
     688void bncComb::dumpResults(const QMap<QString, cmbCorr*>& resCorr) {
    689689
    690690  QString     outLines;
     
    699699                   year, month, day, hour, minute, sec);
    700700
    701   QMapIterator<QString, t_corr*> it(resCorr);
     701  QMapIterator<QString, cmbCorr*> it(resCorr);
    702702  while (it.hasNext()) {
    703703    it.next();
    704     t_corr* corr = it.value();
     704    cmbCorr* corr = it.value();
    705705
    706706    ColumnVector xc(4);
    707707    ColumnVector vv(3);
    708     corr->eph->getCrd(_resTime, xc, vv, false);
     708    corr->_eph->getCrd(_resTime, xc, vv, false);
    709709   
    710710    // Correction Phase Center --> CoM
     
    713713    if (_antex) {
    714714      double Mjd = _resTime.mjd() + _resTime.daysec()/86400.0;
    715       if (_antex->satCoMcorrection(corr->prn, Mjd, xc.Rows(1,3), dx) != success) {
     715      if (_antex->satCoMcorrection(corr->_prn, Mjd, xc.Rows(1,3), dx) != success) {
    716716        dx = 0;
    717         cout << "antenna not found " << corr->prn.toAscii().data() << endl;
    718       }
    719     }
    720    
    721     outLines += corr->prn;
     717        cout << "antenna not found " << corr->_prn.toAscii().data() << endl;
     718      }
     719    }
     720   
     721    outLines += corr->_prn;
    722722    QString hlp;
    723723    hlp.sprintf(" APC 3 %15.4f %15.4f %15.4f"
     
    740740                 "   %10.5f INTERNAL",
    741741                 messageType, updateInt, _resTime.gpsw(), _resTime.gpssec(),
    742                  corr->prn.toAscii().data(),
    743                  corr->iod,
    744                  corr->dClk * t_CST::c,
    745                  corr->rao[0],
    746                  corr->rao[1],
    747                  corr->rao[2],
    748                  corr->dotDClk * t_CST::c,
    749                  corr->dotRao[0],
    750                  corr->dotRao[1],
    751                  corr->dotRao[2],
    752                  corr->dotDotDClk * t_CST::c);
     742                 corr->_prn.toAscii().data(),
     743                 corr->_iod,
     744                 corr->_dClk * t_CST::c,
     745                 corr->_orbCorr->_xr[0],
     746                 corr->_orbCorr->_xr[1],
     747                 corr->_orbCorr->_xr[2],
     748                 0.0,
     749                 corr->_orbCorr->_dotXr[0],
     750                 corr->_orbCorr->_dotXr[1],
     751                 corr->_orbCorr->_dotXr[2],
     752                 0.0);
    753753    corrLines << line;
    754754
     
    767767  // Send new Corrections to PPP etc.
    768768  // --------------------------------
    769   emit newCorrections(corrLines);
     769  ////  emit newCorrections(corrLines);
    770770}
    771771
     
    774774t_irc bncComb::createAmat(Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
    775775                          const ColumnVector& x0,
    776                           QMap<QString, t_corr*>& resCorr) {
     776                          QMap<QString, cmbCorr*>& resCorr) {
    777777
    778778  unsigned nPar = _params.size();
     
    799799  while (itCorr.hasNext()) {
    800800    cmbCorr* corr = itCorr.next();
    801     QString  prn  = corr->prn;
     801    QString  prn  = corr->_prn;
    802802
    803803    ++iObs;
    804804
    805     if (corr->acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
    806       resCorr[prn] = new t_corr(*corr);
     805    if (corr->_acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
     806      resCorr[prn] = new cmbCorr(*corr);
    807807    }
    808808
    809809    for (int iPar = 1; iPar <= _params.size(); iPar++) {
    810810      cmbParam* pp = _params[iPar-1];
    811       AA(iObs, iPar) = pp->partial(corr->acName, prn);
    812     }
    813 
    814     ll(iObs) = corr->dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
     811      AA(iObs, iPar) = pp->partial(corr->_acName, prn);
     812    }
     813
     814    ll(iObs) = corr->_dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
    815815  }
    816816
     
    864864////////////////////////////////////////////////////////////////////////////
    865865t_irc bncComb::processEpoch_singleEpoch(QTextStream& out,
    866                                         QMap<QString, t_corr*>& resCorr,
     866                                        QMap<QString, cmbCorr*>& resCorr,
    867867                                        ColumnVector& dx) {
    868868
     
    882882    while (it.hasNext()) {
    883883      cmbCorr* corr = it.next();
    884       QString  prn  = corr->prn;
     884      QString  prn  = corr->_prn;
    885885      bool foundMaster = false;
    886886      QVectorIterator<cmbCorr*> itHlp(corrs());
    887887      while (itHlp.hasNext()) {
    888888        cmbCorr* corrHlp = itHlp.next();
    889         QString  prnHlp  = corrHlp->prn;
    890         QString  ACHlp   = corrHlp->acName;
     889        QString  prnHlp  = corrHlp->_prn;
     890        QString  ACHlp   = corrHlp->_acName;
    891891        if (ACHlp == _masterOrbitAC && prn == prnHlp) {
    892892          foundMaster = true;
     
    907907    while (itCorr.hasNext()) {
    908908      cmbCorr* corr = itCorr.next();
    909       QString  prn  = corr->prn;
    910       QString  AC   = corr->acName;
     909      QString  prn  = corr->_prn;
     910      QString  AC   = corr->_acName;
    911911      if (numObsPrn.find(prn) == numObsPrn.end()) {
    912912        numObsPrn[prn]  = 1;
     
    990990    out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
    991991        << " Maximum Residuum " << maxRes << ' '
    992         << corrs()[maxResIndex-1]->acName << ' ' << corrs()[maxResIndex-1]->prn;
     992        << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn;
    993993
    994994    if (maxRes > _MAXRES) {
     
    10051005        out << _resTime.datestr().c_str() << ' '
    10061006            << _resTime.timestr().c_str() << " "
    1007             << corr->acName << ' ' << corr->prn;
     1007            << corr->_acName << ' ' << corr->_prn;
    10081008        out.setFieldWidth(6);
    1009         out << " dClk = " << corr->dClk * t_CST::c << " res = " << vv[ii] << endl;
     1009        out << " dClk = " << corr->_dClk * t_CST::c << " res = " << vv[ii] << endl;
    10101010        out.setFieldWidth(0);
    10111011      }
     
    10291029  while (im.hasNext()) {
    10301030    cmbCorr* corr = im.next();
    1031     QString  prn  = corr->prn;
     1031    QString  prn  = corr->_prn;
    10321032    if      (_eph.find(prn) == _eph.end()) {
    1033       out << "checkOrbit: missing eph (not found) " << corr->prn << endl;
     1033      out << "checkOrbit: missing eph (not found) " << corr->_prn << endl;
    10341034      delete corr;
    10351035      im.remove();
    10361036    }
    1037     else if (corr->eph == 0) {
    1038       out << "checkOrbit: missing eph (zero) " << corr->prn << endl;
     1037    else if (corr->_eph == 0) {
     1038      out << "checkOrbit: missing eph (zero) " << corr->_prn << endl;
    10391039      delete corr;
    10401040      im.remove();
    10411041    }
    10421042    else {
    1043       if ( corr->eph == _eph[prn]->last || corr->eph == _eph[prn]->prev ) {
     1043      if ( corr->_eph == _eph[prn]->last || corr->_eph == _eph[prn]->prev ) {
    10441044        switchToLastEph(_eph[prn]->last, corr);
    10451045      }
    10461046      else {
    1047         out << "checkOrbit: missing eph (deleted) " << corr->prn << endl;
     1047        out << "checkOrbit: missing eph (deleted) " << corr->_prn << endl;
    10481048        delete corr;
    10491049        im.remove();
     
    10611061    while (it.hasNext()) {
    10621062      cmbCorr* corr = it.next();
    1063       QString  prn  = corr->prn;
     1063      QString  prn  = corr->_prn;
    10641064      if (meanRao.find(prn) == meanRao.end()) {
    10651065        meanRao[prn].ReSize(4);
    1066         meanRao[prn].Rows(1,3) = corr->rao;
     1066        meanRao[prn].Rows(1,3) = corr->_orbCorr->_xr;
    10671067        meanRao[prn](4)        = 1;
    10681068      }
    10691069      else {
    1070         meanRao[prn].Rows(1,3) += corr->rao;
     1070        meanRao[prn].Rows(1,3) += corr->_orbCorr->_xr;
    10711071        meanRao[prn](4)        += 1;
    10721072      }
     
    10851085    while (it.hasNext()) {
    10861086      cmbCorr* corr = it.next();
    1087       QString  prn  = corr->prn;
     1087      QString  prn  = corr->_prn;
    10881088      if (meanRao[prn](4) != 0) {
    10891089        meanRao[prn] /= meanRao[prn](4);
    10901090        meanRao[prn](4) = 0;
    10911091      }
    1092       corr->diffRao = corr->rao - meanRao[prn].Rows(1,3);
     1092      corr->_diffRao = corr->_orbCorr->_xr - meanRao[prn].Rows(1,3);
    10931093      if (maxDiff.find(prn) == maxDiff.end()) {
    10941094        maxDiff[prn] = corr;
    10951095      }
    10961096      else {
    1097         double normMax = maxDiff[prn]->diffRao.norm_Frobenius();
    1098         double norm    = corr->diffRao.norm_Frobenius();
     1097        double normMax = maxDiff[prn]->_diffRao.norm_Frobenius();
     1098        double norm    = corr->_diffRao.norm_Frobenius();
    10991099        if (norm > normMax) {
    11001100          maxDiff[prn] = corr;
     
    11131113    while (im.hasNext()) {
    11141114      cmbCorr* corr = im.next();
    1115       QString  prn  = corr->prn;
     1115      QString  prn  = corr->_prn;
    11161116      if      (numCorr[prn] < 2) {
    11171117        delete corr;
     
    11191119      }
    11201120      else if (corr == maxDiff[prn]) {
    1121         double norm = corr->diffRao.norm_Frobenius();
     1121        double norm = corr->_diffRao.norm_Frobenius();
    11221122        if (norm > MAX_DISPLACEMENT) {
    11231123          out << _resTime.datestr().c_str()    << " "
    11241124              << _resTime.timestr().c_str()    << " "
    11251125              << "Orbit Outlier: "
    1126               << corr->acName.toAscii().data() << " "
    1127               << prn.toAscii().data()          << " "
    1128               << corr->iod                     << " "
    1129               << norm                          << endl;
     1126              << corr->_acName.toAscii().data() << " "
     1127              << prn.toAscii().data()           << " "
     1128              << corr->_iod                     << " "
     1129              << norm                           << endl;
    11301130          delete corr;
    11311131          im.remove();
     
    11391139    }
    11401140  }
    1141 
    1142   return success;
    1143 }
    1144 
    1145 //
    1146 ////////////////////////////////////////////////////////////////////////////
    1147 t_irc bncComb::mergeOrbitCorr(const cmbCorr* orbitCorr, cmbCorr* clkCorr) {
    1148 
    1149   clkCorr->iod       = orbitCorr->iod; // is it always correct?
    1150   clkCorr->eph       = orbitCorr->eph;
    1151   clkCorr->tRao      = orbitCorr->tRao;
    1152   clkCorr->rao       = orbitCorr->rao;
    1153   clkCorr->dotRao    = orbitCorr->dotRao;
    11541141
    11551142  return success;
     
    11851172    while (it.hasNext()) {
    11861173      cmbCorr* corr = it.next();
    1187       if (acName == corr->acName) {
     1174      if (acName == corr->_acName) {
    11881175        delete corr;
    11891176        it.remove();
Note: See TracChangeset for help on using the changeset viewer.