Changeset 5886 in ntrip for trunk/BNC/src/bncutils.cpp


Ignore:
Timestamp:
Aug 8, 2014, 4:18:50 PM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncutils.cpp

    r5866 r5886  
    403403  return yf;
    404404}
    405 
    406 //
    407 ////////////////////////////////////////////////////////////////////////////
    408 double djul(int jj, int mm, double tt) {
    409   int    ii, kk;
     405//
     406////////////////////////////////////////////////////////////////////////////
     407double djul(long jj, long mm, double tt) {
     408  long    ii, kk;
    410409  double  djul ;
    411410  if( mm <= 2 ) {
     
    422421//
    423422////////////////////////////////////////////////////////////////////////////
    424 void jdgp(double tjul, double & second, int & nweek) {
     423double 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////////////////////////////////////////////////////////////////////////////
     431void jdgp(double tjul, double & second, long & nweek) {
    425432  double      deltat;
    426433  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);
    430435  second = (deltat - (nweek)*7.0)*86400.0;
    431436}
     437
     438//
     439////////////////////////////////////////////////////////////////////////////
     440void 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}
    432457
    433458//
Note: See TracChangeset for help on using the changeset viewer.