Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | Protected Member Functions | List of all members
ska::cheetah::ddtr::cpu::DedispersionPlan< DdtrTraits > Class Template Reference
Collaboration diagram for ska::cheetah::ddtr::cpu::DedispersionPlan< DdtrTraits >:
Collaboration graph

Public Types

typedef DdtrTraits::value_type NumericalT
 
typedef DdtrTraits::DedispersionHandler DedispersionHandler
 
typedef DdtrTraits::DmTrialsType DmTrialsType
 
typedef DdtrTraits::TimeFrequencyType TimeFrequencyType
 
typedef ddtr::Config::Dm Dm
 
typedef DdtrTraits::BufferFillerType BufferFillerType
 
typedef DdtrTraits::BufferType BufferType
 
typedef std::vector< ddtr::Config::Dm > DmListType
 
typedef TimeFrequencyType::FrequencyType FrequencyType
 
typedef TimeFrequencyType::TimeType TimeType
 
typedef std::vector< FrequencyType > FrequencyListType
 
typedef ddtr::Config ConfigType
 

Public Member Functions

 DedispersionPlan (ConfigType const &config, std::size_t max_data_elements)
 
data::DimensionSize< data::Time > reset (TimeFrequencyType const &)
 reset the plan to be compatible with the TimeFrequency metadata More...
 
void reset (data::DimensionSize< data::Time > const &spectra)
 reset the plan to be compatible with the value
 
data::DimensionSize< data::Time > number_of_spectra () const
 return the number of spectra currently configured
 
data::DimensionSize< data::Time > buffer_overlap () const
 return the number of spectra in the overlap buffer More...
 
std::vector< Dm > const & dm_trials () const
 return algo specific dm_trials
 
std::vector< double > const & dm_factors () const
 return algo specific dm_factors
 
std::shared_ptr< data::DmTrialsMetadatadm_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
 

Protected Member Functions

std::shared_ptr< data::DmTrialsMetadatagenerate_dmtrials_metadata (TimeType sample_interval, data::DimensionSize< data::Time > nspectra, std::size_t nsamples) const
 

Detailed Description

template<typename DdtrTraits>
class ska::cheetah::ddtr::cpu::DedispersionPlan< DdtrTraits >

Definition at line 41 of file DedispersionPlan.h.

Constructor & Destructor Documentation

◆ DedispersionPlan()

template<typename DdtrTraits >
ska::cheetah::ddtr::cpu::DedispersionPlan< DdtrTraits >::DedispersionPlan ( ConfigType const &  config,
std::size_t  max_data_elements 
)
Parameters
max_data_elementsThe maximum memory available on the device (in number of DdtrTraits::value_type values)

Definition at line 32 of file DedispersionPlan.cpp.

33  : _algo_config(config)
34  , _memory(memory)
35 {
36 }

Member Function Documentation

◆ buffer_overlap()

template<typename DdtrTraits >
data::DimensionSize< data::Time > ska::cheetah::ddtr::cpu::DedispersionPlan< DdtrTraits >::buffer_overlap ( ) const

return the number of spectra in the overlap buffer

Corresponds to the maximum delay required for the max dm value in the plan

Definition at line 88 of file DedispersionPlan.cpp.

89 {
90  return data::DimensionSize<data::Time>(_max_delay);
91 }

◆ reset()

template<typename DdtrTraits >
data::DimensionSize< data::Time > ska::cheetah::ddtr::cpu::DedispersionPlan< DdtrTraits >::reset ( TimeFrequencyType const &  data)

reset the plan to be compatible with the TimeFrequency metadata

note that the number_of_spectra of this TimeFrequencyType object is ignored

Definition at line 44 of file DedispersionPlan.cpp.

45 {
46  Dm max_dm = this->_algo_config.max_dm();
47 
48  FrequencyListType const& channel_freqs = data.channel_frequencies();
49  auto freq_pair = data.low_high_frequencies();
50  FrequencyType freq_top = freq_pair.second;
51  FrequencyType freq_bottom = freq_pair.first;
52  _max_delay = std::size_t((this->_algo_config.dm_constant().value()
53  * (1.0/(freq_bottom*freq_bottom) - 1.0/(freq_top*freq_top))
54  * max_dm / data.sample_interval()).value()) + 1;
55  for (auto freq: channel_freqs)
56  {
57  double factor = (this->_algo_config.dm_constant().value() * (1.0/(freq*freq) - 1.0/(freq_top*freq_top)) / data.sample_interval()).value();
58  PANDA_LOG_DEBUG << "Frequency: " << freq << " Reference: " << freq_top << " DM constant: "
59  << this->_algo_config.dm_constant() << " Sampling interval: " << data.sample_interval() << " DM factor: " << factor;
60  _dm_factors.push_back(factor);
61  }
62 
63  _number_of_spectra = std::min(_memory/data.number_of_channels(), this->_algo_config.dedispersion_samples());
64  if (_number_of_spectra < _max_delay * 2)
65  {
66  PANDA_LOG_WARN << "Requested number of samples to dedisperse ("
67  << this->_number_of_spectra
68  << ") is less than twice the max dispersion delay ("
69  << 2 * _max_delay << ")";
70  }
71  _dm_trial_metadata = this->_algo_config.generate_dmtrials_metadata(data.sample_interval(), _number_of_spectra, _max_delay);
72  return data::DimensionSize<data::Time>(_number_of_spectra);
73 }
std::size_t dedispersion_samples() const
number of samples to dedisperse
Definition: Config.cpp:81
Here is the call graph for this function:

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