API documentation

This section describes the main entry points for the emulator API. While most users will be using the emu-send program, the sender code can be embedded directly into arbitrary python programs, like in the case of the CBF-SDP Emulator TANGO Devices.

cbf_sdp.packetiser module

Primary send functions for ska-sdp-cbf-emulator

cbf_sdp.packetiser.packetise(config: configparser.ConfigParser, ms: Union[<sphinx.ext.autodoc.importer._MockObject object at 0x7f956f667700>, pathlib.Path, str])[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.

cbf_sdp.transmitters.spead2_transmitters module

Implementation for the SPEAD2 network transport

This module contains the logic to take ICD Payloads and transmit them using the SPEAD protocol.

class cbf_sdp.transmitters.spead2_transmitters.Spead2SenderPayload(num_baselines=None, num_channels=None)[source]

SPEAD2 payload following the CSP-SDP interface document

cbf_sdp.transmitters.spead2_transmitters.parse_endpoints(endpoints_spec)[source]

Parse endpoint specifications.

Each endpoint is a colon-separated host and port pair, and multiple endpoints are separated by commas. A port can be a single number or a range specified as “start-end”, both inclusive.

class cbf_sdp.transmitters.spead2_transmitters.transmitter(config)[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.

close()[source]

Sends the end-of-stream message

prepare(num_baselines, num_channels)[source]

Create the sending SPEAD streams

send(scan_id: int, ts: int, ts_fraction: int, vis: <sphinx.ext.autodoc.importer._MockObject object at 0x7f956f58e020>)[source]

Send a visibility set through all SPEAD2 streams

Parameters:
  • int – the scan id
  • ts – the integer part of the visibilities’ timestamp
  • ts_fraction – the fractional part of the visibilities’ timestamp
  • vis – the visibilities