Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | List of all members
ska::cheetah::data::TimeFrequencyCommon< DerivedType > Class Template Reference
Inheritance diagram for ska::cheetah::data::TimeFrequencyCommon< DerivedType >:
Inheritance graph
Collaboration diagram for ska::cheetah::data::TimeFrequencyCommon< DerivedType >:
Collaboration graph

Public Types

typedef boost::units::quantity< MegaHertz, double > FrequencyType
 
typedef boost::units::quantity< boost::units::si::time, double > TimeType
 
typedef cheetah::utils::ModifiedJulianClock::time_point TimePointType
 

Public Member Functions

template<typename OtherDerivedType >
 TimeFrequencyCommon (TimeFrequencyCommon< OtherDerivedType > const &tfc)
 
TimePointType const & start_time () const
 
TimePointType start_time (std::size_t offset) const
 
void start_time (TimePointType const &start_time)
 Set the start time of the instance. More...
 
TimePointType end_time () const
 
TimeType sample_interval () const
 
void sample_interval (TimeType dt)
 
std::vector< FrequencyType > const & channel_frequencies () const
 
std::pair< FrequencyType, FrequencyType > low_high_frequencies () const
 
void set_channel_frequencies_const_width (FrequencyType const &start, FrequencyType const &delta)
 Set the frequency index based on evenly spaced channels. More...
 
template<class InputIterator >
void set_channel_frequencies (InputIterator begin, InputIterator const end)
 
TimeFrequencyMetadata const & metadata () const
 
void metadata (TimeFrequencyMetadata const &metadata)
 set the metadata
 

Detailed Description

template<class DerivedType>
class ska::cheetah::data::TimeFrequencyCommon< DerivedType >

Definition at line 39 of file TimeFrequencyCommon.h.

Member Function Documentation

◆ channel_frequencies()

template<class DerivedType >
std::vector< typename TimeFrequencyCommon< DerivedType >::FrequencyType > const & ska::cheetah::data::TimeFrequencyCommon< DerivedType >::channel_frequencies ( ) const
Returns
a vector of frequencies that are represented in each time sample

Definition at line 83 of file TimeFrequencyCommon.cpp.

84 {
85  return this->_metadata.channel_frequencies();
86 }
std::vector< FrequencyType > const & channel_frequencies() const

◆ end_time()

template<class DerivedType >
TimeFrequencyCommon< DerivedType >::TimePointType ska::cheetah::data::TimeFrequencyCommon< DerivedType >::end_time ( ) const
Returns
the absolute time of TF block end

Definition at line 62 of file TimeFrequencyCommon.cpp.

63 {
64  auto derived = static_cast<DerivedType const&>(*this);
65  return this->start_time() + (derived.number_of_spectra() - 1) * sample_interval();
66 }
TimePointType const & start_time() const

◆ low_high_frequencies()

template<class DerivedType >
std::pair< FrequencyType, FrequencyType > ska::cheetah::data::TimeFrequencyCommon< DerivedType >::low_high_frequencies ( ) const
Returns
returns the lowest and highest frequencies represented in channel_frequenceis

Definition at line 89 of file TimeFrequencyCommon.cpp.

90 {
91  return this->_metadata.low_high_frequencies();
92 }
std::pair< FrequencyType, FrequencyType > low_high_frequencies() const

◆ metadata()

template<class DerivedType >
TimeFrequencyMetadata const & ska::cheetah::data::TimeFrequencyCommon< DerivedType >::metadata ( ) const
Returns
returns the metadata

Definition at line 110 of file TimeFrequencyCommon.cpp.

111 {
112  return _metadata;
113 }

◆ sample_interval() [1/2]

template<class DerivedType >
TimeFrequencyCommon< DerivedType >::TimeType ska::cheetah::data::TimeFrequencyCommon< DerivedType >::sample_interval ( ) const
inline
Returns
the sample interval in seconds

Definition at line 70 of file TimeFrequencyCommon.cpp.

71 {
72  return this->_metadata.sample_interval();
73 }
TimeIntervalType const & sample_interval() const

◆ sample_interval() [2/2]

template<class DerivedType>
void ska::cheetah::data::TimeFrequencyCommon< DerivedType >::sample_interval ( TimeType  dt)
inline

the sample interval in seconds

◆ set_channel_frequencies()

template<class DerivedType >
template<class InputIterator >
void ska::cheetah::data::TimeFrequencyCommon< DerivedType >::set_channel_frequencies ( InputIterator  begin,
InputIterator const  end 
)

Set the frequency index based on arbitary channels

Definition at line 104 of file TimeFrequencyCommon.cpp.

105 {
106  this->_metadata.channel_frequencies(begin, end);
107 }
std::vector< FrequencyType > const & channel_frequencies() const

◆ set_channel_frequencies_const_width()

template<class DerivedType>
void ska::cheetah::data::TimeFrequencyCommon< DerivedType >::set_channel_frequencies_const_width ( FrequencyType const &  start,
FrequencyType const &  delta 
)

Set the frequency index based on evenly spaced channels.

Assumes that the number_of_channels has already been set

Definition at line 95 of file TimeFrequencyCommon.cpp.

97 {
98  auto derived = static_cast<DerivedType const&>(*this);
99  this->_metadata.channel_frequencies_const_width(start, delta, data::DimensionSize<Frequency>(derived.number_of_channels()));
100 }
void channel_frequencies_const_width(FrequencyType const &start, FrequencyType const &delta, pss::astrotypes::DimensionSize< Frequency >)
Set the frequency index based on evenly spaced channels.

◆ start_time() [1/3]

template<class DerivedType >
TimeFrequencyCommon< DerivedType >::TimePointType const & ska::cheetah::data::TimeFrequencyCommon< DerivedType >::start_time ( ) const
inline
Returns
the absolute time the first time sample corresponds to.

Definition at line 43 of file TimeFrequencyCommon.cpp.

44 {
45  return this->_metadata.start_time();
46 }

◆ start_time() [2/3]

template<class DerivedType >
TimeFrequencyCommon< DerivedType >::TimePointType ska::cheetah::data::TimeFrequencyCommon< DerivedType >::start_time ( std::size_t  offset) const
inline
Returns
the absolute time the Nth time sample corresponds to.

Definition at line 50 of file TimeFrequencyCommon.cpp.

51 {
52  return this->_metadata.start_time(offset);
53 }

◆ start_time() [3/3]

template<class DerivedType >
void ska::cheetah::data::TimeFrequencyCommon< DerivedType >::start_time ( TimePointType const &  start_time)

Set the start time of the instance.

Parameters
start_timeThe start time (MJD) of the instance

Definition at line 56 of file TimeFrequencyCommon.cpp.

57 {
58  this->_metadata.start_time(start_time);
59 }
TimePointType const & start_time() const

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