Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
RfiScenario.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_GENERATORS_RFISCENARIO_H
25 #define SKA_CHEETAH_GENERATORS_RFISCENARIO_H
26 
27 
28 #include "RfiGenerator.h"
29 
30 namespace ska {
31 namespace cheetah {
32 namespace generators {
33 
42 template<int, typename T>
44 {
45  RfiScenario() = delete;
46 };
47 
51 template<typename T>
52 class RfiScenario<0, T> : public RfiGenerator<T> {
53  typedef RfiGenerator<T> BaseT;
54  typedef typename BaseT::DataType DataType;
55  typedef typename BaseT::FlaggedDataType FlaggedDataType;
56 
57  public:
58  RfiScenario();
59  ~RfiScenario();
60  void next(FlaggedDataType& data) override;
61 
62  static constexpr char description[] = "no additional RFI";
63 };
64 
69 template<typename T>
70 class RfiScenario<1, T> : public RfiGenerator<T> {
71  typedef RfiGenerator<T> BaseT;
72  typedef typename BaseT::DataType DataType;
73  typedef typename BaseT::FlaggedDataType FlaggedDataType;
74  public:
75  RfiScenario();
76  ~RfiScenario();
77  void next(FlaggedDataType& data) override;
78 
79  static constexpr char description[] = "RFI: signal ramps up with frequency, constant across time";
80 };
81 
85 template<typename T>
86 class RfiScenario<2, T> : public RfiGenerator<T> {
87  typedef RfiGenerator<T> BaseT;
88  typedef typename BaseT::DataType DataType;
89  typedef typename BaseT::FlaggedDataType FlaggedDataType;
90  public:
91  RfiScenario();
92  ~RfiScenario();
93  void next(FlaggedDataType& data) override;
94  static constexpr char description[] = "RFI: Gaussian spike in center of the block";
95 };
96 
100 template<typename T>
101 class RfiScenario<3, T> : public RfiGenerator<T> {
102  typedef RfiGenerator<T> BaseT;
103  typedef typename BaseT::DataType DataType;
104  typedef typename BaseT::FlaggedDataType FlaggedDataType;
105  public:
106  RfiScenario();
107  ~RfiScenario();
108  void next(FlaggedDataType& data) override;
109  static constexpr char description[] = "RFI: 4 seperated Gaussian spikes in each block";
110 };
111 
115 template<typename T>
116 class RfiScenario<4, T> : public RfiGenerator<T> {
117  typedef RfiGenerator<T> BaseT;
118  typedef typename BaseT::DataType DataType;
119  typedef typename BaseT::FlaggedDataType FlaggedDataType;
120  public:
121  RfiScenario();
122  ~RfiScenario();
123  void next(FlaggedDataType& data) override;
124  static constexpr char description[] = "RFI: 8 random Gaussian spikes in each block";
125 };
126 
130 template<typename T>
131 class RfiScenario<5, T> : public RfiGenerator<T> {
132  typedef RfiGenerator<T> BaseT;
133  typedef typename BaseT::DataType DataType;
134  typedef typename BaseT::FlaggedDataType FlaggedDataType;
135  public:
136  RfiScenario();
137  ~RfiScenario();
138  void next(FlaggedDataType& data) override;
139  static constexpr char description[] = "RFI: single saturated channel";
140 };
141 
142 #ifdef NDEBUG
143 
147 template<typename T>
148 class RfiScenario<6, T> : public RfiGenerator<T> {
149  typedef RfiGenerator<T> BaseT;
150  typedef typename BaseT::DataType DataType;
151  typedef typename BaseT::FlaggedDataType FlaggedDataType;
152  public:
153  RfiScenario();
154  ~RfiScenario();
155  void next(FlaggedDataType& data) override;
156  static constexpr char description[] = "RFI: consecutive channels with variable RFI";
157 };
158 
163 template<typename T>
164 class RfiScenario<7, T> : public RfiGenerator<T> {
165  typedef RfiGenerator<T> BaseT;
166  typedef typename BaseT::DataType DataType;
167  typedef typename BaseT::FlaggedDataType FlaggedDataType;
168  public:
169  RfiScenario();
170  ~RfiScenario();
171  void next(FlaggedDataType& data) override;
172  static constexpr char description[] = "RFI: broadband spike at the center of the block";
173 };
174 
180 template<typename T>
181 class RfiScenario<8, T> : public RfiGenerator<T> {
182  typedef RfiGenerator<T> BaseT;
183  typedef typename BaseT::DataType DataType;
184  typedef typename BaseT::FlaggedDataType FlaggedDataType;
185  public:
186  RfiScenario();
187  ~RfiScenario();
188  void next(FlaggedDataType& data) override;
189  static constexpr char description[] = "RFI: consecutive channels with weak periodic RFI";
190 };
191 
197 template<typename T>
198 class RfiScenario<9, T> : public RfiGenerator<T> {
199  typedef RfiGenerator<T> BaseT;
200  typedef typename BaseT::DataType DataType;
201  typedef typename BaseT::FlaggedDataType FlaggedDataType;
202  public:
203  RfiScenario();
204  ~RfiScenario();
205  void next(FlaggedDataType& data) override;
206  static constexpr char description[] = "RFI: Weak (7-sigma) broadband spike at the center of the block.";
207 };
208 
214 template<typename T>
215 class RfiScenario<10, T> : public RfiGenerator<T> {
216  typedef RfiGenerator<T> BaseT;
217  typedef typename BaseT::DataType DataType;
218  typedef typename BaseT::FlaggedDataType FlaggedDataType;
219  public:
220  RfiScenario();
221  ~RfiScenario();
222  void next(FlaggedDataType& data) override;
223  static constexpr char description[] = "RFI: strong Broadband periodic RFI";
224 };
225 #endif // NDEBUG
226 
227 } // namespace generators
228 
229 
230 } // namespace cheetah
231 } // namespace ska
232 #include "detail/RfiScenario.cpp"
233 
234 #endif // SKA_CHEETAH_GENERATORS_RFISCENARIO_H
TimeFrequency data with flags representing rfim detection.
Some limits and constants for FLDO.
Definition: Brdz.h:35
Collection of RFI scenarios.
Definition: RfiScenario.h:43