1 #ifndef MHO_DoubleSidebandChannelLabeler_HH__
2 #define MHO_DoubleSidebandChannelLabeler_HH__
82 auto chan_ax = &(std::get< CHANNEL_AXIS >(*in));
83 std::size_t nchans = chan_ax->GetSize();
85 int double_sideband_pair_counter = 0;
86 for(std::size_t ch = 0; ch < nchans - 1; ch++)
88 std::size_t next_ch = ch + 1;
89 double f1 = chan_ax->at(ch);
90 double f2 = chan_ax->at(next_ch);
94 bool bw1_present = chan_ax->RetrieveIndexLabelKeyValue(ch,
"bandwidth", bw1);
95 bool bw2_present = chan_ax->RetrieveIndexLabelKeyValue(next_ch,
"bandwidth", bw2);
97 if(std::abs(f1 - f2) < fEps && std::abs(bw1 - bw2) < fEps)
101 std::string nsb1 =
"";
102 std::string nsb2 =
"";
103 bool nsb1_present = chan_ax->RetrieveIndexLabelKeyValue(ch,
"net_sideband", nsb1);
104 bool nsb2_present = chan_ax->RetrieveIndexLabelKeyValue(next_ch,
"net_sideband", nsb2);
106 if(nsb1_present && nsb2_present)
110 if(nsb1 ==
"L" && nsb2 ==
"U")
113 chan_ax->InsertIntervalLabelKeyValue(ch, next_ch,
"double_sideband",
value);
116 chan_ax->InsertIndexLabelKeyValue(ch,
"dsb_partner", 1);
117 chan_ax->InsertIndexLabelKeyValue(next_ch,
"dsb_partner", -1);
119 double_sideband_pair_counter++;
Class MHO_DoubleSidebandChannelLabeler.
Definition: MHO_DoubleSidebandChannelLabeler.hh:33
virtual bool InitializeOutOfPlace(const XArrayType *, XArrayType *) override
Initializes output array in-place from input array.
Definition: MHO_DoubleSidebandChannelLabeler.hh:68
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 InitializeInPlace(XArrayType *in) override
Initializes XArrayType in-place and returns success.
Definition: MHO_DoubleSidebandChannelLabeler.hh:58
virtual bool ExecuteOutOfPlace(const XArrayType *in, XArrayType *out) override
Copies input array to output and executes in-place operation on output.
Definition: MHO_DoubleSidebandChannelLabeler.hh:136
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:77
MHO_DoubleSidebandChannelLabeler()
Definition: MHO_DoubleSidebandChannelLabeler.hh:35
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_ChannelLabeler.hh:17