low_utils module

General SKA-LOW utility functions.

class aiv_utils.low_utils.CBFDevices(controller, allocator, connector, processors, delaypoly, cnics, subarrays)
allocator

Alias for field number 1

cnics

Alias for field number 5

connector

Alias for field number 2

controller

Alias for field number 0

delaypoly

Alias for field number 4

processors

Alias for field number 3

subarrays

Alias for field number 6

class aiv_utils.low_utils.CSPDevices(controller, subarrays)
controller

Alias for field number 0

subarrays

Alias for field number 1

class aiv_utils.low_utils.MCCSDevices(controller, stations, subarrays, subarray_beams, station_beams)
controller

Alias for field number 0

station_beams

Alias for field number 4

stations

Alias for field number 1

subarray_beams

Alias for field number 3

subarrays

Alias for field number 2

class aiv_utils.low_utils.PASDDevices(station, pasdbus, fndh, smartboxes)
fndh

Alias for field number 2

pasdbus

Alias for field number 1

smartboxes

Alias for field number 3

station

Alias for field number 0

class aiv_utils.low_utils.SDPDevices(controller, queue_connectors, subarrays)
controller

Alias for field number 0

queue_connectors

Alias for field number 1

subarrays

Alias for field number 2

class aiv_utils.low_utils.SPSDevices(station, subracks, tpms, daqs)
daqs

Alias for field number 3

station

Alias for field number 0

subracks

Alias for field number 1

tpms

Alias for field number 2

class aiv_utils.low_utils.TMCDevices(central_node, csp_master_leafnode, csp_subarray_leafnodes, mccs_master_leafnode, mccs_subarray_leafnodes, sdp_master_leafnode, sdp_subarray_leafnodes, tmc_subarray_nodes)
central_node

Alias for field number 0

csp_master_leafnode

Alias for field number 1

csp_subarray_leafnodes

Alias for field number 2

mccs_master_leafnode

Alias for field number 3

mccs_subarray_leafnodes

Alias for field number 4

sdp_master_leafnode

Alias for field number 5

sdp_subarray_leafnodes

Alias for field number 6

tmc_subarray_nodes

Alias for field number 7

aiv_utils.low_utils.calculate_pst_cfreq_bandwidth(sps_a_channel, sps_b_channel)

Calculate the centre frequency and bandwidth in hertz for the PST

Params sps_a_channel:

The lowest coarse frequency channel ID

Params sps_b_channel:

The highest coarse frequency channel ID

Return type:

tuple[float, float]

aiv_utils.low_utils.cbf_spectral_window_for_coarse_channel(coarse_channel)

Return upper and lower bounds of the CBF fine channels for an SPS coarse channel.

These values should be used when configuring SDP’s spectral windows for a given set of SPS coarse channels.

The edges of the CBF fine channels aren’t exactly aligned with coarse channel edges. # For more detail, see the analysis in https://jira.skatelescope.org/browse/SKB-676 # and diagrams attached to https://jira.skatelescope.org/browse/ROAM-576.

Return type:

tuple[float, float]

aiv_utils.low_utils.get_cbf_devices()

CBF Devices. :rtype: CBFDevices :return: CBFDevices named tuple

aiv_utils.low_utils.get_csp_devices()

CSP Devices. :rtype: CSPDevices :return: A named tuple instance holding CSP devices.

aiv_utils.low_utils.get_device(trl, tango_host=None, timeout_ms=10000)

Grab the Tango device from the Tango Resource Locator (TRL) :params trl: the fully qualified domain name :return device: The Tango device

Return type:

DeviceProxy

aiv_utils.low_utils.get_mccs_device(trl, timeout_ms=10000)

Grab the Tango device using a TRL, using TANGO_HOST_MCCS. :params trl: the fully qualified domain name :return device: The Tango device

Return type:

DeviceProxy

aiv_utils.low_utils.get_mccs_devices()

Return stations, subarray beams, station beams, and subarrays.

Return type:

MCCSDevices

aiv_utils.low_utils.get_mccs_tangodb()

Get the Database object for the Tango DB containing MCCS devices.

Return type:

Database

Returns:

a tango.Database object representing the MCCS Tango database

aiv_utils.low_utils.get_pasd_devices(station_name)

Returns field station, pasdbus, FNDH and smartboxes for a given station name.

Parameters:

station_name (str) – the name of the station

Return type:

PASDDevices

Returns:

list of devices [fs, pasdbus, fndh, smartboxes]

aiv_utils.low_utils.get_sdn_ip_address()

Return the IP address of the sdn1 interface of this device.

