00001 #pragma ident "$Id: EarthOrientation.hpp 2293 2010-02-12 18:14:16Z btolman $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00048 #ifndef CLASS_EARTHORIENT_INCLUDE
00049 #define CLASS_EARTHORIENT_INCLUDE
00050
00051
00052
00053 #include <iostream>
00054 #include <iomanip>
00055 #include <string>
00056 #include <map>
00057
00058 #include "Exception.hpp"
00059 #include "DayTime.hpp"
00060
00061
00062 namespace gpstk {
00063
00065 class EarthOrientation
00066 {
00067 public:
00068 double xp;
00069 double yp;
00070 double UT1mUTC;
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 }
00285
00286 #endif // nothing below this