HOPS
HOPS class reference
MHO_SpectralLineFringeSearch.hh
Go to the documentation of this file.
1 #ifndef MHO_SpectralLineFringeSearch_HH__
2 #define MHO_SpectralLineFringeSearch_HH__
3 
4 #include <cmath>
5 #include <complex>
6 
8 #include "MHO_CyclicRotator.hh"
10 
11 #ifdef HOPS_USE_FFTW3
13 #else
15 #endif
16 
17 namespace hops
18 {
19 
40 class MHO_SpectralLineFringeSearch: public MHO_InspectingOperator< visibility_type >
41 {
42  public:
45 
49  void SetWeights(weight_type* wt_data) { fWeights = wt_data; }
50 
54  void SetReferenceFrequency(double ref_freq_mhz) { fRefFreq = ref_freq_mhz; }
55 
59  void SetDRWindow(double low, double high);
60 
64  void GetDRWindow(double& low, double& high) const;
65 
70  void SetFrequencyWindow(double low_mhz, double high_mhz);
71 
75  void GetFrequencyWindow(double& low_mhz, double& high_mhz) const;
76 
78  int GetChanMaxBin() const { return fChanMaxBin; }
79 
81  int GetDRMaxBin() const { return fDRMaxBin; }
82 
84  int GetFreqMaxBin() const { return fFreqMaxBin; }
85 
87  double GetCoarseDR() const { return fCoarseDR; }
88 
93  double GetCoarsePeakSkyFrequencyMHz() const { return fCoarsePeakSkyFreqMHz; }
94 
96  double GetSearchMaximumAmplitude() const { return fMax; }
97 
99  int GetNDRBins() const { return static_cast< int >(fNDR); }
100 
102  double GetDRBinSeparation() const { return fDRBinSep; }
103 
108  delay_rate_axis_type* GetDRAxis() { return &fDRAxis; }
109 
114  visibility_type* GetSpecDRData() { return &fSpecDRWorkspace; }
115 
116  protected:
118 
119  virtual bool InitializeImpl(const XArgType* in) override;
120  virtual bool ExecuteImpl(const XArgType* in) override;
121 
122  private:
123  void SetWindow(double* win, double low, double high);
124 
125  weight_type* fWeights;
126  double fRefFreq; // MHz
127 
128  bool fDRWinSet;
129  bool fFreqWinSet;
130  double fDRWin[2]; // sec/sec
131  double fFreqWin[2]; // MHz
132 
133  bool fInitialized;
134 
135  std::size_t fNAP; // original number of accumulation periods
136  std::size_t fNPaddedAP; // zero-padded size (next power of 2 >= 2*N_AP)
137  std::size_t fNChan;
138  std::size_t fNFreq;
139  std::size_t fNDR; // = fNPaddedAP
140 
141  double fDRBinSep; // sec/sec
142 
143  int fChanMaxBin;
144  int fDRMaxBin;
145  int fFreqMaxBin;
146 
147  double fCoarseDR;
148  double fCoarsePeakSkyFreqMHz;
149  double fMax;
150 
151  delay_rate_axis_type fDRAxis;
152 
153  // Internal workspace: [1][N_chan][N_padded_AP][N_freq]
154  // Filled with weighted visibilities, then transformed in-place by the FFT engine.
155  visibility_type fSpecDRWorkspace;
156 
157 #ifdef HOPS_USE_FFTW3
159 #else
161 #endif
162 
163  FFT_ENGINE_TYPE fFFTEngine;
165 };
166 
167 } // namespace hops
168 
169 #endif
Class MHO_CyclicRotator.
Definition: MHO_CyclicRotator.hh:29
Class MHO_InspectingOperator.
Definition: MHO_InspectingOperator.hh:21
Class MHO_MultidimensionalFastFourierTransformFFTW.
Definition: MHO_MultidimensionalFastFourierTransformFFTW.hh:37
Class MHO_SpectralLineFringeSearch.
Definition: MHO_SpectralLineFringeSearch.hh:41
void SetWeights(weight_type *wt_data)
Set the weight array (per polprod x channel x AP, freq dim ignored).
Definition: MHO_SpectralLineFringeSearch.hh:49
void SetDRWindow(double low, double high)
Restrict the delay-rate search to low, high.
Definition: MHO_SpectralLineFringeSearch.cc:53
void SetFrequencyWindow(double low_mhz, double high_mhz)
Restrict the frequency search to channels whose sky frequency falls in [low_mhz, high_mhz]....
Definition: MHO_SpectralLineFringeSearch.cc:79
double GetSearchMaximumAmplitude() const
Raw (un-normalised) amplitude at the search maximum.
Definition: MHO_SpectralLineFringeSearch.hh:96
void SetReferenceFrequency(double ref_freq_mhz)
Set the reference frequency in MHz (used to convert fringe rate -> delay rate).
Definition: MHO_SpectralLineFringeSearch.hh:54
delay_rate_axis_type * GetDRAxis()
Pointer to the delay-rate axis (size = GetNDRBins()). Values are delay rates in sec/sec,...
Definition: MHO_SpectralLineFringeSearch.hh:108
int GetDRMaxBin() const
Delay-rate bin index of the coarse peak (-1 if not found).
Definition: MHO_SpectralLineFringeSearch.hh:81
virtual bool ExecuteImpl(const XArgType *in) override
Inspects a single const array.
Definition: MHO_SpectralLineFringeSearch.cc:187
int GetChanMaxBin() const
Channel index of the coarse peak (-1 if not found).
Definition: MHO_SpectralLineFringeSearch.hh:78
double GetCoarsePeakSkyFrequencyMHz() const
Sky frequency (MHz) at the coarse peak channel. This is the CHANNEL_AXIS value for the peak channel.
Definition: MHO_SpectralLineFringeSearch.hh:93
int GetNDRBins() const
Number of delay-rate bins after zero-padding.
Definition: MHO_SpectralLineFringeSearch.hh:99
virtual bool InitializeImpl(const XArgType *in) override
initializes inspection for a single const array of type XArgType.
Definition: MHO_SpectralLineFringeSearch.cc:92
MHO_SpectralLineFringeSearch()
Definition: MHO_SpectralLineFringeSearch.cc:6
double GetCoarseDR() const
Delay rate (sec/sec) at the coarse peak.
Definition: MHO_SpectralLineFringeSearch.hh:87
double GetDRBinSeparation() const
Delay-rate bin spacing (sec/sec).
Definition: MHO_SpectralLineFringeSearch.hh:102
virtual ~MHO_SpectralLineFringeSearch()
Definition: MHO_SpectralLineFringeSearch.cc:36
visibility_type * GetSpecDRData()
Pointer to the internal (channel x DR x freq) workspace. Valid after Execute(); used by MHO_Interpola...
Definition: MHO_SpectralLineFringeSearch.hh:114
void GetDRWindow(double &low, double &high) const
Retrieve the delay-rate window actually used (sec/sec).
Definition: MHO_SpectralLineFringeSearch.cc:60
void GetFrequencyWindow(double &low_mhz, double &high_mhz) const
Retrieve the sky-frequency search window (MHz).
Definition: MHO_SpectralLineFringeSearch.cc:86
int GetFreqMaxBin() const
Intra-channel frequency bin index of the coarse peak (-1 if not found).
Definition: MHO_SpectralLineFringeSearch.hh:84
Definition: MHO_AdhocFlagging.hh:18
MHO_TableContainer< visibility_element_type, baseline_axis_pack > visibility_type
Definition: MHO_BaselineContainers.hh:52