The primary use of this is to get get the IP address for tcpdumping packets from the TPMs.

aiv_utils.low_utils.get_sdp_devices()

SDP Devices. :rtype: SDPDevices :return: A named tuple instance holding SDP devices.

aiv_utils.low_utils.get_sps_devices(station_name, tango_timeout=3500)

Returns station, subracks, tpms and daqs Tango devices for a given station name.

Parameters:
  • station_name (str) – the name of the station

  • tango_timeout (int) – set the client timeout on the returned DeviceProxys

Return type:

SPSDevices

Returns:

list of devices [station, subracks, tpms, daqs]

aiv_utils.low_utils.get_stations()

Returns a list of MccsStation devices. :param host: the Tango database host :return: A list of MccsStation devices

aiv_utils.low_utils.get_tmc_devices()

Returns TMC Tango devices. Of which the fields are:

central_node csp_master_leafnode csp_subarray_leafnodes mccs_master_leafnode mccs_subarray_leafnodes sdp_master_leafnode sdp_subarray_leafnodes tmc_subarray_nodes

These devices are derived by following Tango properties from the TMC central node. This device has properties containing the TRLs of each of the subsystem controller leaf nodes, and to the TMC subarray nodes.

The TMC subarray nodes have a property containing the TRL of the corresponding subarray leaf node device for each subsystem.

Therefore, it is possible for TMC devices to exist that are not returned by this function, if they are not referenced directly or transitively via the Tango properties of the TMC central node.

Return type:

TMCDevices

Returns:

TMCDevice namedtuple containing central node, controller leaf node, subarray node and subarray leaf node devices.

aiv_utils.low_utils.grab_tango_device_from_device_name(device, station_sps_devs, stations_sps_devs, stations_fs_devs, subarray_ids)

Based on the device name string, grab the right tango device.

This will use known human names for the device and will grab the tango device from the input SPS device class, PASD devices, or manually get the TMC devices based on the subarray_ids.

Params device:

Human readable device name

Params stations_sps_devs:

List of SPSDevices for each SPS stations under test

Params stations_fs_devs:

List of PASDDevices for each field stations under test

Params subarray_ids:

List of subarray IDs under test

aiv_utils.low_utils.interactive_variable_prompt(variable_name)

The user will be prompted to input a value.

Params variable_name:

The name of the variable to be printed on the prompt.

Return variable:

The variable which will no longer be empty.

Return type:

str

aiv_utils.low_utils.print_port_status(connector)

Print P4 Packet Counters

Parameters:

connector – The device proxy for the connector to the P4 device (low-cbf/connector/0)

aiv_utils.low_utils.report_attr(dev, attr_name)

Reads attr_name from dev, and returns if formatted with some Tango sugar.

aiv_utils.low_utils.round_static_delays(delays)

Round static delays in a consistent way to the nearest 1.25ns.

Parameters:

delays (ndarray) – The unrounded static delays.

Returns:

Rounded static delays.

aiv_utils.low_utils.sanitise_station_name(station_name)

Helper function to remove brackets, quotes and whitespace from a station name.

Parameters:

station_name (str) – A station name string to sanitise.

Return type:

str

Returns:

The sanitised station name string.

aiv_utils.low_utils.split_host_port(endpoint, default_port=4660)

Split a host:port string into a tuple of (host, port).

aiv_utils.low_utils.station_names_input_to_list(station_names_input)

Converts a string of station names into a list of station names. Supports strings of forms including: “s8-1, s8-6”, “[s8-1, s8-6]”, “[‘s8-1’,’s8-6’]”

Parameters:

station_names_input (str) – A string to parse into a list.

Return type:

list[str]

Returns:

A list of station names.

aiv_utils.low_utils.tpm_number_from_dev(tpm)

Get the TPM number from a device proxy.

aiv_utils.low_utils.tpm_summary(tpms)

Returns a DataFrame summarising critical TPM attributes.

aiv_utils.low_utils.warn_calibrator_running(station_name)

Checks that the calibrator isn’t running and for a station and warns if it is.

If the station calibrator is running, it will clobber any running observation involving the DAQ or the channelised TPM spigot.

Parameters:

station_name (str) – The name of the station to check.

aiv_utils.low_utils.warn_pasd_not_on(station_name)

Check that the SPS is on for a station and produce warnings for bad PASD devices.

Parameters:

station_name (str) – The name of the station to check.

aiv_utils.low_utils.warn_sps_not_on(station_name)

Check that the SPS is on for a station and produce warnings for bad SPS devices.

Parameters:

station_name (str) – The name of the station to check.