HOPS
HOPS class reference
MHO_ManualChannelDelayCorrection.hh
Go to the documentation of this file.
1 #ifndef MHO_ManualChannelDelayCorrection_HH__
2 #define MHO_ManualChannelDelayCorrection_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_ManualChannelDelayCorrection: public MHO_UnaryOperator< visibility_type >
32 {
33  public:
36 
45  void SetStationIdentifier(std::string station_id) { fStationIdentity = station_id; }
46 
52  void SetPolarization(const std::string& pol)
53  {
54  fPol = pol;
55  make_upper(fPol);
56  };
57 
58 
64  void SetChannelToPCDelayMap(const std::map< std::string, double >& map) { fPCDelayMap = map; };
65 
66  protected:
74  virtual bool InitializeInPlace(visibility_type* in) override;
83  virtual bool InitializeOutOfPlace(const visibility_type* in, visibility_type* out) override;
84 
92  virtual bool ExecuteInPlace(visibility_type* in) override;
101  virtual bool ExecuteOutOfPlace(const visibility_type* in, visibility_type* out) override;
102 
103  private:
111  bool IsApplicable(std::size_t st_idx, const visibility_type* in);
119  bool PolMatch(std::size_t station_idx, std::string& polprod);
127  bool LabelMatch(std::string expected_chan_label, std::string given_chan_label);
128 
129  //constants
130  std::complex< double > fImagUnit;
131  double fDegToRad;
132  double fNanoSecToSecond;
133  double fMHzToHz;
134  double fPi;
135 
136  //selection
137  std::string fStationIdentity;
138  std::string fPol;
139 
140  //channel label -> pc delay
141  std::map< std::string, double > fPCDelayMap;
142 
143  //keys for tag retrieval
144  std::string fStationKey;
145  std::string fRemStationKey;
146  std::string fRefStationKey;
147  std::string fRemStationMk4IDKey;
148  std::string fRefStationMk4IDKey;
149  std::string fChannelLabelKey;
150  std::string fBandwidthKey;
151 
152  std::string fSidebandLabelKey;
153  std::string fLowerSideband;
154  std::string fUpperSideband;
155 
156  //minor helper function to make sure all strings are compared as upper-case only
157  void make_upper(std::string& s)
158  {
159  for(char& c : s)
160  {
161  c = toupper(c);
162  };
163  }
164 };
165 
166 } // namespace hops
167 
168 #endif
Class MHO_ManualChannelDelayCorrection.
Definition: MHO_ManualChannelDelayCorrection.hh:32
void SetChannelToPCDelayMap(const std::map< std::string, double > &map)
Setter for channel to pc_delay map.
Definition: MHO_ManualChannelDelayCorrection.hh:64
virtual bool ExecuteInPlace(visibility_type *in) override
Applies manual channel delay corrections in-place for reference or remote station.
Definition: MHO_ManualChannelDelayCorrection.cc:30
void SetStationIdentifier(std::string station_id)
Setter for station identifier.
Definition: MHO_ManualChannelDelayCorrection.hh:45
MHO_ManualChannelDelayCorrection()
Definition: MHO_ManualChannelDelayCorrection.cc:6
virtual bool InitializeOutOfPlace(const visibility_type *in, visibility_type *out) override
Initializes out-of-place visibility data from input data.
Definition: MHO_ManualChannelDelayCorrection.cc:248
virtual bool InitializeInPlace(visibility_type *in) override
Initializes in-place visibility_type pointer.
Definition: MHO_ManualChannelDelayCorrection.cc:243
virtual ~MHO_ManualChannelDelayCorrection()
Definition: MHO_ManualChannelDelayCorrection.cc:28
virtual bool ExecuteOutOfPlace(const visibility_type *in, visibility_type *out) override
Copies input visibility data and executes in-place correction.
Definition: MHO_ManualChannelDelayCorrection.cc:146
void SetPolarization(const std::string &pol)
Setter for polarization (associated with these delay corrections)
Definition: MHO_ManualChannelDelayCorrection.hh:52
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_ChannelLabeler.hh:17