Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
FrequencyTime.h
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef SKA_CHEETAH_FREQUENCYTIME_H
25 #define SKA_CHEETAH_FREQUENCYTIME_H
26 
27 #include "cheetah/data/Units.h"
28 #include "cheetah/data/TimeFrequencyCommon.h"
29 #include "cheetah/utils/Architectures.h"
30 #include "panda/DataChunk.h"
31 
32 #pragma GCC diagnostic push
33 #pragma GCC diagnostic ignored "-Wall"
34 #pragma GCC diagnostic ignored "-Wpragmas"
35 #pragma GCC diagnostic ignored "-Wunused-parameter"
36 #pragma GCC diagnostic ignored "-Wunused-variable"
37 #include "pss/astrotypes/types/TimeFrequency.h"
38 #pragma GCC diagnostic pop
39 
40 namespace ska {
41 namespace cheetah {
42 namespace data {
43 
44 template <class Arch, typename NumericalT> class TimeFrequency;
45 
87 template <class Arch, typename NumericalT>
88 class FrequencyTime : public pss::astrotypes::FrequencyTime<NumericalT> // TODO Arch in base type -> use allocator
89  , public TimeFrequencyCommon<FrequencyTime<Arch, NumericalT>>
90 {
91  typedef pss::astrotypes::FrequencyTime<NumericalT> BaseT;
93 
94  public:
98  typedef NumericalT DataType;
99  typedef NumericalT NumericalRep;
100  typedef Arch Architecture;
101 
102  typedef typename CommonBaseT::FrequencyType FrequencyType;
103  typedef typename CommonBaseT::TimeType TimeType;
104  typedef typename CommonBaseT::TimePointType TimePointType;
105 
106  typedef typename BaseT::iterator Iterator;
107  typedef typename BaseT::const_iterator ConstIterator;
109 
115  typedef typename BaseT::Spectra Spectra;
116  typedef typename BaseT::ConstSpectra ConstSpectra;
117  typedef typename BaseT::Channel Channel;
118  typedef typename BaseT::ConstChannel ConstChannel;
119 
120  public:
124  FrequencyTime();
125 
129  FrequencyTime(DimensionSize<Time> number_of_spectra, DimensionSize<Frequency> number_of_channels);
130  FrequencyTime(DimensionSize<Frequency> number_of_channels, DimensionSize<Time> number_of_spectra);
131 
135  template<class OtherArch, typename OtherNumericalT>
137 
138  template<typename OtherNumericalT>
140 
141  template<typename OtherArch, typename OtherNumericalT>
143 
148  void set_channel(unsigned channel_number, DataType const& value);
149 
153  bool operator==(FrequencyTime const&) const;
154 };
155 
166 template<typename T>
168 
174 template<typename T, typename Enable = void>
176 
177 } // namespace data
178 } // namespace cheetah
179 } // namespace ska
180 
181 namespace pss {
182 namespace astrotypes {
183 
184 template<typename Alloc, typename T>
185 struct has_exact_dimensions<ska::cheetah::data::FrequencyTime<T, Alloc>, units::Frequency, units::Time> : public std::true_type
186 {
187 };
188 
189 } // namespace pss
190 } // namespace astrotypes
191 
192 #include "detail/FrequencyTime.cpp"
193 #include "cuda/FrequencyTime.h"
194 
195 #endif // SKA_CHEETAH_FREQUENCYTIME_H
Implementation Helper class for the ExtractFrequencyTimeDataType - do not call directly.
bool operator==(FrequencyTime const &) const
return true if equivalent data
extract the FrequencyTime data type from compound types
NumericalT DataType
the underlying data storage type for the amplitude of the signal
Definition: FrequencyTime.h:98
BaseT::Spectra Spectra
Iterator class for accessing each time sample.
Some limits and constants for FLDO.
Definition: Brdz.h:35
void set_channel(unsigned channel_number, DataType const &value)
sets the value of the specified channel to the provided value across all time samples ...