Changeset 5802 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Aug 6, 2014, 10:35:19 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
1 deleted
8 edited

Legend:

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

    r5788 r5802  
    5555#include "bncutils.h"
    5656#include "station.h"
    57 #include "bnctides.h"
    5857#include "bncantex.h"
    5958#include "filter.h"
     
    8281  _staRover = new t_station();
    8382  _filter   = new t_filter();
     83  _tides    = new t_tides();
    8484
    8585  if (!_opt->_antexFile.empty()) {
     
    103103  delete _antex;
    104104  delete _filter;
     105  delete _tides;
    105106  clearObs();
    106107}
     
    379380  // Tides
    380381  // -----
    381   ColumnVector hlp = station->xyzApr();
    382   tides(time, hlp);
    383   station->setTideDspl(hlp - station->xyzApr());
     382  station->setTideDspl( _tides->displacement(time, station->xyzApr()) );
    384383 
    385384  // Observation model
  • trunk/BNC/src/PPP/pppClient.h

    r5779 r5802  
    77#include "ephemeris.h"
    88#include "options.h"
     9#include "pppModel.h"
    910
    1011class bncAntex;
     
    6566  std::ostringstream*    _log;
    6667  t_options*             _opt;
     68  t_tides*               _tides;
    6769};
    6870
  • trunk/BNC/src/PPP/pppModel.cpp

    r5801 r5802  
    208208  return dX;
    209209}
     210
     211// Constructor
     212///////////////////////////////////////////////////////////////////////////
     213t_windUp::t_windUp() {
     214  for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
     215    sumWind[ii]   = 0.0;
     216    lastEtime[ii] = 0.0;
     217  }
     218}
     219
     220// Phase Wind-Up Correction
     221///////////////////////////////////////////////////////////////////////////
     222double t_windUp::value(const bncTime& etime, const ColumnVector& rRec,
     223                       t_prn prn, const ColumnVector& rSat) {
     224
     225  if (etime.mjddec() != lastEtime[prn.toInt()]) {
     226
     227    // Unit Vector GPS Satellite --> Receiver
     228    // --------------------------------------
     229    ColumnVector rho = rRec - rSat;
     230    rho /= rho.norm_Frobenius();
     231   
     232    // GPS Satellite unit Vectors sz, sy, sx
     233    // -------------------------------------
     234    ColumnVector sz = -rSat / rSat.norm_Frobenius();
     235
     236    ColumnVector xSun = Sun(etime.mjddec());
     237    xSun /= xSun.norm_Frobenius();
     238
     239    ColumnVector sy = crossproduct(sz, xSun);
     240    ColumnVector sx = crossproduct(sy, sz);
     241
     242    // Effective Dipole of the GPS Satellite Antenna
     243    // ---------------------------------------------
     244    ColumnVector dipSat = sx - rho * DotProduct(rho,sx)
     245                                                - crossproduct(rho, sy);
     246   
     247    // Receiver unit Vectors rx, ry
     248    // ----------------------------
     249    ColumnVector rx(3);
     250    ColumnVector ry(3);
     251
     252    double recEll[3]; xyz2ell(rRec.data(), recEll) ;
     253    double neu[3];
     254   
     255    neu[0] = 1.0;
     256    neu[1] = 0.0;
     257    neu[2] = 0.0;
     258    neu2xyz(recEll, neu, rx.data());
     259   
     260    neu[0] =  0.0;
     261    neu[1] = -1.0;
     262    neu[2] =  0.0;
     263    neu2xyz(recEll, neu, ry.data());
     264   
     265    // Effective Dipole of the Receiver Antenna
     266    // ----------------------------------------
     267    ColumnVector dipRec = rx - rho * DotProduct(rho,rx)
     268                                                   + crossproduct(rho, ry);
     269   
     270    // Resulting Effect
     271    // ----------------
     272    double alpha = DotProduct(dipSat,dipRec) /
     273                      (dipSat.norm_Frobenius() * dipRec.norm_Frobenius());
     274   
     275    if (alpha >  1.0) alpha =  1.0;
     276    if (alpha < -1.0) alpha = -1.0;
     277   
     278    double dphi = acos(alpha) / 2.0 / M_PI;  // in cycles
     279   
     280    if ( DotProduct(rho, crossproduct(dipSat, dipRec)) < 0.0 ) {
     281      dphi = -dphi;
     282    }
     283
     284    if (lastEtime[prn.toInt()] == 0.0) {
     285      sumWind[prn.toInt()] = dphi;
     286    }
     287    else {
     288      sumWind[prn.toInt()] = nint(sumWind[prn.toInt()] - dphi) + dphi;
     289    }
     290
     291    lastEtime[prn.toInt()] = etime.mjddec();
     292  }
     293
     294  return sumWind[prn.toInt()]; 
     295}
  • trunk/BNC/src/PPP/pppModel.h

    r5801 r5802  
    3939};
    4040
     41class t_windUp {
     42 public:
     43  t_windUp();
     44  ~t_windUp() {};
     45  double value(const bncTime& etime, const ColumnVector& rRec, t_prn prn,
     46               const ColumnVector& rSat);
     47 private:
     48  double lastEtime[t_prn::MAXPRN+1];
     49  double sumWind[t_prn::MAXPRN+1];
     50};
     51
    4152#endif
  • trunk/BNC/src/PPP/windup.cpp

    r5753 r5802  
    55#include "windup.h"
    66#include "bncutils.h"
    7 #include "bnctides.h"
    87
    98using namespace std;
  • trunk/BNC/src/bncantex.cpp

    r5755 r5802  
    4343
    4444#include "bncantex.h"
    45 #include "bnctides.h"
     45#include "PPP/pppModel.h"
    4646
    4747using namespace std;
     
    236236    sz /= sqrt(DotProduct(sz,sz));
    237237
    238     ColumnVector xSun = Sun(Mjd);
     238    ColumnVector xSun = t_astro::Sun(Mjd);
    239239    xSun /= sqrt(DotProduct(xSun,xSun));
    240240 
  • trunk/BNC/src/bncmodel.cpp

    r5794 r5802  
    5050#include "bancroft.h"
    5151#include "bncutils.h"
    52 #include "bnctides.h"
     52#include "PPP/pppModel.h"
    5353#include "bncantex.h"
    5454#include "pppopt.h"
     
    187187  }
    188188
     189  _tides = new t_tides;
     190
    189191  // Bancroft Coordinates
    190192  // --------------------
     
    213215  }
    214216  delete _epoData_sav;
     217  delete _tides;
    215218}
    216219
     
    338341  xRec(3) = z();
    339342
    340   tides(_time, xRec);
     343  xRec += _tides->displacement(_time, xRec);
    341344
    342345  satData->rho = (satData->xx - xRec).norm_Frobenius();
     
    980983    ColumnVector sz = -rSat / rSat.norm_Frobenius();
    981984
    982     ColumnVector xSun = Sun(Mjd);
     985    ColumnVector xSun = t_astro::Sun(Mjd);
    983986    xSun /= xSun.norm_Frobenius();
    984987
  • trunk/BNC/src/bncmodel.h

    r5750 r5802  
    3838class t_pppOpt;
    3939class bncPPPclient;
     40class t_tides;
    4041
    4142class bncParam {
     
    164165  QStringList           _outlierGlo;
    165166  bncAntex*             _antex;
     167  t_tides*              _tides;
    166168};
    167169
Note: See TracChangeset for help on using the changeset viewer.