Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
BeamFormerDataTraits.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_RCPT_BEAMFORMERDATATRAITS_H
25 #define SKA_CHEETAH_RCPT_BEAMFORMERDATATRAITS_H
26 
27 #include "cheetah/rcpt/BeamFormerPacket.h"
28 #include "cheetah/rcpt/BeamFormerPacketInspector.h"
29 #include "cheetah/data/TimeFrequency.h"
30 
31 
32 namespace ska {
33 namespace cheetah {
34 namespace rcpt {
35 
45 {
46 
47  public:
49  typedef BeamFormerPacketInspector PacketInspector; // TODO templatize class for reuse for low
50 
51  public:
54 
59  static uint64_t sequence_number(PacketInspector const& packet);
60 
64  static constexpr uint64_t max_sequence_number();
65 
69  static std::size_t packet_size();
70 
74  static std::size_t chunk_size(DataType const& data);
75 
79  static bool align_packet(PacketInspector const& packet);
80 
84  template<typename ContextType>
85  static void resize_chunk(ContextType& data);
86 
91  template<typename ContextType>
92  static void deserialise_packet(ContextType& context, PacketInspector const&);
93 
98  template<typename ContextType>
99  static void process_missing_slice(ContextType& context);
100 
101  static void packet_stats(uint64_t packets_received, uint64_t packets_expected);
102 };
103 
104 
105 } // namespace rcpt
106 } // namespace cheetah
107 } // namespace ska
108 #include "cheetah/rcpt/detail/BeamFormerDataTraits.cpp"
109 
110 #endif // SKA_CHEETAH_RCPT_BEAMFORMERDATATRAITS_H
static void resize_chunk(ContextType &data)
return the total number of samples (time_samples * channels) in the data
static std::size_t chunk_size(DataType const &data)
return the total number of samples (time_samples * channels) in the data
static void deserialise_packet(ContextType &context, PacketInspector const &)
function responsible for transfering data from the packet in to the data structure ...
static constexpr uint64_t max_sequence_number()
the maximum value a packet sequence number will reach
Traits describing the BeamFormer Data Stream to the panda::PacketSream system.
static std::size_t packet_size()
return the number of signal samples in a packet
BeamFormerPacket inspection and data extraction.
Some limits and constants for FLDO.
Definition: Brdz.h:35
static bool align_packet(PacketInspector const &packet)
ignore all packets other than the StokesI
static uint64_t sequence_number(PacketInspector const &packet)
returns the sequential number of the chunk that the packet belongs to
static void process_missing_slice(ContextType &context)
perform operations to compenste for a missing packet