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.FibreMapping(sb, fem, has_antenna, fem_sn, tail, fibre, tpm, masked)

A dataclass to represent a mapping of a fibre to a TPM.

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

Alias for field number 2

controller

Alias for field number 0

station_beams

Alias for field number 5

stations

Alias for field number 1

subarray_beams

Alias for field number 4

subarrays

Alias for field number 3

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.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, cabinet banks, subarray beams, station beams, and subarrays.

Return type:

MCCSDevices

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_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(host=None)

Returns a list of MccsStation devices. :type host: :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

The master leaf nodes have attribute links to the corresponding controllers (“masters”) in the nominated subsystem. E.g. sdp_master_leafnode monitors the sdp controller.

The subarray leafnodes are paired (have an attribute “link”) to the corresponding subsystem subarray

The central node has attribute links to each of the tmc master leafnodes as well has attribute links to the subsystem controllers as well.

These attributes have names like sdpMasterDevName which holds the trl of the sdp controller in the sdp subsystem ( not part of TMC.)

The TMC subarrays

TMC itself only comprises the devices named in the TMC named tuple: the central node, master and subarray leafnodes for the mccs csp and sdp subsystems and the tmc subarrays.

Return type:

TMCDevices

Returns:

TMC Named Tuple.

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.parse_platform_spec(station_name)

Parse the platform spec file and return a list of FibreMapping objects.

aiv_utils.low_utils.parse_tsv(tsv_path)

Parse a TSV file and return a list of FibreMapping objects.

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.smartbox_ports_masked(station)

Returns a list of lists indicating which ports should be disabled for each smartbox.

This takes into account both the “masked” flag in the station spec, and the fact that not all ports have an antenna connected to them.

Return type:

dict[str, list[bool]]

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.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.