HOPS
HOPS class reference
MHO_Notches.hh
Go to the documentation of this file.
1 #ifndef MHO_Notches_HH__
2 #define MHO_Notches_HH__
3 
4 #include <cctype>
5 #include <cmath>
6 #include <complex>
7 #include <map>
8 #include <utility>
9 #include <vector>
10 
11 #include "MHO_Constants.hh"
12 #include "MHO_MathUtilities.hh"
13 #include "MHO_Message.hh"
14 
16 #include "MHO_TableContainer.hh"
17 #include "MHO_UnaryOperator.hh"
18 
19 namespace hops
20 {
21 
33 class MHO_Notches: public MHO_UnaryOperator< visibility_type >
34 {
35  public:
36  MHO_Notches();
37  virtual ~MHO_Notches();
38 
44  void SetWeights(weight_type* weights) { fWeights = weights; };
45 
51  void SetNotchBoundaries(const std::vector< double >& notch_boundary_list)
52  {
53  fNotchBoundaries = notch_boundary_list;
54  std::size_t N = fNotchBoundaries.size();
55  if(N % 2 != 0)
56  {
57  msg_warn("calibration", "the number of notch boundaries passed ("
58  << N << ") is not a multiple of 2, malformed control input " << eom);
59  N = N - 1; //drop the last value, in effort to salvage it
60  }
61 
62  //loop over the notch boundaries pairing them up
63  for(std::size_t i = 0; i < N;)
64  {
65  double low = fNotchBoundaries[i];
66  double high = fNotchBoundaries[i + 1];
67  fNotches.push_back(std::make_pair(low, high));
68  i += 2;
69  }
70  }
71 
72  protected:
80  virtual bool InitializeInPlace(visibility_type* in) override;
89  virtual bool InitializeOutOfPlace(const visibility_type* in, visibility_type* out) override;
90 
98  virtual bool ExecuteInPlace(visibility_type* in) override;
107  virtual bool ExecuteOutOfPlace(const visibility_type* in, visibility_type* out) override;
108 
109  private:
110  std::string fBandwidthKey;
111  std::string fSidebandLabelKey;
112  std::string fLowerSideband;
113  std::string fUpperSideband;
114 
115  weight_type* fWeights;
116 
117  std::vector< double > fNotchBoundaries;
118  std::vector< std::pair< double, double > > fNotches;
119 };
120 
121 } // namespace hops
122 
123 #endif
#define msg_warn(xKEY, xCONTENT)
Definition: MHO_Message.hh:254
Class MHO_Notches.
Definition: MHO_Notches.hh:34
virtual ~MHO_Notches()
Definition: MHO_Notches.cc:16
MHO_Notches()
Definition: MHO_Notches.cc:8
void SetWeights(weight_type *weights)
Setter for weights.
Definition: MHO_Notches.hh:44
virtual bool InitializeInPlace(visibility_type *in) override
Initializes MHO_Notches in-place using provided visibility_type pointer.
Definition: MHO_Notches.cc:108
void SetNotchBoundaries(const std::vector< double > &notch_boundary_list)
Setter for notch (locations along frequency axis where visibilities are zeroed out) boundaries.
Definition: MHO_Notches.hh:51
virtual bool ExecuteInPlace(visibility_type *in) override
Applies filter to channels and spectral points based on defined notches.
Definition: MHO_Notches.cc:18
virtual bool ExecuteOutOfPlace(const visibility_type *in, visibility_type *out) override
Copies input visibility data and executes in-place processing.
Definition: MHO_Notches.cc:102
virtual bool InitializeOutOfPlace(const visibility_type *in, visibility_type *out) override
Initializes out-of-place visibility data from input pointer.
Definition: MHO_Notches.cc:113
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_ChannelLabeler.hh:17