EarthOrientation.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: EarthOrientation.hpp 3153 2012-06-21 15:18:18Z snelsen $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00020 //  
00021 //  Copyright 2004, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00025 //============================================================================
00026 //
00027 //This software developed by Applied Research Laboratories at the University of
00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00029 //Department of Defense. The U.S. Government retains all rights to use,
00030 //duplicate, distribute, disclose, or release this software. 
00031 //
00032 //Pursuant to DoD Directive 523024 
00033 //
00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00035 //                           release, distribution is unlimited.
00036 //
00037 //=============================================================================
00038 
00048 #ifndef CLASS_EARTHORIENT_INCLUDE
00049 #define CLASS_EARTHORIENT_INCLUDE
00050 
00051 //------------------------------------------------------------------------------------
00052 // system includes
00053 #include <iostream>
00054 #include <iomanip>
00055 #include <string>
00056 #include <map>
00057 // GPSTk
00058 #include "MJD.hpp"
00059 
00060 //------------------------------------------------------------------------------------
00061 namespace gpstk {
00062 
00064    class EarthOrientation
00065    {
00066    public:
00067       double xp;           // arcseconds
00068       double yp;           // arcseconds
00069       double UT1mUTC;      // seconds
00070 
00072       EarthOrientation() : xp(0),yp(0),UT1mUTC(0) {}
00073 
00075       friend std::ostream& operator<<(std::ostream& s, const EarthOrientation&);
00076    };
00077 
00078    //---------------------------------------------------------------------------------
00096    class EOPPrediction
00097    {
00100       double tv;
00102            double ta,tb;
00104            double A,B,C1,C2,D1,D2,E,F,G1,G2,H1,H2,I,J,K1,K2,K3,K4,L1,L2,L3,L4;
00106            double P1,P2,Q1,Q2,R1,R2,R3,R4;
00107 
00108    public:
00110            int TAIUTC;
00112       int SerialNo;
00114       std::string Info;
00115    
00119       int getValidTime(void) const
00120          throw() { return int(tv+0.5); }
00121 
00127       int loadFile(std::string filename)
00128          throw(FileMissingException);
00129    
00135       static int getSerialNumber(CommonTime& t)
00136          throw(Exception);
00137    
00138       static int getSerialNumber(int mjd)
00139          throw(Exception)
00140          {
00141             CommonTime t;
00142             t=MJD(double(mjd));
00143             return getSerialNumber(t);
00144          }
00145 
00152       EarthOrientation computeEOP(int& mjd) const
00153          throw(Exception);
00154 
00161       EarthOrientation computeEOP(CommonTime& t) const
00162          throw();
00163    
00168       friend std::ostream& operator<<(std::ostream& s, const EOPPrediction&);
00169    };
00170 
00171    //---------------------------------------------------------------------------------
00176    class EOPStore
00177    {
00179       std::map<int,EarthOrientation> mapMJD_EOP;
00180 
00182       int begMJD,endMJD;
00183    
00184    public:
00186       EOPStore() : begMJD(-1), endMJD(-1) {}
00187 
00190       void addEOP(int MJD,
00191                   EarthOrientation& eop)
00192          throw();
00193 
00199       int addEOP(int MJD,
00200                  EOPPrediction& eopp)
00201          throw(Exception);
00202 
00209       void addFile(const std::string& filename)
00210          throw(FileMissingException);
00211 
00217       void addEOPPFile(const std::string& filename)
00218          throw(FileMissingException);
00219 
00223       void addIERSFile(const std::string& filename)
00224          throw(FileMissingException);
00225 
00232       void edit(int mjdmin,
00233                 int mjdmax)
00234          throw();
00235 
00242       void edit(const CommonTime& tmin,
00243                 const CommonTime& tmax)
00244          throw()
00245          { edit(int(MJD(tmin).mjd+0.5),int(MJD(tmax).mjd+1.5)); }
00246 
00248       int size(void)
00249          throw() { return mapMJD_EOP.size(); }
00250 
00252       void clear(void)
00253          throw() { mapMJD_EOP.clear(); begMJD=endMJD=-1; }
00254 
00260       void dump(short detail=0,
00261                 std::ostream& s=std::cout) const
00262          throw();
00263 
00265       int getFirstMJD(void) throw()
00266       { return begMJD; }
00267 
00269       int getLastMJD(void) throw()
00270       { return endMJD; }
00271 
00278       EarthOrientation getEOP(CommonTime& t) const
00279          throw(InvalidRequest);
00280 
00281    };
00282 
00283 }  // end namespace gpstk
00284 
00285 #endif // nothing below this

Generated on Mon May 20 03:31:04 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1