Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
ScanConfig.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/pipeline/ScanConfig.h"
25 
26 
27 namespace ska {
28 namespace cheetah {
29 namespace pipeline {
30 
31 
32 ScanConfig::ScanConfig()
33  : cheetah::utils::Config("scan")
34  , _freq_channels(4096)
35  , _accel_range(300 *data::meters_per_second_squared)
36  , _beam_bw(300 * boost::units::si::hertz*boost::units::si::mega)
37  , _scan_time(600 * boost::units::si::seconds)
38  , _time_resolution(64 * boost::units::si::micro * boost::units::si::seconds)
39 {
40 }
41 
42 ScanConfig::~ScanConfig()
43 {
44 }
45 
46 void ScanConfig::add_options(OptionsDescriptionEasyInit& add_options)
47 {
48  add_options
49  ("accel_range", boost::program_options::value<double>()->notifier([this](double val) {
50  _accel_range = val * data::meters_per_second_squared;
51  }), "Acceleration Search range")
52 
53  ("beam_bw", boost::program_options::value<double>()->notifier([this](double val) {
54  _beam_bw = val * boost::units::si::hertz*boost::units::si::mega;
55  }), "Beam Band width")
56 
57  ("beam_id", boost::program_options::value<int>(&_beam_id)->default_value(0), "Beam Identifier ")
58  ("bit_per_sample", boost::program_options::value<int>(&_bit_per_sample)->default_value(8), "Bit per sample")
59  ("disp_measure", boost::program_options::value<double>()->notifier([this](double val) {
60  _disp_measure = val * data::parsecs_per_cube_cm;
61  }), "Dispersion measure")
62 
63  ("freq_channels", boost::program_options::value<int>(&_freq_channels)->default_value(4096), "Number of Frequency channels")
64  ("scan_id", boost::program_options::value<int>(&_scan_id)->default_value(0), "Global scan Identifier")
65  ("scan_time", boost::program_options::value<int>()->notifier([this](int val) {
66  _scan_time = val * boost::units::si::seconds;
67  }), "Global scan time in seconds")
68 
69  ("sub_array_id", boost::program_options::value<int>(&_sub_array_id)->default_value(0), "Sub-array Identifier")
70  ("time_resolution", boost::program_options::value<double>()->notifier([this](double val) {
71  _time_resolution = val* boost::units::si::micro * boost::units::si::seconds;
72  }), "Data sampling time (usec)")
73 
74  ("time_samples", boost::program_options::value<uint64_t>(&_time_samples)->default_value(65536), "Time samples per block")
75  ("trials_number", boost::program_options::value<int>(&_trials_number)->default_value(100), "Global scan time in seconds");
76 }
77 
78 data::AccelerationType ScanConfig::accel_range() const
79 {
80  return _accel_range;
81 }
82 
83 data::FrequencyType ScanConfig::beam_bw() const
84 {
85  return _beam_bw;
86 }
87 
88 int ScanConfig::beam_id() const
89 {
90  return _beam_id;
91 }
92 
93 int ScanConfig::bit_per_sample() const
94 {
95  return _bit_per_sample;
96 }
97 
98 typename ScanConfig::Dm ScanConfig::disp_measure() const
99 {
100  return _disp_measure;
101 }
102 
103 int ScanConfig::freq_channels() const
104 {
105  return _freq_channels;
106 }
107 
108 int ScanConfig::scan_id() const
109 {
110  return _scan_id;
111 }
112 
113 typename ScanConfig::ScanTimeType ScanConfig::scan_time() const
114 {
115  return _scan_time;
116 }
117 
118 int ScanConfig::sub_array_id() const
119 {
120  return _sub_array_id;
121 }
122 
123 uint64_t ScanConfig::time_samples() const
124 {
125  return _time_samples;
126 }
127 
128 typename ScanConfig::MicroSecTimeType ScanConfig::time_resolution() const
129 {
130  return _time_resolution;
131 }
132 
133 int ScanConfig::trials_number() const
134 {
135  return _trials_number;
136 }
137 
138 
139 } // namespace pipeline
140 } // namespace cheetah
141 } // namespace ska
Definition: Units.h:112
Some limits and constants for FLDO.
Definition: Brdz.h:35