CARMA C++
EphemerisTable.h
Go to the documentation of this file.
1 #ifndef CARMA_SERVICES_EPHEMERISTABLE_H
2 #define CARMA_SERVICES_EPHEMERISTABLE_H
3 
17 #include <iostream>
18 #include <iomanip>
19 #include <sstream>
20 #include <string>
21 #include <vector>
22 
23 namespace carma {
24  namespace services {
25 
26  class EphemerisTable {
27  public:
28 
46  EphemerisTable();
47 
54  EphemerisTable(const std::string& filename, int nrows=0);
55 
63  EphemerisTable(const std::string& filename, double mjd_min, double mjd_max);
64 
68  ~EphemerisTable();
69 
70 
78  void open(const std::string& fileName, int maxRows=0);
79 
80 
91  ephemTableType getEphemType(const std::string& fileName);
92 
93 
102  void open_sza(const std::string& fileName, int maxRows=0);
103 
108  void setMJD(double mjd_tt);
109 
110 
116  double getMJD(void) const;
117 
123  double getRa(void) const;
124 
125 
131  double getDec(void) const;
132 
138  double getDoppler(void) const;
139 
140 
146  double getDistance(void) const;
147 
148  private:
149  std::string sourceName_; // not used yet
150 
151  // scope of table
152  int nrows_;
153  int ncols_; // 11 for CARMA, 7 for SZA (not used)
154  double min_mjd_;
155  double max_mjd_;
156 
157  // type of table
158  ephemTableType ett_;
159  void setEphemType(const std::string& fileName);
160 
161  // the table
162  std::vector<double> vmjd_; // MJD [TT]
163  std::vector<double> vra_; // RA [radians]
164  std::vector<double> vdec_; // Dec [radians]
165  std::vector<double> vdoppler_; // Doppler [m/s]
166  std::vector<double> vdistance_; // Distance [AU]
167 
168  // current index in table
169  int idx_;
170 
171  // set this one
172  double mjd_; // we keep tables in TT
173  bool valid_; // if true, the mjd_ has been set and was valid
174 
175  // and these are for grabs after the interpolation has been done
176  double ra_; // radians
177  double dec_; // radians
178  double doppler_; // m/s
179  double distance_; // AU
180  };
181  }
182 }
183 
184 #endif // CARMA_SERVICES_EPHEMERISTABLE_H
enum carma::services::ephemTableEnum ephemTableType
Ephemeris table type.