Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DedispersionTrialPlan.h
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 #ifndef SKA_CHEETAH_DDTR_DEDISPERSIONTRIALPLAN_H
25 #define SKA_CHEETAH_DDTR_DEDISPERSIONTRIALPLAN_H
26 
27 
28 #include "cheetah/utils/Config.h"
29 #include "cheetah/ddtr/DedispersionConfig.h"
30 #include "cheetah/data/DedispersionMeasure.h"
31 #include "cheetah/data/DmConstant.h"
32 #include "cheetah/data/DmTrialsMetadata.h"
33 #include "cheetah/data/TimeFrequency.h"
34 #include "cheetah/data/Units.h"
35 #include <vector>
36 #include <string>
37 
38 namespace ska {
39 namespace cheetah {
40 namespace ddtr {
41 
48 {
49  typedef utils::Config BaseT;
50 
51  public:
52  typedef data::DedispersionMeasureType<float> Dm;
53  typedef boost::units::quantity<data::dm_constant::s_mhz::Unit, double> DmConstantType;
54  typedef boost::units::quantity<boost::units::si::time, double> TimeType;
55  typedef boost::units::quantity<data::MegaHertz, double> FrequencyType;
56  typedef panda::ConfigModuleIteratorWrapper<DedispersionConfig> RangeIterator;
57 
58  public:
59  DedispersionTrialPlan(std::string const& tag_name);
61 
66  DmConstantType dm_constant() const;
67 
72  void dm_constant(DmConstantType dm_const);
73 
77  void add_dm_range(Dm start, Dm end, Dm step);
78 
85 
92  std::shared_ptr<data::DmTrialsMetadata> generate_dmtrials_metadata(TimeType sample_interval, std::size_t nspectra, std::size_t nsamples) const;
93 
97  std::vector<Dm> const& dm_trials() const;
98 
102  Dm max_dm() const;
103 
107  TimeType maximum_delay(FrequencyType freq_low, FrequencyType freq_high) const;
108 
112  template<typename Arch, typename NumericalRep>
113  data::DimensionSize<data::Time> maximum_delay_offset(data::TimeFrequency<Arch, NumericalRep> const& tf) const;
114 
115  RangeIterator begin_range() const;
116  RangeIterator end_range() const;
117 
118  protected:
119  void add_options(OptionsDescriptionEasyInit& add_options) override;
120 
121  private:
122  DmConstantType _dm_constant;
123  mutable std::vector<Dm> _dm_trials;
124  mutable Dm _max_dm;
125 };
126 
127 
128 } // namespace ddtr
129 } // namespace cheetah
130 } // namespace ska
131 
132 #include "detail/DedispersionTrialPlan.cpp"
133 
134 #endif // SKA_CHEETAH_DDTR_DEDISPERSIONTRIALPLAN_H
Configuration module to specify Dedispersion Trials.
Base class for module configuration.
Definition: Config.h:42
std::shared_ptr< data::DmTrialsMetadata > generate_dmtrials_metadata(TimeType sample_interval, std::size_t nspectra, std::size_t nsamples) const
Generate metadata based on dedispersion plan.
void dedispersion_config(DedispersionConfig &config)
add a Dedispersion Configuration Element
std::vector< Dm > const & dm_trials() const
list of DM trials
describes dedispersion configuration
void add_dm_range(Dm start, Dm end, Dm step)
get range of DM values
Some limits and constants for FLDO.
Definition: Brdz.h:35
DmConstantType dm_constant() const
get DM constant
TimeType maximum_delay(FrequencyType freq_low, FrequencyType freq_high) const
the maximum delay time for a signal at the maximum Dm in the plan
data::DimensionSize< data::Time > maximum_delay_offset(data::TimeFrequency< Arch, NumericalRep > const &tf) const
the maximum delay offset calculated with the TF blocks properties
Dm max_dm() const
the largest Dm value specified