Changeset 2063 in ntrip for trunk/BNC/bncmodel.cpp


Ignore:
Timestamp:
Dec 1, 2009, 1:54:49 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmodel.cpp

    r2061 r2063  
    4040
    4141#include <iomanip>
     42#include <cmath>
    4243#include <newmatio.h>
    4344
     
    4546#include "bncpppclient.h"
    4647#include "bancroft.h"
     48#include "bncutils.h"
    4749
    4850using namespace std;
     
    138140  }
    139141
     142  // Set Station Height
     143  // ------------------
     144  ColumnVector ell(3);
     145  xyz2ell(_xcBanc.data(), ell.data());
     146  _height = ell(3);
     147
     148  cout << "height = " << _height << endl;
     149
    140150  return success;
    141151}
     
    155165  satData->rho = (satData->xx - xRec).norm_Frobenius();
    156166
    157   double tropDelay = 0.0;
     167  double tropDelay = delay_saast();
     168
     169  cout << "tropDelay " << tropDelay << endl;
    158170
    159171  return satData->rho + _xcBanc(4) - satData->clk + tropDelay;
     172}
     173
     174// Tropospheric Model (Saastamoinen)
     175////////////////////////////////////////////////////////////////////////////
     176double bncModel::delay_saast() {
     177
     178  double Ele = M_PI/2.0;
     179
     180  double pp =  1013.25 * pow(1.0 - 2.26e-5 * _height, 5.225);
     181  double TT =  18.0 - _height * 0.0065 + 273.15;
     182  double hh =  50.0 * exp(-6.396e-4 * _height);
     183  double ee =  hh / 100.0 * exp(-37.2465 + 0.213166*TT - 0.000256908*TT*TT);
     184
     185  double h_km = _height / 1000.0;
     186 
     187  if (h_km < 0.0) h_km = 0.0;
     188  if (h_km > 5.0) h_km = 5.0;
     189  int    ii   = int(h_km + 1);
     190  double href = ii - 1;
     191 
     192  double bCor[6];
     193  bCor[0] = 1.156;
     194  bCor[1] = 1.006;
     195  bCor[2] = 0.874;
     196  bCor[3] = 0.757;
     197  bCor[4] = 0.654;
     198  bCor[5] = 0.563;
     199 
     200  double BB = bCor[ii-1] + (bCor[ii]-bCor[ii-1]) * (h_km - href);
     201 
     202  double zen  = M_PI/2.0 - Ele;
     203
     204  return (0.002277/cos(zen)) * (pp + ((1255.0/TT)+0.05)*ee - BB*(tan(zen)*tan(zen)));
    160205}
    161206
Note: See TracChangeset for help on using the changeset viewer.