- Timestamp:
- Dec 1, 2009, 1:54:49 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncconst.cpp
r2052 r2063 31 31 const double t_CST::lambda2 = c / freq2; 32 32 const double t_CST::omega = 7292115.1467e-11; 33 const double t_CST::aell = 6378137.000; 34 const double t_CST::fInv = 298.2572236; -
trunk/BNC/bncconst.h
r2052 r2063 36 36 static const double lambda2; 37 37 static const double omega; 38 static const double aell; 39 static const double fInv; 38 40 }; 39 41 -
trunk/BNC/bncmodel.cpp
r2061 r2063 40 40 41 41 #include <iomanip> 42 #include <cmath> 42 43 #include <newmatio.h> 43 44 … … 45 46 #include "bncpppclient.h" 46 47 #include "bancroft.h" 48 #include "bncutils.h" 47 49 48 50 using namespace std; … … 138 140 } 139 141 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 140 150 return success; 141 151 } … … 155 165 satData->rho = (satData->xx - xRec).norm_Frobenius(); 156 166 157 double tropDelay = 0.0; 167 double tropDelay = delay_saast(); 168 169 cout << "tropDelay " << tropDelay << endl; 158 170 159 171 return satData->rho + _xcBanc(4) - satData->clk + tropDelay; 172 } 173 174 // Tropospheric Model (Saastamoinen) 175 //////////////////////////////////////////////////////////////////////////// 176 double 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))); 160 205 } 161 206 -
trunk/BNC/bncmodel.h
r2060 r2063 55 55 private: 56 56 double cmpValueP3(t_satData* satData); 57 double delay_saast(); 58 57 59 QList<bncParam*> _params; 58 60 SymmetricMatrix _QQ; … … 62 64 ColumnVector _xx; 63 65 ColumnVector _xcBanc; 66 double _height; 64 67 }; 65 68 -
trunk/BNC/bncutils.cpp
r2043 r2063 185 185 xyz = RR * rsw; 186 186 } 187 188 // Rectangular Coordinates -> Ellipsoidal Coordinates 189 //////////////////////////////////////////////////////////////////////////// 190 t_irc xyz2ell(const double* XYZ, double* Ell) { 191 192 const double bell = t_CST::aell*(1.0-1.0/t_CST::fInv) ; 193 const double e2 = (t_CST::aell*t_CST::aell-bell*bell)/(t_CST::aell*t_CST::aell) ; 194 const double e2c = (t_CST::aell*t_CST::aell-bell*bell)/(bell*bell) ; 195 196 double nn, ss, zps, hOld, phiOld, theta, sin3, cos3; 197 198 ss = sqrt(XYZ[0]*XYZ[0]+XYZ[1]*XYZ[1]) ; 199 zps = XYZ[2]/ss ; 200 theta = atan( (XYZ[2]*t_CST::aell) / (ss*bell) ); 201 sin3 = sin(theta) * sin(theta) * sin(theta); 202 cos3 = cos(theta) * cos(theta) * cos(theta); 203 204 // Closed formula 205 Ell[0] = atan( (XYZ[2] + e2c * bell * sin3) / (ss - e2 * t_CST::aell * cos3) ); 206 Ell[1] = atan2(XYZ[1],XYZ[0]) ; 207 nn = t_CST::aell/sqrt(1.0-e2*sin(Ell[0])*sin(Ell[0])) ; 208 Ell[2] = ss / cos(Ell[0]) - nn; 209 210 const int MAXITER = 100; 211 for (int ii = 1; ii <= MAXITER; ii++) { 212 nn = t_CST::aell/sqrt(1.0-e2*sin(Ell[0])*sin(Ell[0])) ; 213 hOld = Ell[2] ; 214 phiOld = Ell[0] ; 215 Ell[2] = ss/cos(Ell[0])-nn ; 216 Ell[0] = atan(zps/(1.0-e2*nn/(nn+Ell[2]))) ; 217 if ( fabs(phiOld-Ell[0]) <= 1.0e-11 && fabs(hOld-Ell[2]) <= 1.0e-5 ) { 218 return success; 219 } 220 } 221 222 return failure; 223 } -
trunk/BNC/bncutils.h
r2043 r2063 30 30 31 31 #include <newmat.h> 32 #include <bncconst.h> 32 33 33 34 void expandEnvVar(QString& str); … … 46 47 const ColumnVector& rsw, ColumnVector& xyz); 47 48 49 t_irc xyz2ell(const double* XYZ, double* Ell); 50 48 51 #endif
Note:
See TracChangeset
for help on using the changeset viewer.