Changeset 4269 in ntrip


Ignore:
Timestamp:
Jun 22, 2012, 12:31:03 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r4268 r4269  
    156156    QString          prn     = it.key();
    157157    const t_satStat& satStat = it.value();
    158     if (satStat.MP1.size()) {
     158
     159    if (satStat.MP1.size() > 1) {
     160      double mean = 0.0;
    159161      for (int ii = 0; ii < satStat.MP1.size(); ii++) {
    160         *_log << "MP1 " << prn << " " << satStat.MP1[ii] << endl;
     162        mean += satStat.MP1[ii];
    161163      }
    162     }
    163     if (satStat.MP2.size()) {
    164       for (int ii = 0; ii < satStat.MP2.size(); ii++) {
    165         *_log << "MP2 " << prn << " " << satStat.MP2[ii] << endl;
     164      mean /= satStat.MP1.size();
     165      double stddev = 0.0;
     166      for (int ii = 0; ii < satStat.MP1.size(); ii++) {
     167        double diff = satStat.MP1[ii] - mean;
     168        stddev += diff * diff;
    166169      }
    167     }
     170      double MP1 = sqrt(stddev / (satStat.MP1.size()-1));
     171
     172      *_log << "MP1 " << prn << " " << MP1 << endl;
     173    }
     174
    168175  }
    169176
Note: See TracChangeset for help on using the changeset viewer.