Changeset 4698 in ntrip


Ignore:
Timestamp:
Sep 9, 2012, 6:24:53 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r4697 r4698  
    448448    bool    slipL1  = false;
    449449    bool    slipL2  = false;
    450     bool    slipMP  = false;
    451450    double  meanMP1 = 0.0;
    452451    double  meanMP2 = 0.0;
     
    540539      }
    541540
     541      meanMP1 += oneObs->_MP1;
     542      meanMP2 += oneObs->_MP2;
     543    }
     544
     545    // Compute the Multipath
     546    // ---------------------
     547    bool slipMP = false;
     548    meanMP1 /= numEpo;
     549    meanMP2 /= numEpo;
     550    double MP1 = 0.0;
     551    double MP2 = 0.0;
     552    for (int ii = 0; ii < numEpo; ii++) {
     553      int iEpo = chunkStart + ii;
     554      const t_oneObs* oneObs = allObs._oneObsVec[iEpo];
     555      double diff1 = oneObs->_MP1 - meanMP1;
     556      double diff2 = oneObs->_MP2 - meanMP2;
     557
    542558      // Check Slip Threshold
    543559      // --------------------
    544       if (ii > 0) {
    545         double diff1 = oneObs->_MP1 - allObs._oneObsVec[iEpo-1]->_MP1;
    546         double diff2 = oneObs->_MP2 - allObs._oneObsVec[iEpo-1]->_MP2;
    547         if (fabs(diff1) > SLIPTRESH || fabs(diff2) > SLIPTRESH) {
    548           slipMP = true;
    549         }
    550       }
    551 
    552       meanMP1 += oneObs->_MP1;
    553       meanMP2 += oneObs->_MP2;
     560      if (fabs(diff1) > SLIPTRESH || fabs(diff2) > SLIPTRESH) {
     561        slipMP = true;
     562        break;
     563      }
     564
     565      MP1 += diff1 * diff1;
     566      MP2 += diff2 * diff2;
     567    }
     568    if (slipMP) {
     569      slipL1 = true;
     570      slipL2 = true;
     571    } else {
     572      MP1 = sqrt(MP1 / (numEpo-1));
     573      MP2 = sqrt(MP2 / (numEpo-1));
     574      (*dataMP1)  << (new t_polarPoint(aziDeg, zenDeg, MP1));
     575      (*dataMP2)  << (new t_polarPoint(aziDeg, zenDeg, MP2));
    554576    }
    555577
     
    587609    (*dataSNR1) << (new t_polarPoint(aziDeg, zenDeg, minSNR1));
    588610    (*dataSNR2) << (new t_polarPoint(aziDeg, zenDeg, minSNR2));
    589 
    590     // Compute the Multipath
    591     // ---------------------
    592     if (!slipMP) {
    593       meanMP1 /= numEpo;
    594       meanMP2 /= numEpo;
    595       double MP1 = 0.0;
    596       double MP2 = 0.0;
    597       for (int ii = 0; ii < numEpo; ii++) {
    598         int iEpo = chunkStart + ii;
    599         const t_oneObs* oneObs = allObs._oneObsVec[iEpo];
    600         double diff1 = oneObs->_MP1 - meanMP1;
    601         double diff2 = oneObs->_MP2 - meanMP2;
    602         MP1 += diff1 * diff1;
    603         MP2 += diff2 * diff2;
    604       }
    605       MP1 = sqrt(MP1 / (numEpo-1));
    606       MP2 = sqrt(MP2 / (numEpo-1));
    607       (*dataMP1)  << (new t_polarPoint(aziDeg, zenDeg, MP1));
    608       (*dataMP2)  << (new t_polarPoint(aziDeg, zenDeg, MP2));
    609     }
    610611  }
    611612}
Note: See TracChangeset for help on using the changeset viewer.