Changeset 5808 in ntrip


Ignore:
Timestamp:
Aug 6, 2014, 11:16:40 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/filter.cpp

    r5800 r5808  
    77
    88#include "filter.h"
     9#include "bncutils.h"
    910#include "parlist.h"
    1011#include "obspool.h"
    1112#include "station.h"
    1213#include "pppClient.h"
    13 #include "bncmodel.h"
    1414
    1515using namespace BNC;
     
    212212    }
    213213    ColumnVector dx;
    214     bncModel::kalman(AA, ll, PP, _QFlt, dx);
     214    kalman(AA, ll, PP, _QFlt, dx);
    215215    _xFlt += dx;
    216216    //// end test
  • trunk/BNC/src/PPP/pppModel.cpp

    r5807 r5808  
    292292  return sumWind[prn.toInt()]; 
    293293}
     294
     295// Tropospheric Model (Saastamoinen)
     296////////////////////////////////////////////////////////////////////////////
     297double t_tropo::delay_saast(const ColumnVector& xyz, double Ele) {
     298
     299  Tracer tracer("bncModel::delay_saast");
     300
     301  if (xyz[0] == 0.0 && xyz[1] == 0.0 && xyz[2] == 0.0) {
     302    return 0.0;
     303  }
     304
     305  double ell[3];
     306  xyz2ell(xyz.data(), ell);
     307  double height = ell[2];
     308
     309  double pp =  1013.25 * pow(1.0 - 2.26e-5 * height, 5.225);
     310  double TT =  18.0 - height * 0.0065 + 273.15;
     311  double hh =  50.0 * exp(-6.396e-4 * height);
     312  double ee =  hh / 100.0 * exp(-37.2465 + 0.213166*TT - 0.000256908*TT*TT);
     313
     314  double h_km = height / 1000.0;
     315 
     316  if (h_km < 0.0) h_km = 0.0;
     317  if (h_km > 5.0) h_km = 5.0;
     318  int    ii   = int(h_km + 1);
     319  double href = ii - 1;
     320 
     321  double bCor[6];
     322  bCor[0] = 1.156;
     323  bCor[1] = 1.006;
     324  bCor[2] = 0.874;
     325  bCor[3] = 0.757;
     326  bCor[4] = 0.654;
     327  bCor[5] = 0.563;
     328 
     329  double BB = bCor[ii-1] + (bCor[ii]-bCor[ii-1]) * (h_km - href);
     330 
     331  double zen  = M_PI/2.0 - Ele;
     332
     333  return (0.002277/cos(zen)) * (pp + ((1255.0/TT)+0.05)*ee - BB*(tan(zen)*tan(zen)));
     334}
     335
  • trunk/BNC/src/PPP/pppModel.h

    r5806 r5808  
    5454};
    5555
     56class t_tropo {
     57 public: 
     58  static double delay_saast(const ColumnVector& xyz, double Ele);
     59};
     60
    5661}
    5762
  • trunk/BNC/src/PPP/satobs.cpp

    r5784 r5808  
    5151#include "obspool.h"
    5252#include "pppClient.h"
    53 #include "bncmodel.h"
    5453
    5554using namespace BNC;
     
    234233  // Tropospheric Delay
    235234  // ------------------
    236   _model._tropo = bncModel::delay_saast(station->xyzApr(), station->ellApr()[2]);
     235  _model._tropo = t_tropo::delay_saast(station->xyzApr(), station->ellApr()[2]);
    237236
    238237  // Phase Wind-Up
  • trunk/BNC/src/bncmodel.cpp

    r5807 r5808  
    346346  satData->rho = (satData->xx - xRec).norm_Frobenius();
    347347
    348   double tropDelay = delay_saast(xRec, satData->eleSat) +
     348  double tropDelay = t_tropo::delay_saast(xRec, satData->eleSat) +
    349349                     trp() / sin(satData->eleSat);
    350350
     
    385385  return satData->rho + phaseCenter + antennaOffset + clk()
    386386                      + offset - satData->clk + tropDelay + wind;
    387 }
    388 
    389 // Tropospheric Model (Saastamoinen)
    390 ////////////////////////////////////////////////////////////////////////////
    391 double bncModel::delay_saast(const ColumnVector& xyz, double Ele) {
    392 
    393   Tracer tracer("bncModel::delay_saast");
    394 
    395   if (xyz[0] == 0.0 && xyz[1] == 0.0 && xyz[2] == 0.0) {
    396     return 0.0;
    397   }
    398 
    399   double ell[3];
    400   xyz2ell(xyz.data(), ell);
    401   double height = ell[2];
    402 
    403   double pp =  1013.25 * pow(1.0 - 2.26e-5 * height, 5.225);
    404   double TT =  18.0 - height * 0.0065 + 273.15;
    405   double hh =  50.0 * exp(-6.396e-4 * height);
    406   double ee =  hh / 100.0 * exp(-37.2465 + 0.213166*TT - 0.000256908*TT*TT);
    407 
    408   double h_km = height / 1000.0;
    409  
    410   if (h_km < 0.0) h_km = 0.0;
    411   if (h_km > 5.0) h_km = 5.0;
    412   int    ii   = int(h_km + 1);
    413   double href = ii - 1;
    414  
    415   double bCor[6];
    416   bCor[0] = 1.156;
    417   bCor[1] = 1.006;
    418   bCor[2] = 0.874;
    419   bCor[3] = 0.757;
    420   bCor[4] = 0.654;
    421   bCor[5] = 0.563;
    422  
    423   double BB = bCor[ii-1] + (bCor[ii]-bCor[ii-1]) * (h_km - href);
    424  
    425   double zen  = M_PI/2.0 - Ele;
    426 
    427   return (0.002277/cos(zen)) * (pp + ((1255.0/TT)+0.05)*ee - BB*(tan(zen)*tan(zen)));
    428387}
    429388
     
    654613    else if (par->type == bncParam::TROPO) {
    655614      ColumnVector xyz(3); xyz(1) = x(); xyz(2) = y(); xyz(3) = z();
    656       double aprTrp = delay_saast(xyz, M_PI/2.0);
     615      double aprTrp = t_tropo::delay_saast(xyz, M_PI/2.0);
    657616      strB << "\n    trp     = " << par->prn.toAscii().data()
    658617           << setw(7) << setprecision(3) << aprTrp << " "
  • trunk/BNC/src/bncmodel.h

    r5807 r5808  
    9898  }
    9999
    100   static double delay_saast(const ColumnVector& xyz, double Ele);
    101 
    102100 private:
    103101  void   reset();
  • trunk/BNC/src/combination/bnccomb.cpp

    r5805 r5808  
    192192      cmbAC* AC = it.next();
    193193      _params.push_back(new cmbParam(cmbParam::offACgps, ++nextPar, AC->name, ""));
    194       for (int iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
     194      for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
    195195        QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    196196        _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
     
    199199      if (_useGlonass) {
    200200        _params.push_back(new cmbParam(cmbParam::offACglo, ++nextPar, AC->name, ""));
    201         for (int iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
     201        for (unsigned iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
    202202          QString prn = QString("R%1").arg(iGlo, 2, 10, QChar('0'));
    203203          _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
     
    206206      }
    207207    }
    208     for (int iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
     208    for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
    209209      QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    210210      _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
    211211    }
    212212    if (_useGlonass) {
    213       for (int iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
     213      for (unsigned iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
    214214        QString prn = QString("R%1").arg(iGlo, 2, 10, QChar('0'));
    215215        _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
     
    594594    }
    595595
    596     bncModel::kalman(AA, ll, PP, _QQ, dx);
     596    kalman(AA, ll, PP, _QQ, dx);
    597597    ColumnVector vv = ll - AA * dx;
    598598
     
    806806    }
    807807    int iCond = 1;
    808     for (int iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
     808    for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
    809809      QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    810810      ++iCond;
Note: See TracChangeset for help on using the changeset viewer.