Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DmTrials.h
1 #ifndef SKA_CHEETAH_DATA_DMTRIALS_H
2 #define SKA_CHEETAH_DATA_DMTRIALS_H
3 
4 #include "cheetah/data/DmTrial.h"
5 #include "cheetah/data/DmTrialsMetadata.h"
6 #include "cheetah/data/Units.h"
7 #include "cheetah/data/DedispersionMeasure.h"
8 #include "cheetah/data/DefaultAllocator.h"
9 #include "cheetah/data/Series.h"
10 #include "cheetah/utils/ModifiedJulianClock.h"
11 #include "panda/DataChunk.h"
12 #include <vector>
13 
14 namespace ska {
15 namespace cheetah {
16 namespace data {
17 
61 template <typename Arch, typename NumericT, typename Alloc=typename DefaultAllocator<Arch,NumericT>::type>
62 class DmTrials
63  : public panda::DataChunk<DmTrials<Arch,NumericT,Alloc>>
64 {
65  template<typename, typename, typename> friend class DmTrials;
66 
67  public:
68  typedef DedispersionMeasureType<float> DmType;
71  typedef typename DmTrialType::TimeType TimeType;
72  typedef cheetah::utils::ModifiedJulianClock::time_point Mjd;
73  typedef typename std::vector<DmTrialType>::iterator Iterator;
74  typedef typename std::vector<DmTrialType>::const_iterator ConstIterator;
75  typedef NumericT ValueType;
76 
77  typedef Arch Architecture;
78  typedef Alloc Allocator;
79 
80  public:
81 
85  DmTrials(std::shared_ptr<DmTrialsMetadata> metadata, Mjd start, Alloc const& allocator=Alloc());
86 
90  template<typename OtherArch, typename OtherNumericT, typename OtherAlloc>
91  DmTrials(DmTrials<OtherArch, OtherNumericT, OtherAlloc> const&, Alloc const& allocator=Alloc());
92 
96  ~DmTrials();
97 
101  Mjd const& start_time() const;
102 
108  void start_time(Mjd start_time);
109 
115  DmTrialType& operator[](std::size_t n);
116  DmTrialType const& operator[](std::size_t n) const;
117 
121  Iterator begin();
122  ConstIterator begin() const;
123  ConstIterator cbegin() const;
124 
128  Iterator end();
129  ConstIterator end() const;
130  ConstIterator cend() const;
131 
135  std::size_t size() const;
136 
148  bool is_compatible(DmTrials const& other) const;
149 
157  bool is_contiguous(DmTrials const& other) const;
158 
164  TimeType duration() const;
165 
169  DmTrialsMetadata const& metadata() const;
170 
171  private:
172  std::shared_ptr<DmTrialsMetadata> _metadata;
173  SeriesType _data;
174  std::vector<DmTrialType> _trials;
175  Mjd _start_time;
176  TimeType _duration;
177 };
178 
179 
180 } // namespace data
181 } // namespace cheetah
182 } // namespace ska
183 
184 #include "cheetah/data/detail/DmTrials.cpp"
185 
186 #endif // SKA_CHEETAH_DATA_DMTRIALS_H
DmTrialsMetadata const & metadata() const
Return the trials meta data object.
Definition: DmTrials.cpp:53
bool is_compatible(DmTrials const &other) const
Determines if another DmTrials object is compatible with this one.
Definition: DmTrials.cpp:125
Iterator begin()
Return an iterator pointing to the start of the DM trials container.
Definition: DmTrials.cpp:83
bool is_contiguous(DmTrials const &other) const
Determines if another DmTrials object is contiguous in time after this one.
Definition: DmTrials.cpp:131
Some limits and constants for FLDO.
Definition: Brdz.h:35
Container for metadata that describes a set of dispersion measure trials.
Mjd const & start_time() const
Definition: DmTrials.cpp:59
Iterator end()
Return an iterator pointing to the end of the DM trials container.
Definition: DmTrials.cpp:101
TimeType duration() const
Return the time duration of the DmTrials.
Definition: DmTrials.cpp:139
DmTrialType & operator[](std::size_t n)
Return reference to DmTrial instance.
Definition: DmTrials.cpp:71
A continuous memory container for dispersion measure trials of varying downsamplings.
Definition: DmTrials.h:62
std::size_t size() const
Return the number of DmTrials.
Definition: DmTrials.cpp:119
A wrapper class that presents a SeriesSlice object as a trial dispersion measure time series...
Definition: DmTrial.h:31
~DmTrials()
empty object constructor
Definition: DmTrials.cpp:48