Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | List of all members
ska::cheetah::sps::Sps< ConfigType, NumericalT > Class Template Reference

Single Pulse Search top level interface. More...

#include <cheetah/sps/Sps.h>

Inheritance diagram for ska::cheetah::sps::Sps< ConfigType, NumericalT >:
Inheritance graph
Collaboration diagram for ska::cheetah::sps::Sps< ConfigType, NumericalT >:
Collaboration graph

Public Types

typedef data::TimeFrequency< Cpu, NumericalT > TimeFrequencyType
 
typedef CommonTraits::DmTrialsType DmTrialType
 
typedef CommonTraits::SpType SpType
 
typedef CommonTraits::BufferFillerType BufferFillerType
 
typedef std::function< void(std::shared_ptr< DmTrialType >)> DmHandler
 
typedef std::function< void(std::shared_ptr< SpType >)> SpHandler
 

Public Member Functions

 Sps (ConfigType const &, DmHandler dm_handler, SpHandler sm_handler)
 Constructor takes two Handlers. More...
 
void operator() (TimeFrequencyType &)
 Call to activate the Dedispersion and Single Pulse Search. More...
 
void operator() (data::RfimFlaggedData< TimeFrequencyType > &)
 
template<typename T >
void operator() (std::shared_ptr< T > const &)
 

Detailed Description

template<class ConfigType, typename NumericalT>
class ska::cheetah::sps::Sps< ConfigType, NumericalT >

Single Pulse Search top level interface.

Definition at line 61 of file Sps.h.

Constructor & Destructor Documentation

◆ Sps()

template<class ConfigType, typename NumericalRep >
ska::cheetah::sps::Sps< ConfigType, NumericalRep >::Sps ( ConfigType const &  config,
DmHandler  dm_handler,
SpHandler  sm_handler 
)

Constructor takes two Handlers.

Parameters
DmHandlerA functor to be called with the DmTime data product
SpHandlerA functor to be called with the Sps results

Definition at line 36 of file Sps.cpp.

37  : _pool(config.pool())
38  , _agg_buf_filler( [this](typename BufferFillerType::AggregationBufferType buffer)
39  {
40  _task_ptr->submit(std::move(buffer));
41  }
42  ,0, config.rfiexcision_config())
43  , _current_number_of_channels(0)
44  , _algo_count(0)
45  , _config(config)
46 {
47  if(config.astroaccelerate_config().active()) {
48 #ifdef ENABLE_ASTROACCELERATE
49  _task_ptr.reset(new AlgoLauncher<astroaccelerate::Sps<CommonTraits>>( std::move(dm_handler)
50  , std::move(sp_handler)
51  , _pool
52  , std::move(astroaccelerate::Sps<CommonTraits>(config))));
53  ++_algo_count;
54 #else //ENABLE_ASTROACCELERATE
55  PANDA_LOG_WARN << "Sps: request for astroaccelearte, but cheetah has not been build with CUDA support. Please use cmake compile flag -DENABLE_CUDA=true";
56 #endif //ENABLE_ASTROACCELERATE
57 
58  }
59 
60  if(config.emulator_config().active()) {
61  _task_ptr.reset(new AlgoLauncher<emulator::Sps<CommonTraits>>( std::move(dm_handler)
62  , std::move(sp_handler)
63  , _pool
64  , std::move(emulator::Sps<CommonTraits>(config)))
65  );
66  ++_algo_count;
67  }
68  if(_algo_count > 1 ) { // at the moment this is currently an error
69  throw panda::Error("Multiple sps algorithms have been selected");
70  }
71  else if(_algo_count == 0)
72  {
73  _task_ptr.reset(new TaskType(std::move(dm_handler), std::move(sp_handler)));
74  }
75  _dedisp_samples = config.dedispersion_samples();
76 }

Member Function Documentation

◆ operator()()

template<class ConfigType , typename NumericalRep >
void ska::cheetah::sps::Sps< ConfigType, NumericalRep >::operator() ( TimeFrequencyType data)

Call to activate the Dedispersion and Single Pulse Search.

Takes the next block of TimeFrequency data and returns immediately. When enough data is buffered it will launch an async task calling the handlers when done.

Definition at line 135 of file Sps.cpp.

136 {
137  this->template agg_buffer_fill(data);
138 }

The documentation for this class was generated from the following files: