HOPS
HOPS class reference
MHO_MixedPolYShift.hh
Go to the documentation of this file.
1 #ifndef MHO_MixedPolYShift_HH__
2 #define MHO_MixedPolYShift_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_MixedPolYShift: public MHO_UnaryOperator< visibility_type >
32 {
33  public:
35  virtual ~MHO_MixedPolYShift();
36 
37  //not called by the builder (yet)...
38  //this particular operator feature always uses 90 degrees
39  //but perhaps we could allow that to change via this setter
45  void SetPhaseOffset(const double& offset) { fYPolPhaseOffset = offset; }
46 
47  protected:
55  virtual bool InitializeInPlace(visibility_type* in) override;
64  virtual bool InitializeOutOfPlace(const visibility_type* in, visibility_type* out) override;
65 
73  virtual bool ExecuteInPlace(visibility_type* in) override;
82  virtual bool ExecuteOutOfPlace(const visibility_type* in, visibility_type* out) override;
83 
84  private:
92  bool IsApplicable(std::size_t st_idx, std::string polprod);
100  bool PolMatch(std::size_t station_idx, std::string& polprod);
101 
102  //constants
103  std::complex< double > fImagUnit;
104  double fDegToRad;
105 
106  //selection
107  std::string fStationIdentity;
108 
109  //phase rotation (90 degrees)
110  double fYPolPhaseOffset;
111 
112  //keys for tag retrieval
113  std::string fStationKey;
114  std::string fRemStationKey;
115  std::string fRefStationKey;
116  std::string fRemStationMk4IDKey;
117  std::string fRefStationMk4IDKey;
118  std::string fChannelLabelKey;
119 
120  std::string fSidebandLabelKey;
121  std::string fLowerSideband;
122  std::string fUpperSideband;
123 
124 
131  bool IsMixedLinCirc(std::string polprod) const;
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_MixedPolYShift.
Definition: MHO_MixedPolYShift.hh:32
void SetPhaseOffset(const double &offset)
Setter for phase offset applied to Y pol.
Definition: MHO_MixedPolYShift.hh:45
virtual ~MHO_MixedPolYShift()
Definition: MHO_MixedPolYShift.cc:15
virtual bool ExecuteOutOfPlace(const visibility_type *in, visibility_type *out) override
Copies input visibility data and executes in-place operation.
Definition: MHO_MixedPolYShift.cc:82
virtual bool InitializeInPlace(visibility_type *in) override
Initializes in-place for mixed polarization phase shift.
Definition: MHO_MixedPolYShift.cc:109
MHO_MixedPolYShift()
Definition: MHO_MixedPolYShift.cc:6
virtual bool InitializeOutOfPlace(const visibility_type *in, visibility_type *out) override
Initializes out-of-place operation for mixed polarization phase shift operation.
Definition: MHO_MixedPolYShift.cc:114
virtual bool ExecuteInPlace(visibility_type *in) override
Applies a phase offset for mixed polarization data in-place (to Y-pol).
Definition: MHO_MixedPolYShift.cc:17
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_ChannelLabeler.hh:17