Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Config.cpp
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "cheetah/rfim/ampp/Config.h"
25 
26 
27 namespace ska {
28 namespace cheetah {
29 namespace rfim {
30 namespace ampp {
31 
32 
33 Config::Config()
34  : utils::Config("rfim_ampp")
35  , _active(false)
36  , _max_history(8192)
37  , _cr_factor(8.0f)
38  , _sr_factor(8.0f)
39  , _zero_dm(false)
40 {
41  add(_bandpass_config);
42 }
43 
44 Config::~Config()
45 {
46 }
47 
48 void Config::add_options(OptionsDescriptionEasyInit& add_options)
49 {
50  add_options
51  ("active", boost::program_options::value<bool>(&_active)->default_value(false), "use this algorithm for rfi clipping")
52  ("channel_rejection_rms", boost::program_options::value<float>(&_cr_factor), "specify the channel rejection factor for the algorithm")
53  ("spectrum_rejection_rms", boost::program_options::value<float>(&_sr_factor), "specify the spectrum rejection factor for the algorithm")
54  ("max_history", boost::program_options::value<unsigned>(&_max_history)->default_value(_max_history), "maximum number of samples to keep stats")
55  ("zero_dm", boost::program_options::value<bool>(&_zero_dm)->default_value(_zero_dm), "flatten the channel if RFI detected");
56 }
57 
58 bool Config::active() const
59 {
60  return _active;
61 }
62 
63 unsigned Config::max_history() const
64 {
65  return _max_history;
66 }
67 
68 float Config::channel_rejection_rms() const
69 {
70  return _cr_factor;
71 }
72 
73 float Config::spectrum_rejection_rms() const
74 {
75  return _sr_factor;
76 }
77 
78 
79 bool Config::zero_dm() const
80 {
81  return _zero_dm;
82 }
83 
84 BandPassConfig const& Config::bandpass() const
85 {
86  return _bandpass_config;
87 }
88 
89 
90 BandPassConfig& Config::bandpass()
91 {
92  return _bandpass_config;
93 }
94 
95 } // namespace ampp
96 } // namespace rfim
97 } // namespace cheetah
98 } // namespace ska
Some limits and constants for FLDO.
Definition: Brdz.h:35