Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DedispersionConfig.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/ddtr/DedispersionConfig.h"
25 
26 
27 namespace ska {
28 namespace cheetah {
29 namespace ddtr {
30 
31 
32 DedispersionConfig::DedispersionConfig()
33  : utils::Config("dedispersion")
34  , _dm_start(0.0 * data::parsecs_per_cube_cm)
35  , _dm_end(100.0 * data::parsecs_per_cube_cm)
36  , _dm_step(10.0 * data::parsecs_per_cube_cm)
37 {
38 }
39 
40 DedispersionConfig::DedispersionConfig(Dm start, Dm end, Dm step)
41  : utils::Config("dedispersion")
42  , _dm_start(start)
43  , _dm_end(end)
44  , _dm_step(step)
45 {
46 }
47 
48 DedispersionConfig::~DedispersionConfig()
49 {
50 }
51 
52 void DedispersionConfig::add_options(OptionsDescriptionEasyInit& add_options)
53 {
54  add_options
55  ("start", boost::program_options::value<float>()->notifier(
56  [&](float f)
57  {
58  _dm_start = f * data::parsecs_per_cube_cm;
59  }), "start DM in cm^-3 pc"
60  )
61  ("end", boost::program_options::value<float>()->notifier(
62  [&](float f)
63  {
64  _dm_end = f * data::parsecs_per_cube_cm;
65  }), "end DM in cm^-3 pc (inclusive)"
66  )
67  ("step", boost::program_options::value<float>()->notifier(
68  [&](float f)
69  {
70  _dm_step = f * data::parsecs_per_cube_cm;
71  })
72  , "DM step size in cm^-3 pc");
73 }
74 
75 DedispersionConfig::Dm DedispersionConfig::dm_start() const
76 {
77  return _dm_start;
78 }
79 
80 DedispersionConfig::Dm DedispersionConfig::dm_end() const
81 {
82  return _dm_end;
83 }
84 
85 DedispersionConfig::Dm DedispersionConfig::dm_step() const
86 {
87  return _dm_step;
88 }
89 
91 {
92  _dm_start = dm;
93 }
94 
96 {
97  _dm_end = dm;
98 }
99 
100 void DedispersionConfig::dm_step(Dm dm)
101 {
102  _dm_step = dm;
103 }
104 
105 } // namespace ddtr
106 } // namespace cheetah
107 } // namespace ska
Dm dm_start() const
the first dm condidate to try
Some limits and constants for FLDO.
Definition: Brdz.h:35
Dm dm_end() const
the last dm condidate to try
Dm dm_step() const
the step size to take in generating dm trials between start and end