ReferenceFrames.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: ReferenceFrames.hpp 2457 2010-08-18 14:20:12Z coandrei $"
00002 
00009 #ifndef GPSTK_REFERENCE_FRAMES_HPP
00010 #define GPSTK_REFERENCE_FRAMES_HPP
00011 
00012 
00013 //============================================================================
00014 //
00015 //  This file is part of GPSTk, the GPS Toolkit.
00016 //
00017 //  The GPSTk is free software; you can redistribute it and/or modify
00018 //  it under the terms of the GNU Lesser General Public License as published
00019 //  by the Free Software Foundation; either version 2.1 of the License, or
00020 //  any later version.
00021 //
00022 //  The GPSTk is distributed in the hope that it will be useful,
00023 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025 //  GNU Lesser General Public License for more details.
00026 //
00027 //  You should have received a copy of the GNU Lesser General Public
00028 //  License along with GPSTk; if not, write to the Free Software Foundation,
00029 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00030 //
00031 //  Wei Yan - Chinese Academy of Sciences . 2009, 2010
00032 //
00033 //============================================================================
00034 
00035 
00036 
00037 #include "Vector.hpp"
00038 #include "Matrix.hpp"
00039 #include "SolarSystem.hpp"
00040 #include "UTCTime.hpp"
00041 
00042 namespace gpstk
00043 {
00046 
00049    class ReferenceFrames
00050    {
00051    public:
00052 
00061       static int setJPLEphFile(std::string filename) 
00062          throw(Exception)
00063       {
00064          return solarPlanets.initializeWithBinaryFile(filename);
00065       }
00066 
00073       static Vector<double> getJ2kPosition( const DayTime&      TT,
00074                                             SolarSystem::Planet entity = SolarSystem::Earth)
00075          throw(Exception);
00076 
00083       static Vector<double> getJ2kVelocity( const DayTime&      TT, 
00084                                             SolarSystem::Planet entity = SolarSystem::Earth)
00085          throw(Exception);
00086 
00087 
00088 
00096       static Vector<double> getJ2kPosVel( const DayTime&      TT, 
00097                                           SolarSystem::Planet entity,
00098                                           SolarSystem::Planet center = SolarSystem::Earth)
00099          throw(Exception);
00100       
00108       static Vector<double> getECEFPosition(UTCTime             UTC, 
00109                                           SolarSystem::Planet entity,
00110                                           SolarSystem::Planet center = SolarSystem::Earth)
00111          throw(Exception);
00112 
00113       
00121       static Vector<double> getECEFVelocity(UTCTime             UTC, 
00122                                           SolarSystem::Planet entity,
00123                                           SolarSystem::Planet center = SolarSystem::Earth)
00124          throw(Exception);
00125 
00126 
00134       static Vector<double> getECEFPosVel(UTCTime             UTC, 
00135                                           SolarSystem::Planet entity,
00136                                           SolarSystem::Planet center = SolarSystem::Earth)
00137          throw(Exception);
00138 
00139 
00141       static void J2kToECEFMatrix(UTCTime         UTC, 
00142                                   Matrix<double>& POM,
00143                                   Matrix<double>& Theta, 
00144                                   Matrix<double>& NP)
00145          throw(Exception);
00146 
00147 
00149       static Matrix<double> J2kToECEFMatrix(UTCTime UTC);
00150          
00152       static Matrix<double> J2kToTODMatrix(UTCTime UTC);
00153 
00155       static Vector<double> J2kPosVelToECEF(UTCTime UTC, Vector<double> j2kPosVel)
00156          throw(Exception);
00157          
00159       static Vector<double> ECEFPosVelToJ2k(UTCTime UTC, Vector<double> ecefPosVel)
00160          throw(Exception);
00161 
00163       static Vector<double> J2kStateToECEF(UTCTime UTC, Vector<double> j2kState)
00164          throw(Exception);
00165 
00167       static Vector<double> ECEFStateToJ2k(UTCTime UTC, Vector<double> ecefState)
00168          throw(Exception);
00169 
00194       static void doodsonArguments(DayTime UT1,DayTime TT,double BETA[6],double FNUT[5]); 
00195 
00196 
00198       static double iauGmst00(DayTime UT1,DayTime TT);
00199 
00200 
00201       static Matrix<double> enuMatrix(double longitude,double latitude);
00202 
00203       static Vector<double> enuToAzElDt(Vector<double> enu);
00204 
00205       static void XYZ2BLH(double xyz[3],double blh[3]);
00206       static void BLH2XYZ(double blh[3],double xyz[3]);
00207 
00208       static void XYZ2ENU(double blh[3],double xyz[3],double enu[3]);
00209       static void ENU2XYZ(double blh[3],double enu[3],double xyz[3]);
00210 
00212       static void test();
00213 
00215       static Matrix<double> Rx(const double& angle);
00216 
00218       static Matrix<double> Ry(const double& angle);
00219 
00221       static Matrix<double> Rz(const double& angle);
00222 
00223    protected:
00224         
00226       ReferenceFrames(){}
00227 
00229       ~ReferenceFrames(){}
00230 
00231          
00233       static Matrix<double> iauPmat76(DayTime TT);
00234          
00236       static void nutationAngles(DayTime TT, double& dpsi, double& deps);
00237          
00239       static double meanObliquity(DayTime TT);
00240          
00242       static double iauEqeq94(DayTime TT);
00243          
00245       static double iauGmst82(DayTime UT1);
00246 
00247            
00249       static Matrix<double> iauNmat(const double& epsa, 
00250                                     const double& dpsi, 
00251                                     const double& deps);
00252 
00254       static double earthRotationAngle(DayTime UT1);
00255 
00256 
00261       static double earthRotationAngleRate1(const double& mjdTT);
00262 
00263 
00268       static double earthRotationAngleRate2(const double& mjdTT);
00269 
00270 
00275       static double earthRotationAngleRate3(const double& mjdTT);
00276 
00277   
00279       static double normalizeAngle(double a);
00280 
00281         
00282    private:
00283 
00285       static SolarSystem solarPlanets;
00286 
00287       // Constant Variables
00288       //-------------------------------------------------
00289 
00291       static const double DJ00;
00292 
00294       static const double JD_TO_MJD; 
00295 
00297       static const double D2PI;
00298 
00300       static const double DJC;
00301 
00303       static const double DAS2R;
00304 
00306       static const double DS2R;
00307 
00309       static const double TURNAS;
00310 
00311    }; // End of class 'ReferenceFrames'
00312 
00313       // @}
00314 
00315 }  // End of namespace 'gpstk'
00316 
00317 
00318 
00319 
00320 #endif  // REFERENCE_FRAMES_HPP

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