Station Component Manager

This module implements component management for stations.

class SpsStationComponentManager(station_id, subrack_fqdns, tile_fqdns, daq_trl, sdn_first_interface, sdn_gateway, antenna_config_uri, logger, max_workers, communication_state_changed_callback, component_state_changed_callback, tile_health_changed_callback, subrack_health_changed_callback)

A component manager for a station.

__init__(station_id, subrack_fqdns, tile_fqdns, daq_trl, sdn_first_interface, sdn_gateway, antenna_config_uri, logger, max_workers, communication_state_changed_callback, component_state_changed_callback, tile_health_changed_callback, subrack_health_changed_callback)

Initialise a new instance.

Parameters:
  • station_id (int) – the id of this station

  • subrack_fqdns (Sequence[str]) – FQDNs of the Tango devices which manage this station’s subracks

  • tile_fqdns (Sequence[str]) – FQDNs of the Tango devices which manage this station’s TPMs

  • daq_trl (str) – The TRL of this Station’s DAQ Receiver.

  • sdn_first_interface (str) – CIDR-style IP address with mask, for the first interface in the block assigned for science data For example, “10.130.0.1/25” means “address 10.130.0.1 on network 10.130.0.0/25”.

  • sdn_gateway (str) – IP address of the SDN gateway, or None if the network has no gateway.

  • antenna_config_uri (Optional[list[str]]) – location of the antenna mapping file

  • logger (Logger) – the logger to be used by this object.

  • max_workers (int) – the maximum worker threads for the slow commands associated with this component manager.

  • communication_state_changed_callback (Callable[[CommunicationStatus], None]) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_state_changed_callback (Callable[..., None]) – callback to be called when the component state changes

  • tile_health_changed_callback (Callable[[str, Optional[HealthState]], None]) – callback to be called when a tile’s health changed

  • subrack_health_changed_callback (Callable[[str, Optional[HealthState]], None]) – callback to be called when a subrack’s health changed

adc_power()

Get input RMS levels.

Return type:

list[float]

Returns:

list of RMS levels of ADC inputs

apply_calibration(switch_time)

Switch the calibration bank.

(i.e. apply the calibration coefficients previously loaded by load_calibration_coefficients()).

Parameters:

switch_time (str) – an optional time at which to perform the switch

Return type:

None

apply_pointing_delays(load_time)

Load the pointing delay at a specified time.

Parameters:

load_time (str) – time at which to load the pointing delay

Return type:

None

property beamformer_table: list[list[int]]

Get beamformer region table.

Bidimensional array of one row for each 8 channels, with elements: 0. start physical channel 1. beam number 2. subarray ID 3. subarray_logical_channel 4. subarray_beam_id 5. substation_id 6. aperture_id

Each row is a set of 7 consecutive elements in the list.

Returns:

list of up to 7*48 values

board_temperature_summary()

Get summary of board temperatures.

Return type:

list[float]

Returns:

minimum, average and maximum of board temperatures

property channeliser_rounding: numpy.ndarray

Channeliser rounding.

Number of LS bits dropped in each channeliser frequency channel. Valid values 0-7 Same value applies to all antennas and polarizations

Returns:

list of 512 values for each Tile, one per channel.

clock_present_summary()

Get summary of 10 MHz clock presence.

Return type:

bool

Returns:

TRUE if 10 MHz clock is present in all tiles

configure_integrated_beam_data(integration_time, first_channel, last_channel)

Configure and start the transmission of integrated channel data.

Configure with the provided integration time, first channel and last channel. Data are sent continuously until the StopIntegratedData command is run.

Parameters:
  • integration_time (float) – integration time in seconds, defaults to 0.5

  • first_channel (int) – first channel

  • last_channel (int) – last channel

Return type:

None

configure_integrated_channel_data(integration_time, first_channel, last_channel)

Configure and start the transmission of integrated channel data.

Configure with the provided integration time, first channel and last channel. Data are sent continuously until the StopIntegratedData command is run.

Parameters:
  • integration_time (float) – integration time in seconds, defaults to 0.5

  • first_channel (int) – first channel

  • last_channel (int) – last channel

Return type:

None

configure_test_generator(argin)

Distribute to tiles command configure_test_generator.

Parameters:

argin (str) – Json encoded parameter List

Return type:

None

