Changeset 5886 in ntrip for trunk/BNC/src/bncutils.cpp
- Timestamp:
- Aug 8, 2014, 4:18:50 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncutils.cpp
r5866 r5886 403 403 return yf; 404 404 } 405 406 // 407 //////////////////////////////////////////////////////////////////////////// 408 double djul(int jj, int mm, double tt) { 409 int ii, kk; 405 // 406 //////////////////////////////////////////////////////////////////////////// 407 double djul(long jj, long mm, double tt) { 408 long ii, kk; 410 409 double djul ; 411 410 if( mm <= 2 ) { … … 422 421 // 423 422 //////////////////////////////////////////////////////////////////////////// 424 void jdgp(double tjul, double & second, int & nweek) { 423 double gpjd(double second, int nweek) { 424 double deltat; 425 deltat = nweek*7.0 + second/86400.0 ; 426 return( 44244.0 + deltat) ; 427 } 428 429 // 430 //////////////////////////////////////////////////////////////////////////// 431 void jdgp(double tjul, double & second, long & nweek) { 425 432 double deltat; 426 433 deltat = tjul - 44244.0 ; 427 // current gps week 428 nweek = (int) floor(deltat/7.0); 429 // seconds past midnight of last weekend 434 nweek = (long) floor(deltat/7.0); 430 435 second = (deltat - (nweek)*7.0)*86400.0; 431 436 } 437 438 // 439 //////////////////////////////////////////////////////////////////////////// 440 void jmt(double djul, long& jj, long& mm, double& dd) { 441 long ih, ih1, ih2 ; 442 double t1, t2, t3, t4; 443 t1 = 1.0 + djul - fmod( djul, 1.0 ) + 2400000.0; 444 t4 = fmod( djul, 1.0 ); 445 ih = long( (t1 - 1867216.25)/36524.25 ); 446 t2 = t1 + 1 + ih - ih/4; 447 t3 = t2 - 1720995.0; 448 ih1 = long( (t3 - 122.1)/365.25 ); 449 t1 = 365.25*ih1 - fmod( 365.25*ih1, 1.0 ); 450 ih2 = long( (t3 - t1)/30.6001 ); 451 dd = t3 - t1 - (int)( 30.6001*ih2 ) + t4; 452 mm = ih2 - 1; 453 if ( ih2 > 13 ) mm = ih2 - 13; 454 jj = ih1; 455 if ( mm <= 2 ) jj = jj + 1; 456 } 432 457 433 458 //
Note:
See TracChangeset
for help on using the changeset viewer.