HOPS
HOPS class reference
MHO_IonosphericFringeFitterOpenMP.hh
Go to the documentation of this file.
1 #ifndef MHO_IonosphericFringeFitterOpenMP_HH__
2 #define MHO_IonosphericFringeFitterOpenMP_HH__
3 
4 #include <memory>
5 #include <vector>
6 
9 #include "MHO_Tokenizer.hh"
10 
11 #ifdef _OPENMP
12  #include <omp.h>
13 #endif
14 
15 namespace hops
16 {
17 
19 {
20  double famp = 0.0;
21  double ion_diff = 0.0;
22  double coarse_sbd = 0.0;
23 };
24 
37 {
38 
39  public:
42 
47  virtual void Run() override;
48 
52  void Finalize() override;
53 
60  virtual void Accept(MHO_FringeFitterVisitor* visitor) override { visitor->Visit(this); };
61 
62  protected:
68  int rjc_ion_search();
69 
76  void sort_tecs(int nion, std::vector< std::vector< double > >& dtec);
77 
83  int ion_search_smooth();
84 
93  void smoother(double* f, double* g, double* tec_step, int* npts);
94 
101  double calculate_approx_snr(double famp);
102 
103  double fInitialSBWin[2]; //save the initial SBD window
104  int ion_npts;
105 
106  //per-thread infrastructure for parallel ion search
108  visibility_type fVisRef; //clean reference copy of vis_data (before any ion correction)
109 
110  std::vector< visibility_type > fPerThreadVis; //per-thread working vis copies
111  std::vector< visibility_type > fPerThreadSBD; //per-thread SBD output buffers
112  std::vector< std::unique_ptr< MHO_NormFX > > fPerThreadNormFX; //per-thread norm fx operator
113 
114  std::vector< std::unique_ptr< MHO_MBDelaySearch > > fPerThreadMBDSearch;
115  std::vector< std::unique_ptr< MHO_InterpolateFringePeakOptimized > > fPerThreadPeakInterp;
116  std::vector< std::unique_ptr< MHO_IonosphericPhaseCorrection > > fPerThreadIono;
117 
118  std::vector< IonLoopResult > fIonLoopResults; //one slot per ionloop index
119 
120  private:
121  void initialize_ion_threads();
122  void evaluate_ion_points(int start, int stop, double bottom, double step);
123  void lock_sbd_window(int ilmax, double bottom, double step, bool& first_pass);
124 };
125 
126 } // namespace hops
127 
128 #endif
Class MHO_BasicFringeFitter.
Definition: MHO_BasicFringeFitter.hh:35
Class MHO_FringeData.
Definition: MHO_FringeData.hh:30
Class MHO_FringeFitterVisitor.
Definition: Calibration/include/MHO_FringeFitter.hh:189
virtual void Visit(MHO_FringeFitter *fitter)=0
Function Visit.
Class MHO_IonosphericFringeFitterOpenMP.
Definition: MHO_IonosphericFringeFitterOpenMP.hh:37
void Finalize() override
Finalizes fringe fitting process by storing search windows and generating plot data.
Definition: MHO_IonosphericFringeFitterOpenMP.cc:93
virtual void Run() override
Runs fringe fitting process with additial search over dTEC (with optional smoothing)
Definition: MHO_IonosphericFringeFitterOpenMP.cc:49
std::vector< std::unique_ptr< MHO_MBDelaySearch > > fPerThreadMBDSearch
Definition: MHO_IonosphericFringeFitterOpenMP.hh:114
std::vector< std::unique_ptr< MHO_IonosphericPhaseCorrection > > fPerThreadIono
Definition: MHO_IonosphericFringeFitterOpenMP.hh:116
void smoother(double *f, double *g, double *tec_step, int *npts)
Applies a smoothing curve (half-cosine) to input data array for fringe finding in ionospheric process...
Definition: MHO_IonosphericFringeFitterOpenMP.cc:901
std::vector< std::unique_ptr< MHO_NormFX > > fPerThreadNormFX
Definition: MHO_IonosphericFringeFitterOpenMP.hh:112
int rjc_ion_search()
Searches for fringe peak in dtec/delay/delay-rate space.
Definition: MHO_IonosphericFringeFitterOpenMP.cc:242
std::vector< std::unique_ptr< MHO_InterpolateFringePeakOptimized > > fPerThreadPeakInterp
Definition: MHO_IonosphericFringeFitterOpenMP.hh:115
int ion_npts
Definition: MHO_IonosphericFringeFitterOpenMP.hh:104
int ion_search_smooth()
Searches for fringe peak while applying smoothing function (convolution w/ half-cosine).
Definition: MHO_IonosphericFringeFitterOpenMP.cc:613
visibility_type fVisRef
Definition: MHO_IonosphericFringeFitterOpenMP.hh:108
virtual void Accept(MHO_FringeFitterVisitor *visitor) override
Accepts and invokes a visitor to visit this object.
Definition: MHO_IonosphericFringeFitterOpenMP.hh:60
std::vector< visibility_type > fPerThreadSBD
Definition: MHO_IonosphericFringeFitterOpenMP.hh:111
MHO_IonosphericFringeFitterOpenMP(MHO_FringeData *data)
Definition: MHO_IonosphericFringeFitterOpenMP.cc:37
double fInitialSBWin[2]
Definition: MHO_IonosphericFringeFitterOpenMP.hh:103
double calculate_approx_snr(double famp)
Calculates approximate signal-to-noise ratio (SNR) for fringe fitting.
Definition: MHO_IonosphericFringeFitterOpenMP.cc:1034
int fNIonThreads
Definition: MHO_IonosphericFringeFitterOpenMP.hh:107
virtual ~MHO_IonosphericFringeFitterOpenMP()
Definition: MHO_IonosphericFringeFitterOpenMP.cc:44
std::vector< IonLoopResult > fIonLoopResults
Definition: MHO_IonosphericFringeFitterOpenMP.hh:118
std::vector< visibility_type > fPerThreadVis
Definition: MHO_IonosphericFringeFitterOpenMP.hh:110
void sort_tecs(int nion, std::vector< std::vector< double > > &dtec)
Sorts TEC arrays and stores them in parameter store.
Definition: MHO_IonosphericFringeFitterOpenMP.cc:573
Definition: fit_gsl.h:54
Definition: MHO_AdhocFlagging.hh:18
double famp
Definition: MHO_IonosphericFringeFitterOpenMP.hh:20
double coarse_sbd
Definition: MHO_IonosphericFringeFitterOpenMP.hh:22
double ion_diff
Definition: MHO_IonosphericFringeFitterOpenMP.hh:21
Definition: MHO_IonosphericFringeFitterOpenMP.hh:19