UTCTime.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: UTCTime.hpp 2457 2010-08-18 14:20:12Z coandrei $"
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //
00029 //  Wei Yan - Chinese Academy of Sciences . 2009, 2010
00030 //
00031 //============================================================================
00032 
00033 
00034 #include "DayTime.hpp"
00035 
00036 namespace gpstk
00037 {
00040       
00060    class UTCTime : public DayTime
00061    {
00062    public:
00063 
00065       UTCTime(){ setTimeFrame(UTC);};
00066 
00067       UTCTime(DayTime& utc) : DayTime(utc)
00068       { setTimeFrame(DayTime::UTC); }
00069 
00070       UTCTime(int year,int month,int day,int hour,int minute,double second)
00071          : DayTime(year, month, day, hour, minute, second, DayTime::UTC)
00072       {}
00073 
00074       UTCTime(int year,int doy,double sod)
00075          : DayTime(year, doy, sod, DayTime::UTC)
00076       {}
00077 
00078       UTCTime(double mjdUTC)
00079          :DayTime(mjdUTC, DayTime::UTC)
00080       {}     
00081 
00083       virtual ~UTCTime() { };
00084 
00085 
00086          // MJD formats
00087 
00088       double mjdUT1(){ return this->asUT1().MJD(); };
00089 
00090       double mjdUTC(){ return this->MJD(); };
00091       
00092       double mjdTT(){ return this->asTT().MJD(); };
00093       
00094       double mjdTDB(){ return this->asTDB().MJD(); };
00095        
00096       double mjdTAI(){ return this->asTAI().MJD(); };
00097       
00098       double mjdGPST(){ return this->asGPST().MJD(); };
00099       
00100 
00101          // JD formats
00102 
00103       double jdUT1(){ return this->asUT1().JD(); };
00104       
00105       double jdUTC(){ return this->asUTC().JD(); };
00106       
00107       double jdTT(){ return this->asTT().JD(); };
00108       
00109       double jdTDB(){ return asTDB().JD(); };
00110       
00111       double jdTAI(){ return asTAI().JD(); };
00112       
00113       double jdGPST(){ return asGPST().JD(); };
00114 
00115 
00116          // convert to different time system
00117 
00119       DayTime asUT1();
00120          
00122       DayTime asUTC();
00123          
00125       DayTime asTT();
00126       
00128       DayTime asTDB();
00129          
00131       DayTime asTAI();
00132          
00134       DayTime asGPST();
00135          
00137       DayTime asBDT();
00138       
00139          // EOP data
00140 
00141       double xPole();
00142 
00143       double yPole();
00144       
00145       double UT1mUTC();
00146       
00147 
00148       double TAImUTC();
00149       
00150       double GPSTmUTC();
00151          
00153       void test();
00154 
00155    protected:
00156 
00166       double ctatv(long jdno, double fjdno);
00167 
00169       struct MJDTime 
00170       {
00171          long      MJDint;
00172          double   MJDfr;
00173       };
00174 
00175    public:
00176 
00178       static const double DAY_TO_SECOND;      // = 86400; 
00179          
00181       static const double TT_TAI;           // = 32.184;  // constant
00182          
00184       static const double TAI_GPS;           // = 19.0;  // constant 
00185 
00186    }; // End of class 'UTCTime'
00187 
00188       
00192    void GPST2UTC(const DayTime& gpst, DayTime& utc);
00193       
00197    void UTC2GPST(const DayTime& utc, DayTime& gpst);
00198 
00202    void UT12UTC(const DayTime& ut1, DayTime& utc);
00203 
00207    void UTC2UT1(const DayTime& utc, DayTime& ut1);
00208 
00212    void TT2UTC(const DayTime& tt, DayTime& utc);
00213 
00217    void UTC2TT(const DayTime& utc, DayTime& tt);
00218 
00222    void TAI2UTC(const DayTime& tai, DayTime& utc);
00223 
00227    void UTC2TAI(const DayTime& utc, DayTime& tai);
00228 
00229 
00233    void BDT2UTC(const DayTime& bdt, DayTime& utc);
00234 
00238    void UTC2BDT(const DayTime& utc, DayTime& bdt);
00239 
00240 
00241    // @}
00242 
00243 }  // End of namespace 'gpstk'
00244 
00245 #endif  // GPSTK_UTC_TIME_HPP
00246 

Generated on Tue May 22 03:31:02 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1