Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Sps.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_SPS_SPS_H
25 #define SKA_CHEETAH_SPS_SPS_H
26 
27 #include "cheetah/sps/Config.h"
28 #include "cheetah/sps/detail/SpsTask.h"
29 #include "cheetah/sps/detail/CommonTypes.h"
30 #include "cheetah/data/TimeFrequency.h"
31 #include "cheetah/data/RfimFlaggedData.h"
32 #include "cheetah/sps/detail/RfiExcisionFactory.h"
33 #include "panda/AlgorithmTuple.h"
34 #include "panda/AggregationBufferFiller.h"
35 #include <functional>
36 #include <memory>
37 
38 namespace ska {
39 namespace cheetah {
40 namespace sps {
41 
42 /*
43 template<typename ConfigType, typename NumericalT>
44 using SpsAlgos=ddtr::DdtrModule<CommonTypes<ConfigType, NumericalT>
45  , emulator::Sps
46 #ifdef ENABLE_ASTROACCELERATE
47  , astroaccelerate::Sps
48 #endif // ENABLE_ASTROACCELERATE
49  >;
50 */
51 
60 template<class ConfigType, typename NumericalT>
61 class Sps
62 {
64 
65 
66  public:
68  typedef typename CommonTraits::DmTrialsType DmTrialType;
69  typedef typename CommonTraits::SpType SpType;
70  typedef typename CommonTraits::BufferFillerType BufferFillerType;
71 
72  typedef std::function<void(std::shared_ptr<DmTrialType>)> DmHandler;
73  typedef std::function<void(std::shared_ptr<SpType>)> SpHandler;
74 
75  private:
76  typedef typename ConfigType::PoolType PoolType;
77  template<typename... Algos>
78  using AlgoLauncher = SpecificSpsTask<DmHandler, SpHandler, CommonTraits, PoolType, Algos...>;
79 
80  public:
87  Sps(ConfigType const&, DmHandler dm_handler, SpHandler sm_handler);
88  ~Sps();
89 
100  void operator()(TimeFrequencyType&);
102 
103  template<typename T>
104  void operator()(std::shared_ptr<T> const&);
105 
106  private:
107  void agg_buffer_init(TimeFrequencyType const&);
108 
109  template<typename DataT>
110  void agg_buffer_fill(DataT&);
111 
112  PoolType _pool;
113 
115  std::shared_ptr<TaskType> _task_ptr;
116 
117  std::size_t _dedisp_samples;
118  BufferFillerType _agg_buf_filler;
119 
120  std::size_t _current_number_of_channels;
121  std::size_t _algo_count;
122  ConfigType const& _config;
123 };
124 
125 } // namespace sps
126 } // namespace cheetah
127 } // namespace ska
128 #include "cheetah/sps/detail/Sps.cpp"
129 
130 #endif // SKA_CHEETAH_SPS_SPS_H
Single pulse search asynchronous task.
Definition: SpsTask.h:47
Contains common types used through sps.
Definition: CommonTypes.h:42
Single Pulse Search top level interface.
Definition: Sps.h:61
TimeFrequency data with flags representing rfim detection.
Some limits and constants for FLDO.
Definition: Brdz.h:35
SpCandidate list.
Definition: SpCcl.h:52
void operator()(TimeFrequencyType &)
Call to activate the Dedispersion and Single Pulse Search.
Definition: Sps.cpp:135
Sps(ConfigType const &, DmHandler dm_handler, SpHandler sm_handler)
Constructor takes two Handlers.
Definition: Sps.cpp:36
A continuous memory container for dispersion measure trials of varying downsamplings.
Definition: DmTrials.h:62