Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
|
A continuous memory container for dispersion measure trials of varying downsamplings. More...
#include <cheetah/data/DmTrials.h>
Public Types | |
typedef DedispersionMeasureType< float > | DmType |
typedef Series< Arch, NumericT, Alloc > | SeriesType |
typedef DmTrial< SeriesType > | DmTrialType |
typedef DmTrialType::TimeType | TimeType |
typedef cheetah::utils::ModifiedJulianClock::time_point | Mjd |
typedef std::vector< DmTrialType >::iterator | Iterator |
typedef std::vector< DmTrialType >::const_iterator | ConstIterator |
typedef NumericT | ValueType |
typedef Arch | Architecture |
typedef Alloc | Allocator |
Public Member Functions | |
DmTrials (std::shared_ptr< DmTrialsMetadata > metadata, Mjd start, Alloc const &allocator=Alloc()) | |
template<typename OtherArch , typename OtherNumericT , typename OtherAlloc > | |
DmTrials (DmTrials< OtherArch, OtherNumericT, OtherAlloc > const &, Alloc const &allocator=Alloc()) | |
~DmTrials () | |
empty object constructor | |
Mjd const & | start_time () const |
void | start_time (Mjd start_time) |
Set the absolute start time. More... | |
DmTrialType & | operator[] (std::size_t n) |
Return reference to DmTrial instance. More... | |
DmTrialType const & | operator[] (std::size_t n) const |
Iterator | begin () |
Return an iterator pointing to the start of the DM trials container. | |
ConstIterator | begin () const |
ConstIterator | cbegin () const |
Iterator | end () |
Return an iterator pointing to the end of the DM trials container. | |
ConstIterator | end () const |
ConstIterator | cend () const |
std::size_t | size () const |
Return the number of DmTrials. | |
bool | is_compatible (DmTrials const &other) const |
Determines if another DmTrials object is compatible with this one. More... | |
bool | is_contiguous (DmTrials const &other) const |
Determines if another DmTrials object is contiguous in time after this one. More... | |
TimeType | duration () const |
Return the time duration of the DmTrials. More... | |
DmTrialsMetadata const & | metadata () const |
Return the trials meta data object. | |
template<typename OtherArch , typename OtherT , typename OtherAlloc > | |
DmTrials (DmTrials< OtherArch, OtherT, OtherAlloc > const ©, Alloc const &allocator) | |
Friends | |
template<typename , typename , typename > | |
class | DmTrials |
A continuous memory container for dispersion measure trials of varying downsamplings.
This is a continuous memory container for storing dispersion measure trials. The continuous nature of the underlying memory is a design detail rather than an implementation detail. The continuous memory is required for two reasons:
A DmTrials object is instantiated with a shared pointer to a a DmTrialsMetadata object. This object contains information such as the DM, downsampling value and length of each DM trial to be stored in the DmTrials object.
The size of a DmTrials object is fixed at instantiation and cannot be changed afterwards. This means that DMs cannot be added or removed. To access the dispersion measure trial time series (DmTrial objects) contained within the DmTrials object one may either index the DmTrials object or iterator over it. An example of this is given below:
A DmTrials object provides two important methods that allow the object to be used in building data processing pipelines, these are is_compatible and is_contiguous. The DmTrialsMetadata instance used to create the DmTrials instance will have a hash value associated with it. For DmTrials objects with the same DMs in the same order and with the same lengths and downsamplings, this hash value will be the same. The is_compatible method compares the value of this hash between two DmTrials instances and returns true if the hashes are the same. The is_contiguous method allows for the user to check if two DmTrials instances are contiguous in time.
Definition at line 62 of file DmTrials.h.
ska::cheetah::data::DmTrials< Arch, T, Alloc >::DmTrials | ( | std::shared_ptr< DmTrialsMetadata > | metadata, |
Mjd | start, | ||
Alloc const & | allocator = Alloc() |
||
) |
Construct a defined size DmTrials object
Definition at line 12 of file DmTrials.cpp.
ska::cheetah::data::DmTrials< Arch, NumericT, Alloc >::DmTrials | ( | DmTrials< OtherArch, OtherNumericT, OtherAlloc > const & | , |
Alloc const & | allocator = Alloc() |
||
) |
Construct a copy of the DmTrials data on another device
DmTrials< Arch, T, Alloc >::TimeType ska::cheetah::data::DmTrials< Arch, T, Alloc >::duration | ( | ) | const |
Return the time duration of the DmTrials.
Definition at line 139 of file DmTrials.cpp.
bool ska::cheetah::data::DmTrials< Arch, T, Alloc >::is_compatible | ( | DmTrials< Arch, NumericT, Alloc > const & | other | ) | const |
Determines if another DmTrials object is compatible with this one.
Compatibility is determined by checking that both DmTrials objects have equivalent metadada. This implies that they have the same DM trial values with the same downsampling ratio in the same order.
other | The other DmTrials object |
Definition at line 125 of file DmTrials.cpp.
bool ska::cheetah::data::DmTrials< Arch, T, Alloc >::is_contiguous | ( | DmTrials< Arch, NumericT, Alloc > const & | other | ) | const |
Determines if another DmTrials object is contiguous in time after this one.
other | The other DmTrials object |
Definition at line 131 of file DmTrials.cpp.
DmTrials< Arch, T, Alloc >::DmTrialType & ska::cheetah::data::DmTrials< Arch, T, Alloc >::operator[] | ( | std::size_t | n | ) |
Return reference to DmTrial instance.
[in] | n | The index of the DmTrial instance |
Definition at line 71 of file DmTrials.cpp.
DmTrials< Arch, T, Alloc >::Mjd const & ska::cheetah::data::DmTrials< Arch, T, Alloc >::start_time | ( | ) | const |
Definition at line 59 of file DmTrials.cpp.
void ska::cheetah::data::DmTrials< Arch, T, Alloc >::start_time | ( | Mjd | start_time | ) |
Set the absolute start time.
start_time | The start time |
Definition at line 65 of file DmTrials.cpp.