00001 #pragma ident "$Id: EarthOrientation.hpp 3153 2012-06-21 15:18:18Z snelsen $"
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 "MJD.hpp"
00059
00060
00061 namespace gpstk {
00062
00064 class EarthOrientation
00065 {
00066 public:
00067 double xp;
00068 double yp;
00069 double UT1mUTC;
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 }
00284
00285 #endif // nothing below this