Changeset 6255 in ntrip


Ignore:
Timestamp:
Oct 24, 2014, 9:33:18 AM (9 years ago)
Author:
stuerze
Message:

scaling (integer or dbHz) in SNR plots depends now on SNR1 avarage value

File:
1 edited

Legend:

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

    r6213 r6255  
    3535 * Created:    11-Apr-2012
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    7272  _currEpo = 0;
    7373
    74   connect(this, SIGNAL(dspSkyPlot(const QString&,
    75                                   const QByteArray&,
    76                                   QVector<t_polarPoint*>*,
     74  connect(this, SIGNAL(dspSkyPlot(const QString&,
    7775                                  const QByteArray&,
    7876                                  QVector<t_polarPoint*>*,
    79                                   const QByteArray&, double)),
    80           this, SLOT(slotDspSkyPlot(const QString&,
     77                                  const QByteArray&,
     78                                  QVector<t_polarPoint*>*,
     79                                  const QByteArray&, double)),
     80          this, SLOT(slotDspSkyPlot(const QString&,
    8181                                    const QByteArray&,
    82                                     QVector<t_polarPoint*>*, 
     82                                    QVector<t_polarPoint*>*,
    8383                                    const QByteArray&,
    8484                                    QVector<t_polarPoint*>*,
     
    105105}
    106106
    107 // 
    108 ////////////////////////////////////////////////////////////////////////////
    109 void t_reqcAnalyze::slotDspSkyPlot(const QString& fileName, 
     107//
     108////////////////////////////////////////////////////////////////////////////
     109void t_reqcAnalyze::slotDspSkyPlot(const QString& fileName,
    110110                                   const QByteArray& title1,
    111                                    QVector<t_polarPoint*>* data1, 
     111                                   QVector<t_polarPoint*>* data1,
    112112                                   const QByteArray& title2,
    113113                                   QVector<t_polarPoint*>* data2,
     
    135135      }
    136136    }
    137    
     137
    138138    QwtInterval scaleInterval(0.0, maxValue);
    139139
     
    152152    }
    153153
    154     t_graphWin* graphWin = new t_graphWin(0, fileName, plots, 
     154    t_graphWin* graphWin = new t_graphWin(0, fileName, plots,
    155155                                          &scaleTitle, &scaleInterval);
    156156
     
    166166}
    167167
    168 // 
     168//
    169169////////////////////////////////////////////////////////////////////////////
    170170void t_reqcAnalyze::run() {
     
    198198}
    199199
    200 // 
     200//
    201201////////////////////////////////////////////////////////////////////////////
    202202void t_reqcAnalyze::analyzeFile(t_rnxObsFile* obsFile) {
     
    232232      }
    233233      _obsStat._endTime = _currEpo->tt;
    234  
     234
    235235      // Loop over all satellites
    236236      // ------------------------
     
    239239        t_satObs obs;
    240240        t_rnxObsFile::setObsFromRnx(obsFile, _currEpo, rnxSat, obs);
    241  
     241
    242242        QString prn(obs._prn.toString().c_str());
    243  
     243
    244244        t_ephGlo* ephGlo  = 0;
    245245        int       slotNum = 0;
     
    255255          }
    256256        }
    257  
     257
    258258        t_irc irc = _allObsMap[prn].addObs(obs, slotNum);
    259259
     
    271271        }
    272272      }
    273  
     273
    274274      prepareObsStat(iEpo, obsFile->interval(), xyzSta);
    275275      iEpo++;
     
    282282    }
    283283    else {
    284       qDebug() << str;   
     284      qDebug() << str;
    285285    }
    286286    _mutex.unlock();
     
    299299    it.next();
    300300    QString    prn     = it.key();
    301     preparePlotData(prn, xyzSta, obsFile->interval(), 
     301    preparePlotData(prn, xyzSta, obsFile->interval(),
    302302                    dataMP1, dataMP2, dataSNR1, dataSNR2);
    303303  }
     
    310310    QFileInfo  fileInfo(obsFile->fileName());
    311311    QByteArray title = fileInfo.fileName().toAscii();
    312     emit dspSkyPlot(obsFile->fileName(), "MP1", dataMP1, "MP2", dataMP2, 
     312    emit dspSkyPlot(obsFile->fileName(), "MP1", dataMP1, "MP2", dataMP2,
    313313                    "Meters", 2.0);
    314     emit dspSkyPlot(obsFile->fileName(), "SNR1", dataSNR1, "SNR2", dataSNR2,
    315                     "", 9.0);
     314    double mean = 0.0;
     315    for (int ii = 0; ii < dataSNR1->size(); ii++) {
     316      const t_polarPoint* point = dataSNR1->at(ii);
     317      mean += point->_value;
     318    }
     319    mean /= dataSNR1->size();
     320    double max = (mean > 9.0) ? 54.0 : 9.0;
     321    QByteArray str = (mean > 9.0) ? "dbHz" : "";
     322    emit dspSkyPlot(obsFile->fileName(), "SNR1", dataSNR1, "SNR2", dataSNR2,
     323                str, max);
    316324    emit dspAvailPlot(obsFile->fileName(), title);
    317325  }
     
    337345}
    338346
    339 // 
    340 ////////////////////////////////////////////////////////////////////////////
    341 t_irc t_reqcAnalyze::t_allObs::addObs(const t_satObs& obs, int slotNum) { 
     347//
     348////////////////////////////////////////////////////////////////////////////
     349t_irc t_reqcAnalyze::t_allObs::addObs(const t_satObs& obs, int slotNum) {
    342350
    343351  t_oneObs* newObs = new t_oneObs(obs._time.gpsw(), obs._time.gpssec());
     
    360368      }
    361369      if (frqObs->_codeValid) {
    362         P1 = frqObs->_code;   
     370        P1 = frqObs->_code;
    363371      }
    364372      if (frqObs->_snrValid) {
    365         newObs->_SNR1 = frqObs->_snr;   
     373        newObs->_SNR1 = frqObs->_snr;
    366374      }
    367375    }
     
    374382      }
    375383      if (frqObs->_codeValid) {
    376         P2 = frqObs->_code;   
     384        P2 = frqObs->_code;
    377385      }
    378386      if (frqObs->_snrValid) {
    379         newObs->_SNR2 = frqObs->_snr;   
     387        newObs->_SNR2 = frqObs->_snr;
    380388      }
    381389    }
     
    425433}
    426434
    427 // 
     435//
    428436////////////////////////////////////////////////////////////////////////////
    429437void t_reqcAnalyze::prepareObsStat(unsigned iEpo, double obsInterval,
     
    443451}
    444452
    445 // 
    446 ////////////////////////////////////////////////////////////////////////////
    447 void t_reqcAnalyze::preparePlotData(const QString& prn, 
     453//
     454////////////////////////////////////////////////////////////////////////////
     455void t_reqcAnalyze::preparePlotData(const QString& prn,
    448456                                    const ColumnVector& xyzSta,
    449457                                    double obsInterval,
    450                                     QVector<t_polarPoint*>* dataMP1, 
     458                                    QVector<t_polarPoint*>* dataMP1,
    451459                                    QVector<t_polarPoint*>* dataMP2,
    452                                     QVector<t_polarPoint*>* dataSNR1, 
     460                                    QVector<t_polarPoint*>* dataSNR1,
    453461                                    QVector<t_polarPoint*>* dataSNR2) {
    454462
    455   const int chunkStep = int( 30.0 / obsInterval); // chunk step (30 sec) 
     463  const int chunkStep = int( 30.0 / obsInterval); // chunk step (30 sec)
    456464  const int numEpo    = int(600.0 / obsInterval); // # epochs in one chunk (10 min)
    457465
     
    488496    }
    489497
    490     // Chunk-Specific Variables 
     498    // Chunk-Specific Variables
    491499    // ------------------------
    492500    bncTime currTime;
     
    534542            }
    535543          }
    536          
     544
    537545          if (eph) {
    538546            ColumnVector xc(4);
     
    548556        }
    549557      }
    550  
     558
    551559      // Check Interval
    552560      // --------------
     
    612620        double diff1 = oneObs->_MP1 - meanMP1;
    613621        double diff2 = oneObs->_MP2 - meanMP2;
    614      
     622
    615623        // Check Slip Threshold
    616624        // --------------------
     
    619627          break;
    620628        }
    621      
     629
    622630        MP1 += diff1 * diff1;
    623631        MP2 += diff2 * diff2;
     
    630638          _obsStat._prnStat[prn]._numSlipsFound += 1;
    631639        }
    632       } 
     640      }
    633641      else {
    634642        MP1 = sqrt(MP1 / (numEpo-1));
     
    679687}
    680688
    681 // 
    682 ////////////////////////////////////////////////////////////////////////////
    683 void t_reqcAnalyze::slotDspAvailPlot(const QString& fileName, 
     689//
     690////////////////////////////////////////////////////////////////////////////
     691void t_reqcAnalyze::slotDspAvailPlot(const QString& fileName,
    684692                                     const QByteArray& title) {
    685693
     
    761769  AA = AA.Rows(1, nSatUsed);
    762770
    763   SymmetricMatrix QQ; 
     771  SymmetricMatrix QQ;
    764772  QQ << AA.t() * AA;
    765773  QQ = QQ.i();
     
    779787  }
    780788
    781   *_log << "Marker name:     " << _obsStat._markerName   << endl 
     789  *_log << "Marker name:     " << _obsStat._markerName   << endl
    782790        << "Receiver:        " << _obsStat._receiverType << endl
    783791        << "Antenna:         " << _obsStat._antennaName  << endl
Note: See TracChangeset for help on using the changeset viewer.