HOPS
HOPS class reference
MHO_ComputePlotData.hh
Go to the documentation of this file.
1 #ifndef MHO_ComputePlotData_HH__
2 #define MHO_ComputePlotData_HH__
3 
5 #include "MHO_TableContainer.hh"
6 
7 #include "MHO_BinaryOperator.hh"
9 #include "MHO_CyclicRotator.hh"
10 #include "MHO_FringeRotation.hh"
12 #include "MHO_MathUtilities.hh"
13 #include "MHO_NaNMasker.hh"
14 #include "MHO_SubSample.hh"
15 
16 #include "MHO_ContainerStore.hh"
17 #include "MHO_OperatorToolbox.hh"
18 #include "MHO_ParameterStore.hh"
19 
20 #ifdef HOPS_USE_FFTW3
21  #include "MHO_FFTWTypes.hh"
23 #else
25 #endif
26 
28 
29 #include "MHO_JSONHeaderWrapper.hh"
30 
31 namespace hops
32 {
33 
46 {
47  public:
49  virtual ~MHO_ComputePlotData(){};
50 
55 
60 
66  void SetMBDAnchor(std::string flag) { fMBDAnchor = flag; }
67 
73  void SetOperatorToolbox(MHO_OperatorToolbox* toolbox) { fToolbox = toolbox; }
74 
81 
87  void SetParameterStore(MHO_ParameterStore* pStore) { fParamStore = pStore; }
88 
94  void SetVexInfo(const mho_json& vex_info) { fVexInfo = vex_info; }
95 
99  void Initialize();
100 
106  void DumpInfoToJSON(mho_json& plot_dict);
107 
108  //protected:
109 
110  TODO_FIXME_MSG("TODO FIXME, temporary kludge to pass sbd amp data for test")
141 
142  // visibility_type* calc_corrected_vis();
146  void correct_vis();
147 
153  double calc_phase();
154 
167  void calc_freqrms(phasor_type& phasors, double coh_avg_phase, double fringe_amp, double total_summed_weights,
168  double snr, double& freqrms_phase, double& freqrms_amp, double& inc_avg_amp_freq);
169 
184  void calc_timerms(phasor_type& phasors, std::size_t nseg, std::size_t apseg, double coh_avg_phase, double fringe_amp,
185  double total_summed_weights, double snr, double& timerms_phase, double& timerms_amp,
186  double& inc_avg_amp);
187 
188  //exports the multitone pcal data (if it was applied)
189  //to the plot dictionary
190  void dump_multitone_pcmodel(mho_json& plot_dict,
191  int station_flag, //0 = reference station, 1 = remote station,
192  std::string pol //single char string
193  );
194 
195  //exports the manual pcal data (pc_phases)
196  //to the plot dictionary
197  void dump_manual_pcmodel(mho_json& plot_dict,
198  int station_flag, //0 = reference station, 1 = remote station,
199  std::string pol //single char string
200  );
201 
205  std::string calc_quality_code(); //quality only, not error
206 
210  std::string calc_error_code(const mho_json& plot_dict);
211 
212  double fRefFreq;
214  double fMBDelay;
215  double fDelayRate;
216  double fFringeRate;
217  double fSBDelay;
218  double fAmp;
219 
220  std::size_t fSBDMaxBin;
221 
222  bool fValid;
226 
229 
232 
234 
239 
242 
243  //class which implements vrot
245 
246  //flag for mbd anchor
247  std::string fMBDAnchor;
248 
249  //space for xpower spectrum and sbdbox
250  std::vector< double > fSBDBox;
251  std::vector< int > fNUSBAP;
252  std::vector< int > fNLSBAP;
253 
254  //constants
255  std::complex< double > fImagUnit;
256 };
257 
258 } // namespace hops
259 
260 #endif
nlohmann::json mho_json
Definition: MHO_JSONHeaderWrapper.hh:5
#define TODO_FIXME_MSG(x)
Definition: MHO_Message.hh:35
Class MHO_ComputePlotData.
Definition: MHO_ComputePlotData.hh:46
visibility_type * fSBDArray
Definition: MHO_ComputePlotData.hh:224
xpower_amp_type fDRAmpWorkspace
Definition: MHO_ComputePlotData.hh:228
double calc_phase()
Calculates fringe phase using weighted sum and fitted (delay, delay-rate) rotation.
Definition: MHO_ComputePlotData.cc:613
double fRefFreq
Definition: MHO_ComputePlotData.hh:212
std::string fMBDAnchor
Definition: MHO_ComputePlotData.hh:247
void dump_multitone_pcmodel(mho_json &plot_dict, int station_flag, std::string pol)
Definition: MHO_ComputePlotData.cc:1686
std::string calc_quality_code()
calcuates the fringe quality code
Definition: MHO_ComputePlotData.cc:1442
MHO_OperatorToolbox * fToolbox
Definition: MHO_ComputePlotData.hh:237
void DisableOptimizeClosure()
Disables optimize closure by setting underlying MHO_FringeRotation (fRot) optimizeClosure to false.
Definition: MHO_ComputePlotData.hh:59
MHO_CyclicRotator< xpower_type > fCyclicRotator
Definition: MHO_ComputePlotData.hh:241
xpower_type fFringe
Definition: MHO_ComputePlotData.hh:233
MHO_ContainerStore * fContainerStore
Definition: MHO_ComputePlotData.hh:235
double fMBDelay
Definition: MHO_ComputePlotData.hh:214
std::vector< int > fNUSBAP
Definition: MHO_ComputePlotData.hh:251
virtual ~MHO_ComputePlotData()
Definition: MHO_ComputePlotData.hh:49
xpower_amp_type calc_dr()
Calculates delay-rate (dr) function (amplitude vs delay rate)
Definition: MHO_ComputePlotData.cc:508
std::size_t fSBDMaxBin
Definition: MHO_ComputePlotData.hh:220
double fFringeRate
Definition: MHO_ComputePlotData.hh:216
void calc_freqrms(phasor_type &phasors, double coh_avg_phase, double fringe_amp, double total_summed_weights, double snr, double &freqrms_phase, double &freqrms_amp, double &inc_avg_amp_freq)
Calculates frequency root mean square (phase and amplitude) for given phasors.
Definition: MHO_ComputePlotData.cc:1255
double fSBDelay
Definition: MHO_ComputePlotData.hh:217
void SetVexInfo(const mho_json &vex_info)
Setter for vex info.
Definition: MHO_ComputePlotData.hh:94
xpower_type fMBDWorkspace
Definition: MHO_ComputePlotData.hh:230
mho_json fVexInfo
Definition: MHO_ComputePlotData.hh:238
MHO_FringeRotation fRot
Definition: MHO_ComputePlotData.hh:244
xpower_amp_type calc_mbd()
Calculates Multi-Band Delay (MBD) function (amplitude vs. mbd)
Definition: MHO_ComputePlotData.cc:76
std::vector< int > fNLSBAP
Definition: MHO_ComputePlotData.hh:252
void DumpInfoToJSON(mho_json &plot_dict)
Dumps fringe plot data into a JSON object for visualization/consumption by plotting routine.
Definition: MHO_ComputePlotData.cc:951
weight_type * fWeights
Definition: MHO_ComputePlotData.hh:225
void SetOperatorToolbox(MHO_OperatorToolbox *toolbox)
Setter for operator toolbox.
Definition: MHO_ComputePlotData.hh:73
void SetContainerStore(MHO_ContainerStore *cStore)
Setter for container store.
Definition: MHO_ComputePlotData.hh:80
double fDelayRate
Definition: MHO_ComputePlotData.hh:215
std::complex< double > fImagUnit
Definition: MHO_ComputePlotData.hh:255
double fAmp
Definition: MHO_ComputePlotData.hh:218
std::vector< double > fSBDBox
Definition: MHO_ComputePlotData.hh:250
void correct_vis()
Corrects visibility data by applying fringe solution.
Definition: MHO_ComputePlotData.cc:374
xpower_type fDRWorkspace
Definition: MHO_ComputePlotData.hh:227
MHO_ParameterStore * fParamStore
Definition: MHO_ComputePlotData.hh:236
void SetMBDAnchor(std::string flag)
Setter for mbd anchor (either: 'sbd' or 'model')
Definition: MHO_ComputePlotData.hh:66
xpower_amp_type fMBDAmpWorkspace
Definition: MHO_ComputePlotData.hh:231
void calc_timerms(phasor_type &phasors, std::size_t nseg, std::size_t apseg, double coh_avg_phase, double fringe_amp, double total_summed_weights, double snr, double &timerms_phase, double &timerms_amp, double &inc_avg_amp)
Calculates time-domain measurements (phase, amplitude, average) from phasors data.
Definition: MHO_ComputePlotData.cc:1325
std::string calc_error_code(const mho_json &plot_dict)
calcuates the fringe error code
Definition: MHO_ComputePlotData.cc:1499
void dump_manual_pcmodel(mho_json &plot_dict, int station_flag, std::string pol)
Definition: MHO_ComputePlotData.cc:1858
bool fValid
Definition: MHO_ComputePlotData.hh:222
xpower_type calc_xpower_spec()
Calculates and returns the cross-power spectrum for a given SBD array.
Definition: MHO_ComputePlotData.cc:700
xpower_amp_type calc_sbd()
Calculates Single Band Delay (SBD) function (amplitude vs. sbd)
Definition: MHO_ComputePlotData.cc:201
phasor_type calc_segs()
Calculates and returns time-averaged phasor segments for each channel.
Definition: MHO_ComputePlotData.cc:283
void EnableOptimizeClosure()
Sets optimize closure to true in underlying MHO_FringeRotation (fRot) object.
Definition: MHO_ComputePlotData.hh:54
void Initialize()
Initializes member variables by retrieving values from parameter and container stores.
Definition: MHO_ComputePlotData.cc:40
MHO_ComputePlotData()
Definition: MHO_ComputePlotData.cc:27
double fTotalSummedWeights
Definition: MHO_ComputePlotData.hh:213
visibility_type * fVisibilities
Definition: MHO_ComputePlotData.hh:223
MHO_MultidimensionalFastFourierTransform< xpower_type > fFFTEngine
Definition: MHO_ComputePlotData.hh:240
void SetParameterStore(MHO_ParameterStore *pStore)
Setter for parameter store.
Definition: MHO_ComputePlotData.hh:87
Class MHO_ContainerStore.
Definition: MHO_ContainerStore.hh:32
Class MHO_CyclicRotator.
Definition: MHO_CyclicRotator.hh:29
Class MHO_FringeRotation.
Definition: MHO_FringeRotation.hh:22
void SetOptimizeClosureTrue()
Setter for optimize closure true.
Definition: MHO_FringeRotation.hh:78
void SetOptimizeClosureFalse()
Setter for optimize closure false.
Definition: MHO_FringeRotation.hh:83
Class MHO_MultidimensionalFastFourierTransform.
Definition: MHO_MultidimensionalFastFourierTransform.hh:35
Class MHO_OperatorToolbox.
Definition: MHO_OperatorToolbox.hh:26
Class MHO_ParameterStore.
Definition: MHO_ParameterStore.hh:52
Definition: MHO_ChannelLabeler.hh:17