HOPS
HOPS class reference
MHO_EstimatePCManual.hh
Go to the documentation of this file.
1 #ifndef MHO_EstimatePCManual_HH__
2 #define MHO_EstimatePCManual_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 
15 #include "MHO_ParameterStore.hh"
16 #include "MHO_TableContainer.hh"
17 
18 namespace hops
19 {
20 
32 class MHO_EstimatePCManual: public MHO_InspectingOperator< visibility_type >
33 {
34  public:
36  virtual ~MHO_EstimatePCManual();
37 
43  void SetWeights(const weight_type* weights) { fWeights = weights; }
44 
50  void SetPhasors(phasor_type* phasors) { fPhasors = phasors; };
51 
57  void SetParameterStore(MHO_ParameterStore* paramStore) { fParameterStore = paramStore; };
58 
64  void SetPlotData(mho_json& plot_data) { fPlotData.FillData(plot_data); }
65 
66  protected:
74  virtual bool InitializeImpl(const visibility_type* in) override { return true; };
75 
83  virtual bool ExecuteImpl(const visibility_type* in) override;
84 
85  private:
94  double get_manual_phasecal(int is_remote, int channel_idx, std::string pol);
103  double get_manual_delayoff(int is_remote, int channel_idx, std::string pol);
104 
105  MHO_ParameterStore fPlotData;
106  MHO_ParameterStore* fParameterStore;
107  phasor_type* fPhasors;
108  const weight_type* fWeights;
109  const visibility_type* fVisibilities;
110 
116  void est_pc_manual(int mode);
123  void est_phases(int is_ref, int keep);
124 
143  void adj_delays(double sbd_max, double* sbd, double* esd, double delta_delay, int first, int final, int is_ref,
144  int how);
151  void est_delays(int is_ref, int how);
157  void est_offset(int is_ref);
158  void masthead(int mode, std::string root_file, int first_ch, int final_ch);
159 
160  void fill_sbd(std::vector< std::string >& ch_labels, std::vector< double >& sbd);
161 
162  std::string fRemStationMk4ID;
163  std::string fRefStationMk4ID;
164  std::string fRemStationPol;
165  std::string fRefStationPol;
166 
167  // //minor helper function to make sure all strings are compared as upper-case only
168  // void make_upper(std::string& s){ for(char& c : s){c = toupper(c); };
169 
170  std::map< std::string, int > fChannelLabel2Index;
171  std::map< int, std::string > fIndex2ChannelLabel;
172 };
173 
174 } // namespace hops
175 
176 #endif
nlohmann::json mho_json
Definition: MHO_JSONHeaderWrapper.hh:5
Class MHO_EstimatePCManual.
Definition: MHO_EstimatePCManual.hh:33
void SetParameterStore(MHO_ParameterStore *paramStore)
Setter for parameter store.
Definition: MHO_EstimatePCManual.hh:57
void SetPlotData(mho_json &plot_data)
Setter for plot data.
Definition: MHO_EstimatePCManual.hh:64
virtual ~MHO_EstimatePCManual()
Definition: MHO_EstimatePCManual.cc:67
void SetPhasors(phasor_type *phasors)
Setter for visibility channel phasors.
Definition: MHO_EstimatePCManual.hh:50
virtual bool ExecuteImpl(const visibility_type *in) override
Executes manual PC estimation using input visibility data.
Definition: MHO_EstimatePCManual.cc:69
MHO_EstimatePCManual()
Definition: MHO_EstimatePCManual.cc:66
virtual bool InitializeImpl(const visibility_type *in) override
Initializes implementation using input visibility type.
Definition: MHO_EstimatePCManual.hh:74
void SetWeights(const weight_type *weights)
Setter for weights.
Definition: MHO_EstimatePCManual.hh:43
Class MHO_InspectingOperator.
Definition: MHO_InspectingOperator.hh:22
Class MHO_ParameterStore.
Definition: MHO_ParameterStore.hh:52
void FillData(const mho_json &data)
Stores input json data for later use.
Definition: MHO_ParameterStore.hh:87
Definition: MHO_ChannelLabeler.hh:17