Changeset 7521 in ntrip


Ignore:
Timestamp:
Oct 19, 2015, 12:53:07 PM (9 years ago)
Author:
stuerze
Message:

minor changes to allow sinex troposphere file writing in version 2.0

Location:
trunk/BNC/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncantex.cpp

    r7145 r7521  
    3535 * Created:    26-Jan-2011
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    6868}
    6969
    70 // Print 
     70// Print
    7171////////////////////////////////////////////////////////////////////////////
    7272void bncAntex::print() const {
     
    9090}
    9191
     92// Print
     93////////////////////////////////////////////////////////////////////////////
     94QString bncAntex::pcoSinexString(const std::string& antName, t_frequency::type frqType) {
     95
     96  if (antName.find("NULLANTENNA") != string::npos) {
     97    QString();
     98  }
     99
     100  QString antNameQ = antName.c_str();
     101
     102  if (_maps.find(antNameQ) == _maps.end()) {
     103    QString();
     104  }
     105
     106  t_antMap* map = _maps[antNameQ];
     107  if (map->frqMap.find(frqType) == map->frqMap.end()) {
     108    return QString();
     109  }
     110
     111  t_frqMap* frqMap = map->frqMap[frqType];
     112
     113  return QString("%1 %2 %3").arg(frqMap->neu[2], 6, 'f', 4)
     114                            .arg(frqMap->neu[0], 6, 'f', 4)
     115                            .arg(frqMap->neu[1], 6, 'f', 4);
     116}
     117
    92118// Read ANTEX File
    93119////////////////////////////////////////////////////////////////////////////
     
    104130  while ( !in.atEnd() ) {
    105131    QString line = in.readLine();
    106  
     132
    107133    // Start of Antenna
    108134    // ----------------
     
    116142        newAntMap = new t_antMap();
    117143      }
    118     } 
     144    }
    119145
    120146    // End of Antenna
     
    152178      else if (line.indexOf("ZEN1 / ZEN2 / DZEN") == 60) {
    153179        QTextStream inLine(&line, QIODevice::ReadOnly);
    154         inLine >> newAntMap->zen1 >> newAntMap->zen2 >> newAntMap->dZen; 
     180        inLine >> newAntMap->zen1 >> newAntMap->zen2 >> newAntMap->dZen;
    155181      }
    156182
     
    271297// Satellite Antenna Offset
    272298////////////////////////////////////////////////////////////////////////////
    273 t_irc bncAntex::satCoMcorrection(const QString& prn, double Mjd, 
     299t_irc bncAntex::satCoMcorrection(const QString& prn, double Mjd,
    274300                                 const ColumnVector& xSat, ColumnVector& dx) {
    275301
     
    297323      ColumnVector xSun = BNC_PPP::t_astro::Sun(Mjd);
    298324      xSun /= sqrt(DotProduct(xSun,xSun));
    299  
     325
    300326      ColumnVector sy = crossproduct(sz, xSun);
    301327      sy /= sqrt(DotProduct(sy,sy));
    302  
     328
    303329      ColumnVector sx = crossproduct(sy, sz);
    304330
     
    314340}
    315341
    316 // 
     342//
    317343////////////////////////////////////////////////////////////////////////////
    318344double bncAntex::rcvCorr(const string& antName, t_frequency::type frqType,
  • trunk/BNC/src/bncantex.h

    r6405 r7521  
    3737  bncAntex();
    3838  ~bncAntex();
    39   t_irc  readFile(const QString& fileName); 
    40   void   print() const;
    41   double rcvCorr(const std::string& antName, t_frequency::type frqType,
    42                  double eleSat, double azSat, bool& found) const;
    43   t_irc  satCoMcorrection(const QString& prn, double Mjd,
    44                           const ColumnVector& xSat, ColumnVector& dx);
     39  t_irc   readFile(const QString& fileName);
     40  void    print() const;
     41  QString pcoSinexString(const std::string& antName, t_frequency::type frqType);
     42  double  rcvCorr(const std::string& antName, t_frequency::type frqType,
     43                  double eleSat, double azSat, bool& found) const;
     44  t_irc   satCoMcorrection(const QString& prn, double Mjd,
     45                           const ColumnVector& xSat, ColumnVector& dx);
    4546
    4647 private:
  • trunk/BNC/src/bncsinextro.cpp

    r6658 r7521  
    3030                         int sampl)
    3131  : bncoutf(sklFileName, intr, sampl) {
     32
    3233  _opt       = opt;
    3334  (!sampl) ? _sampl = 1 : _sampl =  sampl;
     35
     36  if (!_opt->_antexFileName.empty()) {
     37    _antex = new bncAntex(_opt->_antexFileName.c_str());
     38  }
     39  else {
     40    _antex = 0;
     41  }
    3442}
    3543
     
    3846bncSinexTro::~bncSinexTro() {
    3947  closeFile();
     48  if (_antex)
     49    delete _antex;
    4050}
    4151
     
    4555  int    GPSWeek;
    4656  double GPSWeeks;
     57  bncSettings settings;
    4758  GPSweekFromDateAndTime(datTim, GPSWeek, GPSWeeks);
    4859  int daysec    = int(fmod(GPSWeeks, 86400.0));
     
    5869                                       .arg(84600    , 5, 10);
    5970
    60 
    61   _out << "%=TRO 0.01 BNC " << creationTime.toStdString() << " BNC "
     71  QString intStr = settings.value("PPP/snxtroIntr").toString();
     72  int intr, indHlp = 0;
     73  if      ((indHlp = intStr.indexOf("min")) != -1) {
     74    intr = intStr.left(indHlp-1).toInt();
     75    intr *= 60;
     76  }
     77  else if ((indHlp = intStr.indexOf("hour")) != -1) {
     78    intr = intStr.left(indHlp-1).toInt();
     79    intr *= 3600;
     80  }
     81  else if ((indHlp = intStr.indexOf("day")) != -1) {
     82    intr = intStr.left(indHlp-1).toInt();
     83    intr *= 86400;
     84  }
     85
     86
     87  QString numberOfEpochs = QString("%1").arg(intr/_sampl, 5, 10, QLatin1Char('0'));
     88  _out << "%=TRO 2.00 BNC " << creationTime.toStdString() << " BNC "
    6289       << startTime.toStdString() << " " << endTime.toStdString() << " P "
    63        << _opt->_roverName.substr(0,4)   << endl;
     90       << numberOfEpochs.toStdString() << " 0 " << " T "  << endl;
    6491
    6592
     
    6895  _out << " OUTPUT             " << "Total Troposphere Zenith Path Delay Product" << endl;
    6996  _out << " SOFTWARE           " << BNCPGMNAME <<  endl;
    70   _out << " HARDWARE           " << BNC_OS << endl;
    7197  _out << " INPUT              " << "Orbit and Clock information used from BRDC and RTCM-SSR streams" << endl;
    7298  _out << "-FILE/REFERENCE" << endl << endl;
     99
     100
     101  _out << "+SITE/ID" << endl;
     102  _out << "-SITE/ID" << endl << endl;
     103
     104
     105  _out << "+SITE/RECEIVER" << endl;
     106  _out << "*SITE PT SOLN T DATA_START__ DATA_END____ DESCRIPTION_________ S/N__ FIRMWARE___" << endl;
     107  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
     108       << startTime.toStdString() << " " << endTime.toStdString() << " " << _opt->_recNameRover << endl;
     109  _out << "-SITE/RECEIVER" << endl << endl;
     110
     111
     112  _out << "+SITE/ANTENNA" << endl;
     113  _out << "*SITE PT SOLN T DATA_START__ DATA_END____ DESCRIPTION_________ S/N__" << endl;
     114  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
     115       << startTime.toStdString() << " " << endTime.toStdString() << " " << _opt->_antNameRover << endl;
     116  _out << "-SITE/ANTENNA" << endl << endl;
     117
     118  if (_antex) {
     119    if (_opt->_LCsGPS.size()) {
     120      _out << "+SITE/GPS_PHASE_CENTER" << endl;
     121      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
     122      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
     123      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
     124           <<  "      "
     125           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::G1).toStdString()
     126           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::G2).toStdString()
     127        << endl;
     128      _out << "-SITE/GPS_PHASE_CENTER" << endl << endl;
     129    }
     130    if (_opt->_LCsGLONASS.size()) {
     131      _out << "+SITE/GLONASS_PHASE_CENTER" << endl;
     132      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
     133      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
     134      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
     135           <<  "      "
     136           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::R1).toStdString()
     137           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::R2).toStdString()
     138        << endl;
     139      _out << "-SITE/GLONASS_PHASE_CENTER" << endl << endl;
     140    }
     141    if (_opt->_LCsGalileo.size()) {
     142      _out << "+SITE/GALILEO_PHASE_CENTER" << endl;
     143      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
     144      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
     145      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
     146           <<  "      "
     147           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::E1).toStdString()
     148           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::E5).toStdString()
     149        << endl;
     150      _out << "-SITE/GALILEO_PHASE_CENTER" << endl << endl;
     151    }
     152    if (_opt->_LCsBDS.size()) {
     153      _out << "+SITE/BEIDOU_PHASE_CENTER" << endl;
     154      _out << "*                           UP____ NORTH_ EAST__ UP____ NORTH_ EAST__ " << endl;
     155      _out << "*DESCRIPTION_________ S/N__ L1->ARP(M)__________ __L2->ARP(M)________ AZ_EL_____" << endl;
     156      _out << QString(" %1").arg(_opt->_antNameRover.c_str(), 20,QLatin1Char(' ')).toStdString()
     157           <<  "      "
     158           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::C2).toStdString()
     159           << _antex->pcoSinexString(_opt->_antNameRover, t_frequency::C7).toStdString()
     160        << endl;
     161      _out << "-SITE/BEIDOU_PHASE_CENTER" << endl << endl;
     162    }
     163  }
     164
     165  _out << "+SITE/ECCENTRICITY" << endl;
     166  _out << "*                                             UP______ NORTH___ EAST____" << endl;
     167  _out << "*SITE PT SOLN T DATA_START__ DATA_END____ AXE ARP->BENCHMARK(M)_________" << endl;
     168  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
     169       << startTime.toStdString() << " " << endTime.toStdString() << " " << " UNE"
     170       << QString("%1").arg(_opt->_neuEccRover(3), 9, 'f', 4, QLatin1Char(' ')).toStdString()
     171       << QString("%1").arg(_opt->_neuEccRover(1), 9, 'f', 4, QLatin1Char(' ')).toStdString()
     172       << QString("%1").arg(_opt->_neuEccRover(2), 9, 'f', 4, QLatin1Char(' ')).toStdString() << endl;
     173  _out << "-SITE/ANTENNA" << endl << endl;
     174
     175
     176  _out << "+TROP/COORDINATES" << endl;
     177  _out << "*SITE PT SOLN T __STA_X_____ __STA_Y_____ __STA_Z_____ SYSTEM REMRK" << endl;
     178  _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P"
     179       << QString("%1").arg(_opt->_xyzAprRover(1), 13, 'f', 3, QLatin1Char(' ')).toStdString()
     180       << QString("%1").arg(_opt->_xyzAprRover(2), 13, 'f', 3, QLatin1Char(' ')).toStdString()
     181       << QString("%1").arg(_opt->_xyzAprRover(3), 13, 'f', 3, QLatin1Char(' ')).toStdString()
     182       << " ITRF08"<< endl;
     183  _out << "-TROP/COORDINATES"<< endl << endl;
    73184
    74185
     
    86197
    87198
    88   _out << "+TROP/STA_COORDINATES" << endl;
    89   _out << "*SITE PT SOLN T STA_X_______ STA_Y_______ STA_Z_______ SYSTEM REMARK" << endl;
    90   _out << " " << _opt->_roverName.substr(0,4) << "  A    1 P "
    91        << setw(12) << setprecision(3) << _opt->_xyzAprRover(1) << " "
    92        << setw(12) << setprecision(3) << _opt->_xyzAprRover(2) << " "
    93        << setw(12) << setprecision(3) << _opt->_xyzAprRover(3) << " ITRF08" << endl;
    94   _out << "-TROP/STA_COORDINATES"  << endl << endl;
    95 
    96 
    97199  _out << "+TROP/SOLUTION" << endl;
    98200  _out << "*SITE EPOCH_______ TROTOT STDEV" << endl;
  • trunk/BNC/src/bncsinextro.h

    r6653 r7521  
    1010#include "bncversion.h"
    1111#include "pppOptions.h"
     12#include "bncsettings.h"
     13#include "bncantex.h"
    1214
    1315using namespace BNC_PPP;
     
    2628  virtual void closeFile();
    2729  QString _roverName;
    28   int     _sampl;
     30  int _sampl;
    2931  const t_pppOptions*  _opt;
     32  bncAntex* _antex;
     33  double _antPCO[t_frequency::max];
    3034};
    3135
  • trunk/BNC/src/pppOptions.h

    r7048 r7521  
    3232  std::string             _corrFile;
    3333  double                  _corrWaitTime;
    34   std::string             _roverName;     
     34  std::string             _roverName;
    3535  ColumnVector            _xyzAprRover;
    3636  ColumnVector            _neuEccRover;
    37   std::string             _antNameRover; 
    38   std::string             _antexFileName;
     37  std::string             _recNameRover;
     38  std::string             _antNameRover;
     39  std::string             _antexFileName;
    3940  double                  _sigmaC1;
    4041  double                  _sigmaL1;
Note: See TracChangeset for help on using the changeset viewer.