HOPS
HOPS class reference
MHO_StationDelayCorrection.hh
Go to the documentation of this file.
1 #ifndef MHO_StationDelayCorrection_HH__
2 #define MHO_StationDelayCorrection_HH__
3 
4 #include <cctype>
5 #include <cmath>
6 #include <complex>
7 #include <map>
8 #include <vector>
9 
10 #include "MHO_Constants.hh"
11 #include "MHO_Message.hh"
12 
14 #include "MHO_TableContainer.hh"
15 #include "MHO_UnaryOperator.hh"
16 
17 namespace hops
18 {
19 
31 class MHO_StationDelayCorrection: public MHO_UnaryOperator< visibility_type >
32 {
33  public:
36 
42  void SetReferenceFrequency(double ref_freq) { fRefFreq = ref_freq; }
43 
52  void SetStationIdentifier(std::string station_id) { fStationIdentity = station_id; }
53 
59  void SetPCDelayOffset(const double& pc_delay_offset) { fDelayOffset = pc_delay_offset; }
60 
61  protected:
69  virtual bool InitializeInPlace(visibility_type* in) override;
78  virtual bool InitializeOutOfPlace(const visibility_type* in, visibility_type* out) override;
79 
87  virtual bool ExecuteInPlace(visibility_type* in) override;
96  virtual bool ExecuteOutOfPlace(const visibility_type* in, visibility_type* out) override;
97 
98  private:
106  bool IsApplicable(std::size_t st_idx, const visibility_type* in);
107 
108  //constants
109  std::complex< double > fImagUnit;
110  double fNanoSecToSecond;
111  double fMHzToHz;
112  double fPi;
113 
114  //selection
115  std::string fStationIdentity;
116 
117  //ref freq and pc delay
118  double fRefFreq;
119  double fDelayOffset;
120 
121  //keys for tag retrieval
122  std::string fStationKey;
123  std::string fRemStationKey;
124  std::string fRefStationKey;
125  std::string fRemStationMk4IDKey;
126  std::string fRefStationMk4IDKey;
127 
128  std::string fSidebandLabelKey;
129  std::string fLowerSideband;
130  std::string fUpperSideband;
131 
132  //minor helper function to make sure all strings are compared as upper-case only
133  void make_upper(std::string& s)
134  {
135  for(char& c : s)
136  {
137  c = toupper(c);
138  };
139  }
140 };
141 
142 } // namespace hops
143 
144 #endif
Class MHO_StationDelayCorrection.
Definition: MHO_StationDelayCorrection.hh:32
virtual bool InitializeInPlace(visibility_type *in) override
Initializes in-place visibility_type pointer.
Definition: MHO_StationDelayCorrection.cc:135
void SetPCDelayOffset(const double &pc_delay_offset)
Setter for delay offset.
Definition: MHO_StationDelayCorrection.hh:59
virtual bool InitializeOutOfPlace(const visibility_type *in, visibility_type *out) override
Initializes out-of-place visibility data from input data.
Definition: MHO_StationDelayCorrection.cc:140
virtual bool ExecuteOutOfPlace(const visibility_type *in, visibility_type *out) override
Copies input visibility data and executes in-place correction.
Definition: MHO_StationDelayCorrection.cc:82
MHO_StationDelayCorrection()
Definition: MHO_StationDelayCorrection.cc:7
void SetStationIdentifier(std::string station_id)
Setter for station identifier.
Definition: MHO_StationDelayCorrection.hh:52
void SetReferenceFrequency(double ref_freq)
Setter for reference frequency.
Definition: MHO_StationDelayCorrection.hh:42
virtual bool ExecuteInPlace(visibility_type *in) override
Applies phase correction to visibility data for reference or remote station.
Definition: MHO_StationDelayCorrection.cc:31
virtual ~MHO_StationDelayCorrection()
Definition: MHO_StationDelayCorrection.cc:29
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_ChannelLabeler.hh:17