CARMA C++
IERSTable.h
Go to the documentation of this file.
1 #ifndef CARMA_SERVICES_IERSTABLE_H
2 #define CARMA_SERVICES_IERSTABLE_H
3 
18 #include <iostream>
19 #include <iomanip>
20 #include <sstream>
21 #include <string>
22 #include <vector>
23 
24 namespace carma {
25  namespace services {
26 
39  class IERSTable {
40  public:
41 
47  IERSTable(const std::string& filename = "");
48 
52  virtual ~IERSTable();
53 
54 
58  void open(const std::string& filename);
59 
63  void close(void);
64 
69  double dut1(const double mjd);
70 
75  double xpolar(const double mjd);
76 
81  double ypolar(const double mjd);
82 
86  double getMinMJD(void) { return min_mjd_; }
87 
88 
92  double getMaxMJD(void) { return max_mjd_; }
93 
99  bool isOutOfDate();
100 
106  double age(void) ;
107 
111  void reload();
112 
119  static const double MAX_ALLOWABLE_DAYS_OUT_OF_DATE;
120 
121  private:
122  ::std::string filename_; // disk file name containing IERS data
123  double last_mjd_; // last MJD entered
124  int last_idx_; // last index that belongs to MJD
125  double min_mjd_;
126  double max_mjd_;
127 
128  std::vector<double> mjd_; // array of MJD's
129  std::vector<double> dut1_; // dut1's
130  std::vector<double> xpolar_; // xpolar's
131  std::vector<double> ypolar_; // ypolar's
132 
133  void setIndex(const double mjd); // helper function to remember last access
134 
135  };
136  }
137 }
138 
139 
140 #endif // CARMA_SERVICES_IERSTABLE_H
class to access (processed) IERS tables The IERSTable class reads a (processed by mk-iers...
Definition: IERSTable.h:39
static const double MAX_ALLOWABLE_DAYS_OUT_OF_DATE
Maximum time allowed between updates of the on line IERS tables.
Definition: IERSTable.h:119
virtual ~IERSTable()
Destructor.
double getMaxMJD(void)
return maximum valid MJD
Definition: IERSTable.h:92
double getMinMJD(void)
return minimum valid MJD
Definition: IERSTable.h:86
IERSTable(const std::string &filename="")
void open(const std::string &filename)
Open IERS table.
void reload()
Re-read the disk file.
double dut1(const double mjd)
get the UT1-UTC (dut1) in seconds for given MJD
double age(void)
return the age in days of this table.
double ypolar(const double mjd)
get the y polar wobble in arc seconds for given MJD
void close(void)
Close IERS access, ready it for another table.
double xpolar(const double mjd)
get the x polar wobble in arc seconds for given MJD