API documentation¶
This section describes requirements and guidelines.
Packetisers¶
We begin with the packetiser we have written as a default emulator
this is a pretty simple package that uses the transmitter and payload classes
defined in the configuration to send data.
At the moment we have an assumption that the ICD payload is being used. but minor changes to the packetise method would remove that requirement. Very minimal work is needed to replicate this with another payload.
The actual transmission protocol is abstracted into the transmitters
and this is currently defaulting to SPEAD2 and UDP. But as this is almost
completely abstracted should be easy to change.
Default Emulator
Reads data from a MS and creates SPEAD2 packets.
This package is designed to be easily extensible to different payloads and protocols. This module is currently installed as emu_send when the package is installed.
-
cbf_sdp.packetiser.
packetise
(config, ms, loop=None)[source]¶ Reads data off a Measurement Set and transmits it using the transmitter specified in the configuration.
Uses the vis_reader get data from the measurement set then gives it to the transmitter for packaging and transmission. This code is transmission protocol agnostic.
Parameters: - config – The configuration
- ms – The measurement set
Transmitters¶
The transmitters are envisaged to be at least as diverse as UDP, IBV and perhaps ROCE we have only implemented the UDP transmitter. But extensions should be trivial
spead2_transmitters
Class that manages transmission of a SPEAD2 HEAP via UDP and of a content defined by the payload class
-
class
cbf_sdp.transmitters.spead2_transmitters.
Spead2SenderPayload
(num_baselines=None, num_channels=None)[source]¶ SPEAD2 payload following the CSP-SDP interface document
-
class
cbf_sdp.transmitters.spead2_transmitters.
transmitter
(config, num_baselines, num_chan, loop)[source]¶ SPEAD2 transmitter
This class uses the spead2 library to transmit visibilities over multiple spead2 streams. Each visiblity set given to this class’ send method is broken down by channel range (depending on the configuration parameters), and each channel range is sent through a different stream.
Payloads¶
-
class
cbf_sdp.icd.
Payload
[source]¶ A payload as specified by the ICD
-
channel_count
¶ The number of channels contained in this payload
-
channel_id
¶ The ID of the first channel of this payload
The fraction of data on this payload that was correlated
-
hardware_id
¶ The ID of the hardware source of this payload
-
mjd_time
¶ The timestamp of the payload in MJD seconds
-
phase_bin_count
¶ The number of phase bins of this payload
-
phase_bin_id
¶ The ID of the first phase bin of this payload
-
polarisation_id
¶ The ID of the polarisation of this payload
-
scan_id
¶ The ID of the scan of this payload
-
time_centroid_indices
¶ The time centroids for each visibility of this payload
-
timestamp_count
¶ The timestamp of the visibilities, as (integer) seconds since UNIX epoch
-
timestamp_fraction
¶ The fractional timestamp of the visibilities, as an integer with units of 1/2**32 seconds
-
unix_time
¶ The timestamp as fractional seconds since UNIX epoch
-
visibilities
¶ The correlator visibilities of this payload
-
Receivers¶
UDP Protocol Multi-stream SPEAD2 receiver
-
class
cbf_sdp.receivers.spead2_receivers.
Spead2ReceiverPayload
[source]¶ A Payload that updates itself from data coming from spead2 heaps
Others¶
-
class
cbf_sdp.utils.
FakeTM
(ms)[source]¶ TelescopeManager-like class that reads its model information from a Measurement Set.
-
freq_inc_hz
¶ The frequency increment between channels, in Hz
-
freq_start_hz
¶ The frequency of the first channel, in Hz
Whether the current observation is used autocorrelation or not
-
get_matching_data
(current_mjd_utc) → cbf_sdp.utils.DataObject[source]¶ Like get_nearest_data, but if no exact match is found an ValueError exception is raised.
-
get_nearest_data
(time) → cbf_sdp.utils.DataObject[source]¶ Returns the (meta)data associated with correlator dumps happening at a given point in time. If no exact match is found the nearest is returned.
Whether the current observation is used autocorrelation or not
-
num_baselines
¶ The number of baselines used by the current observation
-
num_channels
¶ The number of channels of the current observation
-
num_pols
¶ The number of polarisations used by the current observation
-
num_stations
¶ The number of stations used by the current observation
-
phase_centre_radec_rad
¶ Return the RA/DEC phase centre in radians
-