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 
45  void SetStationIdentifier(const std::string& id) { fStationIdentities = {id}; }
46 
47  void SetStationIdentifiers(const std::vector< std::string >& ids) { fStationIdentities = ids; }
48 
49  std::string GetStationIdentifier() const
50  {
51  return fStationIdentities.empty() ? std::string("") : fStationIdentities[0];
52  }
53 
59  void SetLSBPhaseOffset(double lsb_offset) { fLSBPhaseOffset = lsb_offset; }
60 
61  protected:
69  virtual bool ExecuteInPlace(visibility_type* in) override;
70 
71  private:
79  bool IsApplicable(std::size_t st_idx, const visibility_type* in);
87  bool PolMatch(std::size_t station_idx, std::string& polprod);
88 
89  //constants
90  std::complex< double > fImagUnit;
91  double fDegToRad;
92 
93  //selection
94  std::vector< std::string > fStationIdentities;
95 
96  //pc rotation
97  double fLSBPhaseOffset;
98 
99  //keys for tag retrieval
100  std::string fStationKey;
101  std::string fRemStationKey;
102  std::string fRefStationKey;
103  std::string fRemStationMk4IDKey;
104  std::string fRefStationMk4IDKey;
105  std::string fChannelLabelKey;
106 
107  std::string fSidebandLabelKey;
108  std::string fLowerSideband;
109  std::string fUpperSideband;
110 
111  //minor helper function to make sure all strings are compared as upper-case only
112  void make_upper(std::string& s)
113  {
114  for(char& c : s)
115  {
116  c = toupper(c);
117  };
118  }
119 };
120 
121 } // namespace hops
122 
123 #endif
Class MHO_LSBOffset.
Definition: MHO_LSBOffset.hh:32
virtual ~MHO_LSBOffset()
Definition: MHO_LSBOffset.cc:20
virtual bool ExecuteInPlace(visibility_type *in) override
Applies LSB phase offset to appropriate channels in-place.
Definition: MHO_LSBOffset.cc:22
void SetStationIdentifier(const std::string &id)
Setter for station identifier.
Definition: MHO_LSBOffset.hh:45
void SetStationIdentifiers(const std::vector< std::string > &ids)
Definition: MHO_LSBOffset.hh:47
std::string GetStationIdentifier() const
Definition: MHO_LSBOffset.hh:49
void SetLSBPhaseOffset(double lsb_offset)
set lsb (phase) offset for double-sideband channels
Definition: MHO_LSBOffset.hh:59
MHO_LSBOffset()
Definition: MHO_LSBOffset.cc:6
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_AdhocFlagging.hh:18