Changeset 8146 in ntrip for branches/BNC_2.12/src/upload


Ignore:
Timestamp:
Sep 28, 2017, 2:40:51 PM (7 years ago)
Author:
stuerze
Message:

bug fixed regarding crd trafo: trafo from ITRF2014 into ETRF2008, NAD83 or DREF91 is done via ITRF2008

Location:
branches/BNC_2.12/src/upload
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/upload/bncrtnetuploadcaster.cpp

    r8144 r8146  
    186186    _t0  =  2000.0;
    187187  }
    188   // Transformation Parameters from ITRF2014 to ITRF2008 (http://itrf.ign.fr/doc_ITRF/Transfo-ITRF2014_ITRFs.txt)
    189   else if (_crdTrafo == "ITRF2008") {
    190     _dx  =  0.0016;
    191     _dy  =  0.0019;
    192     _dz  =  0.0024;
    193     _dxr =  0.0;
    194     _dyr =  0.0;
    195     _dzr = -0.0001;
    196     _ox  =  0.0;
    197     _oy  =  0.0;
    198     _oz  =  0.0;
    199     _oxr =  0.0;
    200     _oyr =  0.0;
    201     _ozr =  0.0;
    202     _sc  = -0.02;
    203     _scr =  0.03;
    204     _t0  =  2010.0;
    205   }
    206188  else if (_crdTrafo == "Custom") {
    207189    _dx = settings.value("trafo_dx").toDouble();
     
    221203    _t0 = settings.value("trafo_t0").toDouble();
    222204  }
     205    // TODO: the following lines can be deleted if all parameters are updated regarding ITRF2014
     206  if (_crdTrafo == "ETRF2000" ||
     207      _crdTrafo ==  "NAD83" ||
     208      _crdTrafo ==  "DREF91" ) {// Transformation Parameters from ITRF2014 to ITRF2008
     209                                // (http://itrf.ign.fr/doc_ITRF/Transfo-ITRF2014_ITRFs.txt)
     210   _dx8  =  0.0016;
     211   _dy8  =  0.0019;
     212   _dz8  =  0.0024;
     213   _dxr8 =  0.0;
     214   _dyr8 =  0.0;
     215   _dzr8 = -0.0001;
     216   _ox8  =  0.0;
     217   _oy8  =  0.0;
     218   _oz8  =  0.0;
     219   _oxr8 =  0.0;
     220   _oyr8 =  0.0;
     221   _ozr8 =  0.0;
     222   _sc8  = -0.02;
     223   _scr8 =  0.03;
     224   _t08  =  2010.0;
     225 }
    223226}
    224227
     
    22882291  //  crdTrafo(GPSweek, xP, dc);
    22892292  //}
     2293  //TODO: the following 3 lines can be deleted if all parameters are updated regarding ITRF2014
    22902294  if (_crdTrafo ==  "ETRF2000") {
    2291     _crdTrafo =  "ITRF2008"; crdTrafo(GPSweek, xP, dc);
    2292     _crdTrafo =  "ETRF2000"; crdTrafo(GPSweek, xP, dc);
     2295    crdTrafo8(GPSweek, xP, dc);
     2296    crdTrafo(GPSweek, xP, dc);
    22932297  }
    22942298  else if (_crdTrafo ==  "NAD83") {
    2295     _crdTrafo =  "ITRF2008"; crdTrafo(GPSweek, xP, dc);
    2296     _crdTrafo =  "NAD83";    crdTrafo(GPSweek, xP, dc);
     2299    crdTrafo8(GPSweek, xP, dc);
     2300    crdTrafo(GPSweek, xP, dc);
    22972301  }
    22982302  else if (_crdTrafo ==  "DREF91") {
    2299     _crdTrafo =  "ITRF2008"; crdTrafo(GPSweek, xP, dc);
    2300     _crdTrafo =  "DREF91";   crdTrafo(GPSweek, xP, dc);
     2303    crdTrafo8(GPSweek, xP, dc);
     2304    crdTrafo(GPSweek, xP, dc);
    23012305  }
    23022306  else if (_crdTrafo ==  "SIRGAS2000" ||
     
    24342438}
    24352439
     2440// Transform Coordinates
     2441////////////////////////////////////////////////////////////////////////////
     2442void bncRtnetUploadCaster::crdTrafo8(int GPSWeek, ColumnVector& xyz,
     2443    double& dc) {
     2444
     2445  // Current epoch minus 2000.0 in years
     2446  // ------------------------------------
     2447  double dt = (GPSWeek - (1042.0 + 6.0 / 7.0)) / 365.2422 * 7.0 + 2000.0 - _t0;
     2448
     2449  ColumnVector dx(3);
     2450
     2451  dx(1) = _dx8 + dt * _dxr8;
     2452  dx(2) = _dy8 + dt * _dyr8;
     2453  dx(3) = _dz8 + dt * _dzr8;
     2454
     2455  static const double arcSec = 180.0 * 3600.0 / M_PI;
     2456
     2457  double ox = (_ox8 + dt * _oxr8) / arcSec;
     2458  double oy = (_oy8 + dt * _oyr8) / arcSec;
     2459  double oz = (_oz8 + dt * _ozr8) / arcSec;
     2460
     2461  double sc = 1.0 + _sc8 * 1e-9 + dt * _scr8 * 1e-9;
     2462
     2463  // Specify approximate center of area
     2464  // ----------------------------------
     2465  ColumnVector meanSta(3);
     2466  meanSta(1) = 0.0; // TODO
     2467  meanSta(2) = 0.0; // TODO
     2468  meanSta(3) = 0.0; // TODO
     2469
     2470
     2471  // Clock correction proportional to topocentric distance to satellites
     2472  // -------------------------------------------------------------------
     2473  double rho = (xyz - meanSta).norm_Frobenius();
     2474  dc = rho * (sc - 1.0) / sc / t_CST::c;
     2475
     2476  Matrix rMat(3, 3);
     2477  rMat(1, 1) = 1.0;
     2478  rMat(1, 2) = -oz;
     2479  rMat(1, 3) = oy;
     2480  rMat(2, 1) = oz;
     2481  rMat(2, 2) = 1.0;
     2482  rMat(2, 3) = -ox;
     2483  rMat(3, 1) = -oy;
     2484  rMat(3, 2) = ox;
     2485  rMat(3, 3) = 1.0;
     2486
     2487  xyz = sc * rMat * xyz + dx;
     2488}
     2489
    24362490int bncRtnetUploadCaster::determineUpdateInd(double samplingRate) {
    24372491
  • branches/BNC_2.12/src/upload/bncrtnetuploadcaster.h

    r8018 r8146  
    3939  void crdTrafo(int GPSWeek, ColumnVector& xyz, double& dc);
    4040
     41  // TODO: the following lines can be deleted if all parameters are updated regarding ITRF2014
     42  void crdTrafo8(int GPSWeek, ColumnVector& xyz, double& dc);
     43 
    4144  int determineUpdateInd(double samplingRate);
    4245
     
    6972  bncSP3*        _sp3;
    7073  QMap<QString, const t_eph*>* _usedEph;
     74    // TODO: the following lines can be deleted if all parameters are updated regarding ITRF2014
     75  double         _dx8;
     76  double         _dy8;
     77  double         _dz8;
     78  double         _dxr8;
     79  double         _dyr8;
     80  double         _dzr8;
     81  double         _ox8;
     82  double         _oy8;
     83  double         _oz8;
     84  double         _oxr8;
     85  double         _oyr8;
     86  double         _ozr8;
     87  double         _sc8;
     88  double         _scr8;
     89  double         _t08;
    7190};
    7291
Note: See TracChangeset for help on using the changeset viewer.