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(double offset) { fYPolPhaseOffset = offset; }
46 
47  protected:
55  virtual bool ExecuteInPlace(visibility_type* in) override;
56 
57  private:
65  bool IsApplicable(std::size_t st_idx, std::string polprod);
73  bool PolMatch(std::size_t station_idx, std::string& polprod);
74 
75  //constants
76  std::complex< double > fImagUnit;
77  double fDegToRad;
78 
79  //selection
80  std::string fStationIdentity;
81 
82  //phase rotation (90 degrees)
83  double fYPolPhaseOffset;
84 
85  //keys for tag retrieval
86  std::string fStationKey;
87  std::string fRemStationKey;
88  std::string fRefStationKey;
89  std::string fRemStationMk4IDKey;
90  std::string fRefStationMk4IDKey;
91  std::string fChannelLabelKey;
92 
93  std::string fSidebandLabelKey;
94  std::string fLowerSideband;
95  std::string fUpperSideband;
96 
103  bool IsMixedLinCirc(std::string polprod) const;
104 
105  //minor helper function to make sure all strings are compared as upper-case only
106  void make_upper(std::string& s)
107  {
108  for(char& c : s)
109  {
110  c = toupper(c);
111  };
112  }
113 };
114 
115 } // namespace hops
116 
117 #endif
Class MHO_MixedPolYShift.
Definition: MHO_MixedPolYShift.hh:32
virtual ~MHO_MixedPolYShift()
Definition: MHO_MixedPolYShift.cc:15
void SetPhaseOffset(double offset)
Setter for phase offset applied to Y pol.
Definition: MHO_MixedPolYShift.hh:45
MHO_MixedPolYShift()
Definition: MHO_MixedPolYShift.cc:6
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_AdhocFlagging.hh:18