HOPS
HOPS class reference
MHO_DiFXChannelNameConstructor.hh
Go to the documentation of this file.
1 #ifndef MHO_DiFXChannelNameConstructor_HH__
2 #define MHO_DiFXChannelNameConstructor_HH__
3 
4 #include <map>
5 #include <sstream>
6 #include <string>
7 #include <vector>
8 
10 #include "MHO_Message.hh"
11 #include "MHO_SkyFreqGrid.hh"
12 
13 namespace hops
14 {
15 
29 {
30  public:
33 
41  void AddBandLabel(std::string band_label, double freq_low, double freq_high);
42 
48  void AddChannelNames(mho_json& vex_root);
49 
60  void SetGlobalSkyFreqGrid(const std::vector< double >& grid_MHz, double tol = MHO_SkyFreqGrid::DEFAULT_TOL_MHZ)
61  {
62  fGlobalGrid = MHO_SkyFreqGrid(grid_MHz, tol);
63  fHasGlobalGrid = true;
64  }
65 
74  void SetScanName(std::string scan_id) { fScanID = scan_id; }
75 
76  private:
83  std::string BandLabelFromSkyFreq(double sky_freq);
84 
88  struct band_range
89  {
90  double fLow;
91  double fHigh;
92  std::string fLabel;
93  };
94 
95  std::vector< band_range > fBandRangeLabels;
96  std::string fScanID;
97 
98  //scan-wide canonical grid (set by SetGlobalSkyFreqGrid); used by AddChannelNames
99  //when fHasGlobalGrid is true. When a per-station table has no chan_def on the
100  //global grid we temporarily swap in a per-table grid (see AddChannelNames).
101  MHO_SkyFreqGrid fGlobalGrid;
102  bool fHasGlobalGrid; //true if SetGlobalSkyFreqGrid has been called for this scan
103 };
104 
105 } // namespace hops
106 
107 #endif
nlohmann::json mho_json
Definition: MHO_JSONHeaderWrapper.hh:5
Class MHO_DiFXChannelNameConstructor.
Definition: MHO_DiFXChannelNameConstructor.hh:29
void AddChannelNames(mho_json &vex_root)
Adds channel names to VEX experiment data based on scan and mode information.
Definition: MHO_DiFXChannelNameConstructor.cc:29
void SetGlobalSkyFreqGrid(const std::vector< double > &grid_MHz, double tol=MHO_SkyFreqGrid::DEFAULT_TOL_MHZ)
Provide a precomputed global sky-frequency grid (MHz, sorted ascending, deduped). When set,...
Definition: MHO_DiFXChannelNameConstructor.hh:60
void AddBandLabel(std::string band_label, double freq_low, double freq_high)
Adds a frequency range for a specific band label.
Definition: MHO_DiFXChannelNameConstructor.cc:19
void SetScanName(std::string scan_id)
Setter for scan name if the (o)vex file has more than one scan, we may want to specify a specific one...
Definition: MHO_DiFXChannelNameConstructor.hh:74
virtual ~MHO_DiFXChannelNameConstructor()
Definition: MHO_DiFXChannelNameConstructor.cc:16
MHO_DiFXChannelNameConstructor()
Definition: MHO_DiFXChannelNameConstructor.cc:10
Creates a sorted, tolerance-deduplicated list of sky frequencies (MHz) with indexed lookup....
Definition: MHO_SkyFreqGrid.hh:23
static constexpr double DEFAULT_TOL_MHZ
Definition: MHO_SkyFreqGrid.hh:25
Definition: MHO_AdhocFlagging.hh:18