EarthOrientation.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: EarthOrientation.hpp 2293 2010-02-12 18:14:16Z btolman $"
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 "Exception.hpp"
00059 #include "DayTime.hpp"
00060 
00061 //------------------------------------------------------------------------------------
00062 namespace gpstk {
00063 
00065    class EarthOrientation
00066    {
00067    public:
00068       double xp;           // arcseconds
00069       double yp;           // arcseconds
00070       double UT1mUTC;      // seconds
00071 
00073       EarthOrientation() : xp(0),yp(0),UT1mUTC(0) {}
00074 
00076       friend std::ostream& operator<<(std::ostream& s, const EarthOrientation&);
00077    };
00078 
00079    //---------------------------------------------------------------------------------
00097    class EOPPrediction
00098    {
00101       double tv;
00103            double ta,tb;
00105            double A,B,C1,C2,D1,D2,E,F,G1,G2,H1,H2,I,J,K1,K2,K3,K4,L1,L2,L3,L4;
00107            double P1,P2,Q1,Q2,R1,R2,R3,R4;
00108 
00109    public:
00111            int TAIUTC;
00113       int SerialNo;
00115       std::string Info;
00116    
00120       int getValidTime(void) const
00121          throw() { return int(tv+0.5); }
00122 
00128       int loadFile(std::string filename)
00129          throw(FileMissingException);
00130    
00136       static int getSerialNumber(DayTime& t)
00137          throw(DayTime::DayTimeException);
00138    
00139       static int getSerialNumber(int mjd)
00140          throw(DayTime::DayTimeException)
00141          {
00142             DayTime t;
00143             t.setMJD(double(mjd));
00144             return getSerialNumber(t);
00145          }
00146 
00153       EarthOrientation computeEOP(int& mjd) const
00154          throw(DayTime::DayTimeException);
00155 
00162       EarthOrientation computeEOP(DayTime& t) const
00163          throw();
00164    
00169       friend std::ostream& operator<<(std::ostream& s, const EOPPrediction&);
00170    };
00171 
00172    //---------------------------------------------------------------------------------
00177    class EOPStore
00178    {
00180       std::map<int,EarthOrientation> mapMJD_EOP;
00181 
00183       int begMJD,endMJD;
00184    
00185    public:
00187       EOPStore() : begMJD(-1), endMJD(-1) {}
00188 
00191       void addEOP(int MJD,
00192                   EarthOrientation& eop)
00193          throw();
00194 
00200       int addEOP(int MJD,
00201                  EOPPrediction& eopp)
00202          throw(DayTime::DayTimeException);
00203 
00210       void addFile(const std::string& filename)
00211          throw(FileMissingException);
00212 
00218       void addEOPPFile(const std::string& filename)
00219          throw(FileMissingException);
00220 
00224       void addIERSFile(const std::string& filename)
00225          throw(FileMissingException);
00226 
00233       void edit(int mjdmin,
00234                 int mjdmax)
00235          throw();
00236 
00243       void edit(const DayTime& tmin,
00244                 const DayTime& tmax)
00245          throw()
00246          { edit(int(tmin.MJD()+0.5),int(tmax.MJD()+1.5)); }
00247 
00249       int size(void)
00250          throw() { return mapMJD_EOP.size(); }
00251 
00253       void clear(void)
00254          throw() { mapMJD_EOP.clear(); begMJD=endMJD=-1; }
00255 
00261       void dump(short detail=0,
00262                 std::ostream& s=std::cout) const
00263          throw();
00264 
00266       int getFirstMJD(void) throw()
00267       { return begMJD; }
00268 
00270       int getLastMJD(void) throw()
00271       { return endMJD; }
00272 
00279       EarthOrientation getEOP(DayTime& t) const
00280          throw(InvalidRequest);
00281 
00282    };
00283 
00284 }  // end namespace gpstk
00285 
00286 #endif // nothing below this

Generated on Wed Feb 8 03:30:59 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1