UTCTime.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: UTCTime.hpp 3140 2012-06-18 15:03:02Z susancummins $"
00002 
00008 #ifndef GPSTK_UTC_TIME_HPP
00009 #define GPSTK_UTC_TIME_HPP
00010 
00011 //============================================================================
00012 //
00013 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00028 //
00029 //  Wei Yan - Chinese Academy of Sciences . 2009, 2010
00030 //
00031 //============================================================================
00032 
00033 
00034 #include "CommonTime.hpp"
00035 #include "YDSTime.hpp"
00036 #include "CivilTime.hpp"
00037 #include "Epoch.hpp"
00038 #include "TimeSystem.hpp"
00039 namespace gpstk
00040 {
00043       
00063    class UTCTime : public CommonTime
00064    {
00065    public:
00066 
00068       UTCTime(){TimeSystem(UTC);}
00069 
00070       UTCTime(CommonTime& utc) : CommonTime(utc)
00071       {TimeSystem(UTC); }
00072 
00073       UTCTime(int year,int month,int day,int hour,int minute,double second)
00074           {CivilTime(year, month, day, hour, minute, second);}
00075       
00076 
00077       UTCTime(int year,int doy,double sod)
00078           {YDSTime(year, doy, sod);}
00079       
00080 
00081       UTCTime(double mjdUTC)
00082          {set(mjdUTC, 0,TimeSystem::UTC);}
00083            
00084 
00086       virtual ~UTCTime()
00087         throw()
00088          { };
00089 
00090 
00091          // MJD formats
00092 
00093       double mjdUT1(){ return this->asUT1().MJD(); }
00094 
00095       double mjdUTC(){ return this->asUTC().MJD(); };
00096 
00097       double mjdTT() { return this->asTT().MJD(); };
00098       
00099       double mjdTDB(){ return this->asTDB().MJD(); };
00100        
00101       double mjdTAI(){ return this->asTAI().MJD(); };
00102       
00103       double mjdGPST(){ return this->asGPST().MJD(); };
00104       
00105 
00106          // JD formats
00107 
00108       double jdUT1(){ return this->asUT1().JD(); };
00109       
00110       double jdUTC(){ return this->asUTC().JD(); };
00111 
00112       double jdTT() { return this->asTT().JD(); };
00113       
00114       double jdTDB(){ return this->asTDB().JD(); };
00115       
00116       double jdTAI(){ return this->asTAI().JD(); };
00117       
00118       double jdGPST(){ return this->asGPST().JD(); };
00119 
00120 
00121          // convert to different time system
00122 
00124       Epoch asUT1();
00125          
00127       Epoch asUTC();
00128          
00130         Epoch asTT();      
00131 
00133       Epoch asTDB();
00134          
00136       Epoch asTAI();
00137          
00139       Epoch asGPST();
00140          
00142       Epoch asBDT();
00143       
00144          // EOP data
00145 
00146       double xPole();
00147 
00148       double yPole();
00149       
00150       double UT1mUTC();
00151       
00152 
00153       double TAImUTC();
00154       
00155       double GPSTmUTC();
00156          
00158       void test();
00159 
00160    protected:
00161 
00171       double ctatv(long jdno, double fjdno);
00172 
00174       struct MJDTime 
00175       {
00176          long      MJDint;
00177          double   MJDfr;
00178       };
00179 
00180    public:
00181 
00183       static const double DAY_TO_SECOND;      // = 86400; 
00184          
00186       static const double TT_TAI;           // = 32.184;  // constant
00187          
00189       static const double TAI_GPS;           // = 19.0;  // constant 
00190 
00191    }; // End of class 'UTCTime'
00192 
00193       
00197    void GPST2UTC(const CommonTime& gpst, UTCTime& utc);
00198       
00202    void UTC2GPST(const UTCTime& utc, CommonTime& gpst);
00203 
00207    void UT12UTC(const UTCTime& ut1, UTCTime& utc);
00208 
00212    void UTC2UT1(const UTCTime& utc, UTCTime& ut1);
00213 
00217    void TT2UTC(const CommonTime& tt, UTCTime& utc);
00218 
00222    void UTC2TT(const UTCTime& utc, CommonTime& tt);
00223 
00227    void TAI2UTC(const CommonTime& tai, UTCTime& utc);
00228 
00232    void UTC2TAI(const UTCTime& utc, CommonTime& tai);
00233 
00234 
00238    void BDT2UTC(const CommonTime& bdt, UTCTime& utc);
00239 
00243    void UTC2BDT(const UTCTime& utc, CommonTime& bdt);
00244 
00245 
00246    // @}
00247 
00248 }  // End of namespace 'gpstk'
00249 
00250 #endif  // GPSTK_UTC_TIME_HPP
00251 

Generated on Wed May 22 03:31:15 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1