Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DedispersionPlan.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_ASTROACCELERATE_DEDISPERSIONPLAN_H
25 #define SKA_CHEETAH_DDTR_ASTROACCELERATE_DEDISPERSIONPLAN_H
26 
27 #include "cheetah/data/TimeFrequency.h"
28 #include "cheetah/ddtr/Config.h"
29 #include "cheetah/ddtr/astroaccelerate/Config.h"
30 #include "cheetah/ddtr/astroaccelerate/DedispersionStrategy.h"
31 namespace ska {
32 namespace cheetah {
33 namespace ddtr {
34 namespace astroaccelerate {
35 
40 template <typename DdtrTraits>
42 {
43  public:
44  typedef typename DdtrTraits::value_type NumericalT;
45  typedef typename DdtrTraits::DedispersionHandler DedispersionHandler;
46  typedef typename DdtrTraits::DmTrialsType DmTrialsType;
47  typedef typename DdtrTraits::TimeFrequencyType TimeFrequencyType;
48  typedef ddtr::Config::Dm Dm;
49  typedef typename DdtrTraits::BufferFillerType BufferFillerType;
50  typedef typename DdtrTraits::BufferType BufferType;
51  typedef std::vector<ddtr::Config::Dm> DmListType;
52  typedef typename TimeFrequencyType::FrequencyType FrequencyType;
53  typedef typename TimeFrequencyType::TimeType TimeType;
54  typedef std::vector<FrequencyType> FrequencyListType;
55  typedef typename ddtr::Config ConfigType;
56 
57  public:
58  DedispersionPlan(ConfigType const& config, std::size_t memory=0);
59 
61 
62  data::DimensionSize<data::Time> reset(TimeFrequencyType const&);
63 
64  void reset(data::DimensionSize<data::Time> const& spectra);
65 
66  data::DimensionSize<data::Time> number_of_spectra() const;
67 
68  data::DimensionSize<data::Time> buffer_overlap() const;
69 
70  std::shared_ptr<data::DmTrialsMetadata> generate_dmtrials_metadata(TimeType sample_interval, std::size_t nspectra, std::size_t nsamples) const
71  {
72  return _algo_config.generate_dmtrials_metadata(sample_interval, nspectra, nsamples);
73  }
74 
75  std::vector<Dm> const& dm_trials() const
76  {
77  return _algo_config.dm_trials();
78  }
79 
80  std::vector<double> const& dm_factors() const
81  {
82  return _dm_factors;
83  }
84 
85  std::shared_ptr<data::DmTrialsMetadata> dm_trial_metadata() const
86  {
87  return _dm_trial_metadata;
88  }
89 
90  std::shared_ptr<DedispersionStrategy<NumericalT>> const& dedispersion_strategy() const
91  {
92  return _strategy;
93  }
94 
95  private:
96  ConfigType const& _algo_config;
97  std::shared_ptr<DedispersionStrategy<NumericalT>> _strategy;
98  std::shared_ptr<data::DmTrialsMetadata> _dm_trial_metadata;
99  std::size_t _memory;
100  std::size_t _max_delay;
101  std::size_t _dedispersion_samples;
102  std::vector<double> _dm_factors;
103  std::size_t _number_of_spectra;
104 };
105 
106 } // namespace astroaccelerate
107 } // namespace ddtr
108 } // namespace cheetah
109 } // namespace ska
110 
111 #include "cheetah/ddtr/astroaccelerate/detail/DedispersionPlan.cpp"
112 #endif // SKA_CHEETAH_DDTR_ASTROACCELERATE_DEDISPERSIONPLAN_H
Some limits and constants for FLDO.
Definition: Brdz.h:35