property csp_ingest_address: str

Get 40Gb CSP address.

Returns:

IP address for CSP ingest port

property csp_ingest_port: int

Get 40Gb CSP ingest port.

Returns:

UDP port for CSP ingest port

property csp_rounding: list[int] | None

CSP formatter rounding.

Rounding from 16 to 8 bits in final stage of the station beamformer, before sending data to CSP. Array of (up to) 384 values, one for each logical channel. Range 0 to 7, as number of discarded LS bits.

Returns:

CSP formatter rounding for each logical channel.

property csp_source_port: int

Get 40Gb CSP source port.

Returns:

UDP port for CSP source port

property forty_gb_network_address: str

Get 40Gb network address.

Returns:

IP network address for station network

forty_gb_network_errors()

Get summary of network errors.

Return type:

list[int]

Returns:

list of 40Gb network errors for all tiles

fpga_temperature_summary()

Get summary of FPGAs temperatures.

Return type:

list[float]

Returns:

minimum, average and maximum of FPGAs temperatures

initialise(task_callback=None)

Submit the _initialise method.

This method returns immediately after it submitted self._initialise for execution.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

property is_beamformer_running: bool

Get station beamformer state.

Returns:

Get station beamformer state

property is_configured: bool

Return whether this station component manager is configured.

Returns:

whether this station component manager is configured.

property is_programmed: bool

Get TPM programming state.

Returns:

True if all TPMs are programmed

load_calibration_coefficients(calibration_coefficients)

Load calibration coefficients.

These may include any rotation matrix (e.g. the parallactic angle), but do not include the geometric delay.

Parameters:

calibration_coefficients (list[float]) – a bidirectional complex array of coefficients, flattened into a list

Return type:

None

load_pointing_delays(delay_list)

Specify the delay in seconds and the delay rate in seconds/second.

The delay_array specifies the delay and delay rate for each antenna. beam_index specifies which beam is desired (range 0-47, limited to 7 in the current firmware)

Parameters:

delay_list (list[float]) – delay in seconds, and delay rate in seconds/second

Return type:

None

off(task_callback=None)

Submit the _off method.

This method returns immediately after it submitted self._off for execution.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a result code and response message

on(task_callback=None)

Submit the _on method.

This method returns immediately after it submitted self._on for execution.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

pll_locked_summary()

Get summary of PLL lock state.

Return type:

bool

Returns:

TRUE if PLL locked in all tiles

property pps_delay_corrections: list[int]

Get the PPS delay correction.

Returns:

Array of pps delay corrections, one value per tile, in nanoseconds

pps_delay_summary()

Get summary of PPS delays.

Return type:

list[float]

Returns:

minimum, average and maximum of PPS delays

property pps_delays: list[int]

Get PPS delay.

Array of one value per tile. Returns the PPS delay, Values are internally rounded to 1.25 ns steps

Returns:

Array of one value per tile, in nanoseconds

pps_present_summary()

Get summary of PPS presence.

Return type:

bool

Returns:

TRUE if PPS is present in all tiles

property preadu_levels: list[float]

Get attenuator level of preADU channels, one per input channel.

Returns:

Array of one value per antenna/polarization (32 per tile)

run_test(task_callback=None, *, count=1, test_name)

Submit the _run_test method.

This method returns immediately after it submitted self._run_test for execution.

Parameters:
  • task_callback (Optional[Callable]) – Update task state, defaults to None

  • count (Optional[int]) – how many times to run the test, default is 1.

  • test_name (str) – which test to run.

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

self_check(task_callback=None)

Submit the _self_check method.

This method returns immediately after it submitted self._self_check for execution.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

send_data_samples(argin)

Front end for send_xxx_data methods.

Parameters:

argin (str) – Json encoded parameter List

Return type:

None

set_beamformer_table(beamformer_table)

Set the frequency regions to be beamformed into a single beam.

Parameters:

beamformer_table (list[list[int]]) – a list encoding up to 48 regions, with each region containing a start channel, the size of the region (which must be a multiple of 8), and a beam index (between 0 and 7) and a substation ID (not used)

Return type:

None

set_channeliser_rounding(channeliser_rounding, task_callback=None)

Set the channeliserRounding in all Tiles.

Parameters:
  • channeliser_rounding (ndarray) – the number of LS bits dropped in each channeliser frequency channel.

  • task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

