1 #ifndef MHO_DoubleSidebandChannelLabeler_HH__
2 #define MHO_DoubleSidebandChannelLabeler_HH__
63 auto chan_ax = &(std::get< CHANNEL_AXIS >(*in));
64 std::size_t nchans = chan_ax->GetSize();
66 int double_sideband_pair_counter = 0;
67 for(std::size_t ch = 0; ch < nchans - 1; ch++)
69 std::size_t next_ch = ch + 1;
70 double f1 = chan_ax->at(ch);
71 double f2 = chan_ax->at(next_ch);
75 bool bw1_present = chan_ax->RetrieveIndexLabelKeyValue(ch,
"bandwidth", bw1);
76 bool bw2_present = chan_ax->RetrieveIndexLabelKeyValue(next_ch,
"bandwidth", bw2);
78 if(std::abs(f1 - f2) < fEps && std::abs(bw1 - bw2) < fEps)
82 std::string nsb1 =
"";
83 std::string nsb2 =
"";
84 bool nsb1_present = chan_ax->RetrieveIndexLabelKeyValue(ch,
"net_sideband", nsb1);
85 bool nsb2_present = chan_ax->RetrieveIndexLabelKeyValue(next_ch,
"net_sideband", nsb2);
87 if(nsb1_present && nsb2_present)
91 if(nsb1 ==
"L" && nsb2 ==
"U")
94 chan_ax->InsertIntervalLabelKeyValue(ch, next_ch,
"double_sideband",
value);
97 chan_ax->InsertIndexLabelKeyValue(ch,
"dsb_partner", 1);
98 chan_ax->InsertIndexLabelKeyValue(next_ch,
"dsb_partner", -1);
100 double_sideband_pair_counter++;
Class MHO_DoubleSidebandChannelLabeler.
Definition: MHO_DoubleSidebandChannelLabeler.hh:33
virtual ~MHO_DoubleSidebandChannelLabeler()
Definition: MHO_DoubleSidebandChannelLabeler.hh:40
void SetTolerance(double tol)
Setter for tolerance - in (MHz) when checking if channels share a sky freq.
Definition: MHO_DoubleSidebandChannelLabeler.hh:48
virtual bool ExecuteInPlace(XArrayType *in) override
Function ExecuteInPlace labels LSB/USB channel pairs as "double sideband" channels if they share and ...
Definition: MHO_DoubleSidebandChannelLabeler.hh:58
MHO_DoubleSidebandChannelLabeler()
Definition: MHO_DoubleSidebandChannelLabeler.hh:35
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_AdhocFlagging.hh:18