astrotypes  0.0
TimeFrequency.cpp
Go to the documentation of this file.
1 /*
2  * MIT License
3  *
4  * Copyright (c) 2018 PulsarSearchSoft
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 
25 namespace pss {
26 namespace astrotypes {
27 
28 template<typename T, typename Alloc>
30  : BaseT(DimensionSize<units::Time>(0), DimensionSize<units::Frequency>(0))
31 {
32 }
33 
34 template<typename T, typename Alloc>
36  : BaseT(time_size, freq_size)
37 {
38 }
39 
40 template<typename T, typename Alloc>
42  : BaseT(time_size, freq_size)
43 {
44 }
45 
46 template<typename T, typename Alloc>
47 template<typename FrequencyTimeType, typename Enable>
48 TimeFrequency<T, Alloc>::TimeFrequency(FrequencyTimeType const& ft)
49  : BaseT(ft)
50 {
51 }
52 
53 template<typename T, typename Alloc>
55 {
56 }
57 
58 // ***************************************************************
59 // -------------- FrequencyTime ----------------------------
60 // ***************************************************************
61 //
62 template<typename T, typename Alloc>
64  : BaseT(DimensionSize<units::Frequency>(0), DimensionSize<units::Time>(0))
65 {
66 }
67 
68 template<typename T, typename Alloc>
70  : BaseT(freq_size, time_size)
71 {
72 }
73 
74 template<typename T, typename Alloc>
76  : BaseT(freq_size, time_size)
77 {
78 }
79 
80 template<typename T, typename Alloc>
81 template<typename TimeFrequencyType, typename Enable>
82 FrequencyTime<T, Alloc>::FrequencyTime(TimeFrequencyType const& tf)
83  : BaseT(tf)
84 {
85 }
86 
87 template<typename T, typename Alloc>
89 {
90 }
91 
92 template<typename SliceType>
94 {
95 }
96 
97 template<typename SliceType>
99  : SliceType(t)
100 {
101 }
102 
103 template<typename SliceType>
105  : SliceType(t)
106 {
107 }
108 
109 template<typename SliceType>
111  : SliceType(std::move(t))
112 {
113 }
114 
115 template<typename SliceType>
117 {
118  return (*this)[DimensionIndex<units::Frequency>(channel_number)];
119 }
120 
121 template<typename SliceType>
123 {
124  return (*this)[DimensionIndex<units::Frequency>(channel_number)];
125 }
126 
127 template<typename SliceType>
129 {
130  return (*this)[DimensionIndex<units::Time>(offset)];
131 }
132 
133 template<typename SliceType>
135 {
136  return (*this)[DimensionIndex<units::Time>(offset)];
137 }
138 
139 template<typename SliceType>
141 {
142  return this->template dimension<units::Frequency>();
143 }
144 
145 template<typename SliceType>
147 {
148  return this->template dimension<units::Time>();
149 }
150 
151 } // namespace astrotypes
152 } // namespace pss
A tagged dimensionIndex variable.
boost::units::time_dimension Time
Definition: Time.h:42
STL namespace.
SliceType::template ConstOperatorSliceType< units::Frequency >::type ConstChannel
Definition: TimeFrequency.h:40
std::size_t number_of_channels() const
return the number of channels in the data structure
std::size_t number_of_spectra() const
return the number of spectra in the data structure
A compile time dimesion tagging of size_t.
Definition: DimensionSize.h:39
SliceType::template ConstOperatorSliceType< units::Time >::type ConstSpectra
Definition: TimeFrequency.h:42
Channel channel(std::size_t channel_number)
retrun a single channel across all time samples
SliceType::template OperatorSliceType< units::Frequency >::type Channel
Definition: TimeFrequency.h:39
SliceType::template OperatorSliceType< units::Time >::type Spectra
Definition: TimeFrequency.h:41
Spectra spectrum(std::size_t offset)
return a single spectrum from the specified offset
boost::units::frequency_dimension Frequency
Definition: Frequency.h:45