set_csp_ingest(dst_ip, src_port, dst_port)

Configure link for CSP ingest channel.

Parameters:
  • dst_ip (str) – Destination IP, defaults to None

  • src_port (int) – source port, defaults to 0xF0D0

  • dst_port (int) – destination port, defaults to 4660

Return type:

None

set_lmc_download(mode, payload_length, dst_ip, src_port=61648, dst_port=4660)

Configure link and size of LMC channel.

Parameters:
  • mode (str) – ‘1G’ or ‘10G’

  • payload_length (int) – SPEAD payload length for LMC packets

  • dst_ip (str) – Destination IP, defaults to None

  • src_port (int) – source port, defaults to 0xF0D0

  • dst_port (int) – destination port, defaults to 4660

Return type:

None

set_lmc_integrated_download(mode, channel_payload_length, beam_payload_length, dst_ip='', src_port=61648, dst_port=4660)

Configure link and size of integrated LMC channel.

Parameters:
  • mode (str) – ‘1G’ or ‘10G’

  • channel_payload_length (int) – SPEAD payload length for integrated channel data

  • beam_payload_length (int) – SPEAD payload length for integrated beam data

  • dst_ip (str) – Destination IP, defaults to None

  • src_port (int) – source port, defaults to 0xF0D0

  • dst_port (int) – destination port, defaults to 4660

Return type:

None

set_power_state(power_state, fqdn=None)

Set the power_state of the component.

TODO:

Power state should be set in the component mananger and then the device updated. Current design sets the component power state from the device component_state_changed callback. This should be corrected

Parameters:
  • power_state (PowerState) – the value of PowerState to be set.

  • fqdn (Optional[str]) – the fqdn of the component’s device.

Raises:

ValueError – fqdn not found

Return type:

None

standby(task_callback=None)

Submit the _standby method.

This method returns immediately after it submitted self._standby for execution.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

start_acquisition(argin, task_callback=None)

Submit the start acquisition method.

This method returns immediately after it submitted self._on for execution.

Parameters:

argin (str) – json dictionary with optional keywords

  • start_time - (str) start time

  • delay - (int) delay start

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

start_beamformer(start_time, duration, subarray_beam_id, scan_id)

Start the beamformer at the specified time.

Parameters:
  • start_time (str) – time at which to start the beamformer, defaults to 0

  • duration (float) – duration for which to run the beamformer, defaults to -1 (run forever)

  • subarray_beam_id (int) – ID of the subarray beam to start. Default = -1, all

  • scan_id (int) – ID of the scan which is started.

Return type:

None

start_communicating()

Establish communication with the station components.

Return type:

None

property static_delays: list[float]

Get static time delay correction.

Array of one value per antenna/polarization (32 per tile), in range +/-124. Delay in samples (positive = increase the signal delay) to correct for static delay mismathces, e.g. cable length.

Returns:

Array of one value per antenna/polarization (32 per tile)

stop_beamformer()

Stop the beamformer.

Return type:

None

stop_communicating()

Break off communication with the station components.

Return type:

None

stop_data_transmission()

Stop data transmission for send_channelised_data_continuous.

Return type:

None

stop_integrated_data()

Stop the integrated data.

Return type:

None

subscribe_to_attributes(task_callback=None, task_abort_event=None)

Subscribe to attributes of interest.

This will form subscriptions to attributes on subdevices MccsTile and MccsSubrack if attribute not already subscribed.

Parameters:
Return type:

None

sysref_present_summary()

Get summary of SYSREF presence.

Return type:

bool

Returns:

TRUE if SYSREF is present in all tiles

property test_generator_active: bool

Get test generator state.

Returns:

True if at least one TPM uses test generator

property test_list: list[str]

Get list of self-check tests available.

Returns:

list of self-check tests available.

property test_logs: str

Get logs of most recently run self-check test set.

Returns:

logs of most recently run self-check test set.

property test_report: str

Get report of most recently run self-check test set.

Returns:

report of most recently run self-check test set.

tile_programming_state()

Get TPM programming state.

Return type:

list[str]

Returns:

list of programming state for all TPMs

trigger_adc_equalisation(task_callback=None)

Submit the trigger adc equalisation method.

This method returns immediately after it submitted self._trigger_adc_equalisation for execution.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message