24 #include "cheetah/rcpt_low/UdpStream.h" 25 #include "cheetah/rcpt_low/BeamFormerPacket.h" 26 #include "panda/Log.h" 35 template<
typename Producer>
36 UdpStreamTmpl<Producer>::UdpStreamTmpl(Config
const& config)
38 : BaseT(config.engine(), ConnectionTraits::SocketType(config.engine(), config.remote_end_point()))
39 , _n_channels(config.number_of_channels())
40 , _n_samples(config.spectra_per_chunk())
44 template<
typename Producer>
45 UdpStreamTmpl<Producer>::~UdpStreamTmpl()
49 template<
typename Producer>
57 template<
typename Producer>
58 template<
typename DataType>
61 auto chunk = BaseT::template get_chunk<DataType>();
63 chunk->resize( _n_samples, _n_channels);
65 const UdpStreamTmpl<Producer>::TsampType fraction = ((double)(packet.packet().timestamp_attoseconds()*1e-18)*ska::cheetah::data::seconds);
66 const UdpStreamTmpl<Producer>::TsampType seconds = ((double)(packet.packet().timestamp_seconds())*ska::cheetah::data::seconds);
67 const std::chrono::time_point<std::chrono::system_clock> system_epoch;
68 chunk->start_time(ska::cheetah::utils::ModifiedJulianClock::time_point(system_epoch+seconds+fraction));
70 UdpStreamTmpl<Producer>::FrequencyType fch1 = packet.packet().first_channel_frequency();
71 UdpStreamTmpl<Producer>::FrequencyType bandwidth = (((double)std::ceil((packet.packet().channel_separation()*1e-9)*number_of_channels_low))*boost::units::si::mega * ska::cheetah::data::hertz);
72 UdpStreamTmpl<Producer>::FrequencyType foff = (-1.0*
static_cast<UdpStreamTmpl<Producer>::FrequencyType
>(bandwidth).value()/(double)number_of_channels_low)*boost::units::si::mega * ska::cheetah::data::hertz;
73 chunk->sample_interval(TimeType(((
double)number_of_channels_low/
static_cast<UdpStreamTmpl<Producer>::FrequencyType
>(bandwidth).value())*1e-6 * ska::cheetah::data::seconds));
74 chunk->set_channel_frequencies_const_width(fch1, foff);
Some limits and constants for FLDO.
The UDP stream from the BeamFormer.