Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | List of all members
ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc > Class Template Reference

Class for power series (detected FrequencySeries). More...

#include <cheetah/data/PowerSeries.h>

Inheritance diagram for ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >:
Inheritance graph
Collaboration diagram for ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >:
Collaboration graph

Public Types

typedef Alloc Allocator
 
typedef boost::math::chi_squared_distribution< double > ChiSquaredType
 
typedef boost::math::normal_distribution< double > GaussianType
 
- Public Types inherited from ska::cheetah::data::FrequencySeries< Arch, ValueType, Alloc >
typedef Alloc Allocator
 
typedef Arch Architecture
 
- Public Types inherited from ska::cheetah::data::Series< Arch, ValueType, Alloc >
typedef DeviceMemoryType::Iterator Iterator
 
typedef DeviceMemoryType::ConstIterator ConstIterator
 
typedef Alloc Allocator
 
typedef Arch Architecture
 
typedef ValueType ValueType
 

Public Member Functions

 PowerSeries (std::size_t size=0, Allocator const &allocator=Allocator())
 Create a new default PowerSeries instance.
 
 PowerSeries (FourierFrequencyType const &df, double degrees_of_freedom=2.0f, std::size_t=0, Allocator const &allocator=Allocator())
 Create a new PowerSeries instance. More...
 
double degrees_of_freedom () const
 Retreive the (assumed) degrees of freedom of the data distribution. More...
 
void degrees_of_freedom (double dof)
 Set the degrees of freedom of the data distribution. More...
 
double pvalue (float power) const
 Return the statistical probability of a given power level occurring. More...
 
float power_to_equiv_sigma (float power) const
 For a given power level compute the Gaussian equivalent sigma. More...
 
float equiv_sigma_to_power (float sigma) const
 Compute the power that corresponds to a Gaussian equivalent sigma. More...
 
- Public Member Functions inherited from ska::cheetah::data::FrequencySeries< Arch, ValueType, Alloc >
 FrequencySeries (Allocator const &allocator=Allocator())
 Construct a default frequency series (of size 0)
 
 FrequencySeries (std::size_t size, Allocator const &allocator=Allocator())
 Construct a default frequency series.
 
template<typename OtherArch , typename OtherAlloc >
 FrequencySeries (FrequencySeries< OtherArch, ValueType, OtherAlloc > const &copy, Alloc const &allocator=Allocator())
 Construct a regularly sampled frequency series copying data from device memory.
 
 FrequencySeries (FourierFrequencyType const &df, std::size_t size, Allocator const &allocator=Allocator())
 Construct a frequency series with a given sampling interval. More...
 
 FrequencySeries (FourierFrequencyType const &df, Allocator const &allocator=Allocator())
 Construct a frequency series with a given sampling interval. More...
 
FourierFrequencyType const & frequency_step () const
 Retrieve the frequency step of the series. More...
 
void frequency_step (FourierFrequencyType const &df)
 Set the frequency step of the series. More...
 
data::FourierFrequencyType const bin_to_frequency (std::size_t idx) const
 
data::TimeType const bin_to_period (std::size_t idx) const
 
std::size_t frequency_to_bin (data::FourierFrequencyType const &frequency) const
 
- Public Member Functions inherited from ska::cheetah::data::Series< Arch, ValueType, Alloc >
 Series (Allocator const &)
 
 Series (std::size_t size, Allocator const &)
 
 Series (Series const &copy)
 
 Series (Series &&copy_to_move)
 
 Series (Series< OtherArch, ValueType, OtherAlloc > const &copy, Alloc const &allocator)
 copies Series data to the device
 
 Series (Series< OtherArch, ValueType, OtherAlloc > const &copy)
 
ConstIterator begin () const
 Iterators to device memory. More...
 
Iterator begin ()
 
Iterator end ()
 
ConstIterator end () const
 
ConstIterator cbegin () const
 
ConstIterator cend () const
 
std::size_t size () const
 the size of the series
 
void resize (std::size_t size)
 resize the data
 

Detailed Description

template<typename Arch, typename ValueType, typename Alloc = typename DefaultAllocator<Arch,ValueType>::type>
class ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >

Class for power series (detected FrequencySeries).

