HOPS
HOPS class reference
MHO_LSBOffset.hh
Go to the documentation of this file.
1 #ifndef MHO_LSBOffset_HH__
2 #define MHO_LSBOffset_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_LSBOffset: public MHO_UnaryOperator< visibility_type >
32 {
33  public:
34  MHO_LSBOffset();
35  virtual ~MHO_LSBOffset();
36 
37 
46  void SetStationIdentifier(std::string station_id) { fStationIdentity = station_id; }
47 
48 
54  void SetLSBPhaseOffset(const double& lsb_offset) { fLSBPhaseOffset = lsb_offset; }
55 
56  protected:
64  virtual bool InitializeInPlace(visibility_type* in) override;
73  virtual bool InitializeOutOfPlace(const visibility_type* in, visibility_type* out) override;
74 
82  virtual bool ExecuteInPlace(visibility_type* in) override;
91  virtual bool ExecuteOutOfPlace(const visibility_type* in, visibility_type* out) override;
92 
93  private:
101  bool IsApplicable(std::size_t st_idx, const visibility_type* in);
109  bool PolMatch(std::size_t station_idx, std::string& polprod);
110 
111  //constants
112  std::complex< double > fImagUnit;
113  double fDegToRad;
114 
115  //selection
116  std::string fStationIdentity;
117 
118  //pc rotation
119  double fLSBPhaseOffset;
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  std::string fChannelLabelKey;
128 
129  std::string fSidebandLabelKey;
130  std::string fLowerSideband;
131  std::string fUpperSideband;
132 
133  //minor helper function to make sure all strings are compared as upper-case only
134  void make_upper(std::string& s)
135  {
136  for(char& c : s)
137  {
138  c = toupper(c);
139  };
140  }
141 };
142 
143 } // namespace hops
144 
145 #endif
Class MHO_LSBOffset.
Definition: MHO_LSBOffset.hh:32
virtual ~MHO_LSBOffset()
Definition: MHO_LSBOffset.cc:21
virtual bool ExecuteOutOfPlace(const visibility_type *in, visibility_type *out) override
Copies input visibility data and executes in-place processing.
Definition: MHO_LSBOffset.cc:64
virtual bool ExecuteInPlace(visibility_type *in) override
Applies LSB phase offset to appropriate channels in-place.
Definition: MHO_LSBOffset.cc:23
void SetStationIdentifier(std::string station_id)
Setter for station identifier.
Definition: MHO_LSBOffset.hh:46
virtual bool InitializeInPlace(visibility_type *in) override
Initializes MHO_LSBOffset in-place using provided visibility_type pointer.
Definition: MHO_LSBOffset.cc:115
void SetLSBPhaseOffset(const double &lsb_offset)
set lsb (phase) offset for double-sideband channels
Definition: MHO_LSBOffset.hh:54
virtual bool InitializeOutOfPlace(const visibility_type *in, visibility_type *out) override
Initializes out-of-place visibility data from input data.
Definition: MHO_LSBOffset.cc:120
MHO_LSBOffset()
Definition: MHO_LSBOffset.cc:6
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_ChannelLabeler.hh:17