Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
TimeFrequencyMetadata.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_DATA_TIMEFREQUENCYMETADATA_H
25 #define SKA_CHEETAH_DATA_TIMEFREQUENCYMETADATA_H
26 
27 #include "cheetah/data/Units.h"
28 #include "cheetah/utils/chrono.h"
29 #include "pss/astrotypes/multiarray/DimensionSize.h"
30 #include <vector>
31 #include <utility>
32 
33 namespace ska {
34 namespace cheetah {
35 namespace data {
36 
37 template<typename T> using DimensionSize = pss::astrotypes::DimensionSize<T>;
38 using pss::astrotypes::units::Frequency;
39 using pss::astrotypes::units::Time;
40 
47 {
48  public:
49  typedef boost::units::quantity<MegaHertz, double> FrequencyType;
50  typedef boost::units::quantity<boost::units::si::time, double> TimeIntervalType;
51  typedef cheetah::utils::ModifiedJulianClock::time_point TimePointType;
52 
53  public:
56  TimeFrequencyMetadata& operator=(TimeFrequencyMetadata const& copy);
57 
61  TimeIntervalType const& sample_interval() const;
62 
66  void sample_interval(TimeIntervalType dt);
67 
71  std::vector<FrequencyType> const& channel_frequencies() const;
72 
76  std::pair<FrequencyType, FrequencyType> low_high_frequencies() const;
77 
81  template<class InputIterator>
82  void channel_frequencies(InputIterator begin, InputIterator const end);
83 
90  void channel_frequencies_const_width(FrequencyType const& start
91  , FrequencyType const& delta
92  , pss::astrotypes::DimensionSize<Frequency>);
93 
97  TimePointType const& start_time() const;
98 
102  TimePointType start_time(std::size_t offset) const;
103 
109  void start_time(TimePointType const& start_time);
110 
111  private:
112  std::vector<FrequencyType> _frequency_index;
113  TimeIntervalType _sample_interval;
114  TimePointType _start_time;
115 };
116 
117 
118 } // namespace data
119 } // namespace cheetah
120 } // namespace ska
121 #include "detail/TimeFrequencyMetadata.cpp"
122 
123 #endif // SKA_CHEETAH_DATA_TIMEFREQUENCYMETADATA_H
std::vector< FrequencyType > const & channel_frequencies() const
std::pair< FrequencyType, FrequencyType > low_high_frequencies() const
TimeIntervalType const & sample_interval() const
Some limits and constants for FLDO.
Definition: Brdz.h:35
void channel_frequencies_const_width(FrequencyType const &start, FrequencyType const &delta, pss::astrotypes::DimensionSize< Frequency >)
Set the frequency index based on evenly spaced channels.
Metadata for TimeFrequency and FrequencyTime classes.