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_LOW_BEAMFORMERDATATRAITS_H
25 #define SKA_CHEETAH_RCPT_LOW_BEAMFORMERDATATRAITS_H
26 
27 #include "cheetah/rcpt_low/BeamFormerPacket.h"
28 #include "cheetah/rcpt_low/BeamFormerPacketInspector.h"
29 #include "cheetah/data/TimeFrequency.h"
30 
31 
32 namespace ska {
33 namespace cheetah {
34 namespace rcpt_low {
35 
43 template<typename PacketDataType, unsigned TimeSamplesPerPacket, unsigned ChannelsPerPacket>
45 {
46 
47  public:
50  typedef decltype(ska::cbf_psr_interface::CbfPsrHeader::packet_sequence_number) PacketNumberType;
51 
52  public:
55 
60  static uint64_t sequence_number(PacketInspector const& packet);
61 
65  static constexpr PacketNumberType max_sequence_number();
66 
70  static std::size_t packet_size();
71 
75  static std::size_t data_size();
76 
80  static std::size_t chunk_size(DataType const& data);
81 
85  static bool align_packet(PacketInspector const& packet);
86 
90  template<typename ContextType>
91  static void resize_chunk(ContextType& data);
92 
97  template<typename ContextType>
98  static void deserialise_packet(ContextType& context, PacketInspector const&);
99 
104  template<typename ContextType>
105  static void process_missing_slice(ContextType& context);
106 
107  static void packet_stats(uint64_t packets_received, uint64_t packets_expected);
108 
109 };
110 
112 
113 } // namespace rcpt_low
114 } // namespace cheetah
115 } // namespace ska
116 #include "cheetah/rcpt_low/detail/BeamFormerDataTraits.cpp"
117 
118 #endif // SKA_CHEETAH_RCPT_LOW_BEAMFORMERDATATRAITS_H
static void process_missing_slice(ContextType &context)
perform operations to compenste for a missing packet
static std::size_t packet_size()
return the number of signal samples in a packet (Arun: Need to rename)
static uint64_t sequence_number(PacketInspector const &packet)
returns the sequential number of the chunk that the packet belongs to
Some limits and constants for FLDO.
Definition: Brdz.h:35
static std::size_t chunk_size(DataType const &data)
return the total number of samples (time_samples * channels) in the data
static void resize_chunk(ContextType &data)
return the total number of samples (time_samples * channels) in the data
Traits describing the BeamFormer Data Stream to the panda::PacketSream system.
static std::size_t data_size()
size of the data in the packet excluding header and weights
static bool align_packet(PacketInspector const &packet)
ignore all packets other than the StokesI
static constexpr PacketNumberType max_sequence_number()
the maximum value a packet sequence number will reach
static void deserialise_packet(ContextType &context, PacketInspector const &)
function responsible for transfering data from the packet in to the data structure ...
BeamFormerPacket inspection and data extraction.