This class provides and extension to the FrequencySeries class to specifically deal with data that has been converted to spectral power measurements that obey a chi2 distribution with k degrees of freedom. The PowerSeries allows the change in the degrees of freedom of the data to be tracked as the data goes through the Tdas pipeline (where harmonic summing increases the effected degrees of freedom). No checks are performed to determine that the data follow a chi2 distribution with the specified degrees of freedom.

Template Parameters
ArchThe architecture on which the memory for the series is allocated
ValueTypeThe underlying value type of the (should be Real type)
AllocThe allocator used to provide allocate and deallocate memory

Definition at line 58 of file PowerSeries.h.

Constructor & Destructor Documentation

◆ PowerSeries()

template<typename Arch , typename ValueType , typename Alloc >
ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >::PowerSeries ( FourierFrequencyType const &  df,
double  degrees_of_freedom = 2.0f,
std::size_t  size = 0,
Allocator const &  allocator = Allocator() 
)

Create a new PowerSeries instance.

Parameters
dfThe frequency step between neighbouring bins (in Hz)
[in]degrees_of_freedomThe degrees of freedom of the data distribution (assumed to be chi2)

Definition at line 47 of file PowerSeries.cpp.

49  : FrequencySeries<Arch,ValueType,Alloc>(size, allocator)
50  , _dof(degrees_of_freedom)
51  , _distribution(_dof)
52  , _gaussian()
53 {
54  this->frequency_step(df);
55 }
FourierFrequencyType const & frequency_step() const
Retrieve the frequency step of the series.
std::size_t size() const
the size of the series
Definition: Series.cpp:109
double degrees_of_freedom() const
Retreive the (assumed) degrees of freedom of the data distribution.
Definition: PowerSeries.cpp:58
Here is the call graph for this function:

Member Function Documentation

◆ degrees_of_freedom() [1/2]

template<typename Arch , typename ValueType , typename Alloc >
double ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >::degrees_of_freedom ( ) const

Retreive the (assumed) degrees of freedom of the data distribution.

Returns
The degrees of freedom of the data distribution

Definition at line 58 of file PowerSeries.cpp.

59 {
60  return _dof;
61 }

◆ degrees_of_freedom() [2/2]

template<typename Arch , typename ValueType , typename Alloc >
void ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >::degrees_of_freedom ( double  dof)

Set the degrees of freedom of the data distribution.

Parameters
[in]dofThe degree of freedom

Definition at line 64 of file PowerSeries.cpp.

65 {
66  _dof = degrees_of_freedom;
67  _distribution = ChiSquaredType(_dof);
68 }
double degrees_of_freedom() const
Retreive the (assumed) degrees of freedom of the data distribution.
Definition: PowerSeries.cpp:58
Here is the call graph for this function:

◆ equiv_sigma_to_power()

template<typename Arch , typename ValueType , typename Alloc >
float ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >::equiv_sigma_to_power ( float  sigma) const

Compute the power that corresponds to a Gaussian equivalent sigma.

Parameters
[in]sigmaThe Gaussian equivalent sigma
Returns
The corresponding power level

Definition at line 83 of file PowerSeries.cpp.

84 {
85  double p = cdf(complement(_gaussian,(double) sigma));
86  return (float) quantile(complement(_distribution,p));
87 }

◆ power_to_equiv_sigma()

template<typename Arch , typename ValueType , typename Alloc >
float ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >::power_to_equiv_sigma ( float  power) const

For a given power level compute the Gaussian equivalent sigma.

Parameters
[in]powerThe power
Returns
The Gaussian equivalent sigma

Definition at line 77 of file PowerSeries.cpp.

78 {
79  return (float) quantile(complement(_gaussian,pvalue(power)));
80 }
double pvalue(float power) const
Return the statistical probability of a given power level occurring.
Definition: PowerSeries.cpp:71
Here is the call graph for this function:

◆ pvalue()

template<typename Arch , typename ValueType , typename Alloc >
double ska::cheetah::data::PowerSeries< Arch, ValueType, Alloc >::pvalue ( float  power) const

Return the statistical probability of a given power level occurring.

Here we are assuming the statistical probability of a single draw from a chi2 distribution and do not take into account the number of points (trials) in the PowerSeries instance.

Parameters
[in]powerA power value
Returns
The probability that the input power value would occur by chance

Definition at line 71 of file PowerSeries.cpp.

72 {
73  return cdf(complement(_distribution,(double) power));
74 }

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