24 #include "cheetah/channel_mask/Config.h" 25 #include "cheetah/channel_mask/ChannelRangeConfig.h" 30 namespace channel_mask {
33 Config::Config(std::string
const& tag_name)
35 , _ranges_processed(false)
37 add_factory(
"range", []() {
return new ChannelRangeConfig(); });
44 void Config::add_options(OptionsDescriptionEasyInit& add_options)
47 (
"channel_numbers", boost::program_options::value<panda::CommaSeparatedOptions<std::size_t>>()->notifier(
48 [&](panda::CommaSeparatedOptions<std::size_t>
const& channels) {
49 for(
auto const& channel :
static_cast<const std::vector<std::size_t>
>(channels) )
51 _flagged_channels.insert(pss::astrotypes::DimensionSpan<data::Frequency>(
52 pss::astrotypes::DimensionIndex<data::Frequency>(channel)
53 , pss::astrotypes::DimensionSize<data::Frequency>(1)
57 ,
"flag the channels specified (e.g. 1,2,4,7,8)" 62 void Config::process_ranges()
const 64 if(!_ranges_processed)
66 panda::ConfigModuleIteratorWrapper<ChannelRangeConfig> it(this->subsection(
"range"));
67 panda::ConfigModuleIteratorWrapper<ChannelRangeConfig> end_it=this->subsection_end();
69 _flagged_channels.insert(pss::astrotypes::DimensionSpan<data::Frequency>(
70 pss::astrotypes::DimensionIndex<data::Frequency>(it->start())
71 ,pss::astrotypes::DimensionIndex<data::Frequency>(it->end())));
74 _ranges_processed=
true;
78 FlaggedChannels
const& Config::flagged_channels()
const 81 return _flagged_channels;
84 FlaggedChannels& Config::flagged_channels()
87 return _flagged_channels;
Some limits and constants for FLDO.