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_CPU_DEDISPERSIONPLAN_H
25 #define SKA_CHEETAH_DDTR_CPU_DEDISPERSIONPLAN_H
26 
27 #include "cheetah/data/TimeFrequency.h"
28 #include "cheetah/ddtr/Config.h"
29 #include "cheetah/ddtr/cpu/Config.h"
30 
31 namespace ska {
32 namespace cheetah {
33 namespace ddtr {
34 namespace cpu {
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:
61  DedispersionPlan(ConfigType const& config, std::size_t max_data_elements);
63 
68  data::DimensionSize<data::Time> reset(TimeFrequencyType const&);
69 
73  void reset(data::DimensionSize<data::Time> const& spectra);
74 
78  data::DimensionSize<data::Time> number_of_spectra() const;
79 
84  data::DimensionSize<data::Time> buffer_overlap() const;
85 
86 
90  std::vector<Dm> const& dm_trials() const;
91 
95  std::vector<double> const& dm_factors() const;
96 
100  std::shared_ptr<data::DmTrialsMetadata> dm_trials_metadata(data::TimeFrequencyMetadata const& tf_info, data::DimensionSize<data::Time> number_of_spectra);
101 
102  protected:
103  std::shared_ptr<data::DmTrialsMetadata> generate_dmtrials_metadata(TimeType sample_interval, data::DimensionSize<data::Time> nspectra, std::size_t nsamples) const;
104 
105  private:
106  ConfigType const& _algo_config;
107  std::size_t _memory;
108  data::DimensionSize<data::Time> _max_delay;
109  data::DimensionSize<data::Time> _number_of_spectra;
110  std::shared_ptr<data::DmTrialsMetadata> _dm_trial_metadata;
111  std::vector<double> _dm_factors;
112 };
113 
114 } // namespace cpu
115 } // namespace ddtr
116 } // namespace cheetah
117 } // namespace ska
118 
119 #include "cheetah/ddtr/cpu/detail/DedispersionPlan.cpp"
120 #endif // SKA_CHEETAH_DDTR_CPU_DEDISPERSIONPLAN_H
std::vector< Dm > const & dm_trials() const
return algo specific dm_trials
data::DimensionSize< data::Time > reset(TimeFrequencyType const &)
reset the plan to be compatible with the TimeFrequency metadata
data::DimensionSize< data::Time > buffer_overlap() const
return the number of spectra in the overlap buffer
std::vector< double > const & dm_factors() const
return algo specific dm_factors
Some limits and constants for FLDO.
Definition: Brdz.h:35
DedispersionPlan(ConfigType const &config, std::size_t max_data_elements)
data::DimensionSize< data::Time > number_of_spectra() const
return the number of spectra currently configured
std::shared_ptr< data::DmTrialsMetadata > dm_trials_metadata(data::TimeFrequencyMetadata const &tf_info, data::DimensionSize< data::Time > number_of_spectra)
return a DmTrialsMetadata block consistent with the plan and the incoming data parameters ...
Metadata for TimeFrequency and FrequencyTime classes.