Changeset 3488 in ntrip for trunk/BNC


Ignore:
Timestamp:
Oct 31, 2011, 9:02:04 AM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/combination
Files:
2 edited

Legend:

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

    r3487 r3488  
    10001000t_irc bncComb::checkOrbits() {
    10011001
    1002   // Compute Mean Corrections for all Satellites
    1003   // -------------------------------------------
    1004   QMap<QString, ColumnVector> meanRao;
    1005   QVectorIterator<cmbCorr*> itCorr(corrs());
    1006   while (itCorr.hasNext()) {
    1007     cmbCorr* corr = itCorr.next();
    1008     QString  prn  = corr->prn;
    1009     if (meanRao.find(prn) == meanRao.end()) {
    1010       meanRao[prn].ReSize(4);
    1011       meanRao[prn].Rows(1,3) = corr->rao;
    1012       meanRao[prn](4)        = 1;
    1013     }
    1014     else {
    1015       meanRao[prn].Rows(1,3) += corr->rao;
    1016       meanRao[prn](4)        += 1;
    1017     }
    1018     switchToLastEph(_eph[prn]->last, corr);
    1019   }
    1020 
    1021   QMutableVectorIterator<cmbCorr*> it(corrs());
    1022   while (it.hasNext()) {
    1023     cmbCorr* corr = it.next();
    1024     QString  prn  = corr->prn;
    1025     if (meanRao[prn](4) != 0) {
    1026       meanRao[prn] /= meanRao[prn](4);
    1027       meanRao[prn](4) = 0;
    1028     }
    1029     ColumnVector dRao = corr->rao - meanRao[prn].Rows(1,3);
    1030   }
    1031 
     1002  const double MAX_DISPLACEMENT = 0.10;
     1003
     1004  while (true) {
     1005
     1006    // Compute Mean Corrections for all Satellites
     1007    // -------------------------------------------
     1008    QMap<QString, ColumnVector> meanRao;
     1009    QVectorIterator<cmbCorr*> it(corrs());
     1010    while (it.hasNext()) {
     1011      cmbCorr* corr = it.next();
     1012      QString  prn  = corr->prn;
     1013      if (meanRao.find(prn) == meanRao.end()) {
     1014        meanRao[prn].ReSize(4);
     1015        meanRao[prn].Rows(1,3) = corr->rao;
     1016        meanRao[prn](4)        = 1;
     1017      }
     1018      else {
     1019        meanRao[prn].Rows(1,3) += corr->rao;
     1020        meanRao[prn](4)        += 1;
     1021      }
     1022      switchToLastEph(_eph[prn]->last, corr);
     1023    }
     1024   
     1025    // Compute Differences wrt Mean, find Maximum
     1026    // ------------------------------------------
     1027    QMap<QString, cmbCorr*> maxDiff;
     1028    it.toFront();
     1029    while (it.hasNext()) {
     1030      cmbCorr* corr = it.next();
     1031      QString  prn  = corr->prn;
     1032      if (meanRao[prn](4) != 0) {
     1033        meanRao[prn] /= meanRao[prn](4);
     1034        meanRao[prn](4) = 0;
     1035      }
     1036      corr->diffRao = corr->rao - meanRao[prn].Rows(1,3);
     1037      if (maxDiff.find(prn) == maxDiff.end()) {
     1038        maxDiff[prn] = corr;
     1039      }
     1040      else {
     1041        double normMax = maxDiff[prn]->diffRao.norm_Frobenius();
     1042        double norm    = corr->diffRao.norm_Frobenius();
     1043        if (norm > normMax) {
     1044          maxDiff[prn] = corr;
     1045        }
     1046      }
     1047    }
     1048   
     1049    // Remove Outliers
     1050    // ---------------
     1051    bool removed = false;
     1052    QMutableVectorIterator<cmbCorr*> im(corrs());
     1053    while (im.hasNext()) {
     1054      cmbCorr* corr = im.next();
     1055      QString  prn  = corr->prn;
     1056      if (corr == maxDiff[prn]) {
     1057        double norm = corr->diffRao.norm_Frobenius();
     1058        if (norm > MAX_DISPLACEMENT) {
     1059          im.remove();
     1060          removed = true;
     1061        }
     1062      }
     1063    }
     1064   
     1065    if (!removed) {
     1066      break;
     1067    }
     1068  }
     1069
     1070//  //// beg test
     1071//  QVectorIterator<cmbCorr*> it(corrs());
     1072//  while (it.hasNext()) {
     1073//    cmbCorr* corr = it.next();
     1074//    QString  prn  = corr->prn;
     1075//    cout << corr->acName.toAscii().data() << " " << prn.toAscii().data() << " "
     1076//         << corr->iod << " " << corr->diffRao.t();
     1077//  }
     1078//  cout << endl;
     1079//  //// end tets
    10321080
    10331081  return success;
  • trunk/BNC/combination/bnccomb.h

    r3487 r3488  
    6060  class cmbCorr : public t_corr {
    6161   public:
    62     QString acName;
     62    QString      acName;
     63    ColumnVector diffRao;
    6364  };
    6465
Note: See TracChangeset for help on using the changeset viewer.