Station subpackage

This subpackage implements station functionality for MCCS.

class SpsStation(*args, **kwargs)

An implementation of an SPS Station Tango device for MCCS.

AcquireDataForCalibration(first_channel, last_channel, start_time=None, daq_mode='TCC', nof_samples=1835008)

Start acquiring data for calibration.

This is a long running command, but unlike the station’s other LRCs it does not execute on the general lane of the task executor. An acquisition runs for as long as it takes the requested channels to arrive, and the station must stay available for other commands - notably Scan - throughout. It therefore executes on the calibration lane, and is reported through the usual LRC attributes alongside whatever else is executing. Abort aborts every lane, so it stops this too.

A JSON string containing the keys:

Parameters:
  • first_channel (int) – the first channel to acquire, in the range 0-511

  • last_channel (int) – the last channel to acquire, in the range 0-511

  • start_time (Optional[str]) – optional start acquisition time in ISO9601 format defaults to ‘now’

  • daq_mode (str) – the DAQ mode to use for acquisition, either “TCC” or “DSS” defaults to “TCC”

  • nof_samples (int) – the number of samples to acquire defaults to 1835008 (corresponding to 1 subband of data at 8kHz resolution)

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("low-mccs/spsstation/ci-1")
>>> argin = json.dumps({"first_channel": 64, "last_channel": 448})
>>> dp.command_inout("AcquireDataForCalibration", argin)
ApplyCalibration(argin)

Load the calibration coefficients at the specified time delay.

Parameters:

argin (str) – switch time, in ISO formatted time. Default: now

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dp.command_inout("ApplyCalibration", "")
ApplyPointingDelays(argin)

Set the pointing delay parameters of this Station’s Tiles.

Parameters:

argin (str) – switch time, in ISO formatted time. Default: now

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/station/01")
>>> time_string = switch time as ISO formatted time
>>> dp.command_inout("ApplyPointingDelays", time_string)
property BandpassdaqTRL

The TRL of this SpsStation’s Bandpass Daq instance.

BeamformerRunningForChannels(channel_groups=None)

Check whether the beamformer is running for the given channel groups.

Parameters:

channel_groups (Optional[list[int]]) – list of channel groups to check. If None, check all channel groups.

  • channel_groups - (list) List of channel groups

Return type:

bool

Returns:

Whether the beamformer is running

Example:

>>> dp = tango.DeviceProxy("mccs/station/01")
>>> dict = {"channel_groups": [0,1,4,5]}
>>> jstr = json.dumps(dict)
>>> running = dp.command_inout("BeamformerRunningForChannels", jstr)
ConfigureIntegratedBeamData(argin)

Configure the transmission of integrated beam data.

Using the provided integration time, the first channel and the last channel. The data are sent continuously until the StopIntegratedData command is run.

Parameters:

argin (str) – json dictionary with optional keywords:

  • integration_time - (float) in seconds (default = 0.5)

  • first_channel - (int) default 0

  • last_channel - (int) default 191

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"integration_time": 0.2, "first_channel":0, "last_channel": 191}
>>> jstr = json.dumps(dict)
>>> dp.command_inout("ConfigureIntegratedBeamData", jstr)
ConfigureIntegratedChannelData(argin)

Configure and start the transmission of integrated channel data.

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

Parameters:

argin (str) – json dictionary with optional keywords:

  • integration_time - (float) in seconds (default = 0.5)

  • first_channel - (int) default 0

  • last_channel - (int) default 511

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"integration_time": 0.2, "first_channel":0, "last_channel": 191}
>>> jstr = json.dumps(dict)
>>> dp.command_inout("ConfigureIntegratedChannelData", jstr)
ConfigureStationForCalibration(daq_config)

Configure the station for calibration.

Parameters:

daq_config (str) – a JSON string containing optional additions/overrides to default DAQ configuration.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("low-mccs/spsstation/ci-1")
>>> json_arg = json.dumps({"description" : "Calibration data for s8-2"})
>>> dp.command_inout("ConfigureStationForCalibration", json_arg)
ConfigureTestGenerator(argin)

Set the test signal generator.

Parameters:

argin (str) – json dictionary with keywords:

  • tone_frequency: first tone frequency, in Hz. The frequency

    is rounded to the resolution of the generator. If this is not specified, the tone generator is disabled.

  • tone_amplitude: peak tone amplitude, normalized to 31.875 ADC

    units. The amplitude is rounded to 1/8 ADC unit. Default is 1.0. A value of -1.0 keeps the previously set value.

  • tone_2_frequency: frequency for the second tone. Same

    as ToneFrequency.

  • tone_2_amplitude: peak tone amplitude for the second tone.

    Same as ToneAmplitude.

  • noise_amplitude: RMS amplitude of the pseudorandom Gaussian

    white noise, normalized to 26.03 ADC units.

  • pulse_frequency: frequency of the periodic pulse. A code

    in the range 0 to 7, corresponding to (16, 12, 8, 6, 4, 3, 2) times the ADC frame frequency.

  • pulse_amplitude: peak amplitude of the periodic pulse, normalized

    to 127 ADC units. Default is 1.0. A value of -1.0 keeps the previously set value.

  • set_time: time at which the generator is set, for synchronization

    among different TPMs. In UTC ISO format (string)

  • adc_channels: list of adc channels which will be substituted with

    the generated signal. 32 bit integer, with each bit representing an input channel. Default: all if at least 1 source is specified, none otherwises.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"tone_frequency": 150e6, "tone_amplitude": 0.1,
        "noise_amplitude": 0.9, "pulse_frequency": 7,
        "set_time": "2022-08-09T12:34:56.7Z"}
>>> jstr = json.dumps(dict)
>>> values = dp.command_inout("ConfigureTestGenerator", jstr)
DescribeTest(test_name)

Fetch the docstring of a given test.

Parameters:

test_name (str) – the name of the test you wish to fetch the details of.

Return type:

str

Returns:

the docstring of a given test.

Initialise()

Initialise the station.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("mccs/station/001")
>>> dp.command_inout("Initialise")
property LMCdaqTRL

The TRL of this SpsStation’s LMC Daq instance.

LoadCalibrationCoefficients(argin)

Load the calibration coefficients, but does not apply them.

This is performed by apply_calibration. The calibration coefficients may include any rotation matrix (e.g. the parallactic angle), but do not include the geometric delay.

Parameters:

argin (list[float]) – list comprises:

  • antenna - (int) is the antenna to which the coefficients will be applied.

  • calibration_coefficients - [array] a bidimensional complex array comprising

    calibration_coefficients[channel, polarization], with each element representing a normalized coefficient, with (1.0, 0.0) being the normal, expected response for an ideal antenna.

    • channel - (int) channel is the index specifying the channels at the

      beamformer output, i.e. considering only those channels actually processed and beam assignments.

    • polarization index ranges from 0 to 3.

      • 0: X polarization direct element

      • 1: X->Y polarization cross element

      • 2: Y->X polarization cross element

      • 3: Y polarization direct element

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises:

ValueError – if parameters are illegal or inconsistent

Example:

>>> antenna = 2
>>> complex_coefficients = [[complex(3.4, 1.2), complex(2.3, 4.1),
>>>            complex(4.6, 8.2), complex(6.8, 2.4)]]*5
>>> inp = list(itertools.chain.from_iterable(complex_coefficients))
>>> out = ([v.real, v.imag] for v in inp]
>>> coefficients = list(itertools.chain.from_iterable(out))
>>> coefficients.insert(0, float(antenna))
>>> input = list(itertools.chain.from_iterable(coefficients))
>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dp.command_inout("LoadCalibrationCoefficients", input)
LoadCalibrationCoefficientsForChannels(calibration_coefficients)

Load the calibration coefficients, but does not apply them.

This is performed by apply_calibration. The calibration coefficients may include any rotation matrix (e.g. the parallactic angle), but do not include the geometric delay.

Parameters:

calibration_coefficients (list[float]) – list comprises:

  • first_channel - (int) is the first channel in the block of channels

    to which the coefficients will be applied.

  • calibration_coefficients - [array] a flatteded tridimensional complex

    array comprising calibration_coefficients[channel, antenna, pol], with each element representing a normalized coefficient, with (1.0, 0.0) being the normal, expected response for an ideal antenna.

    • channel - (int) channel is the index specifying the channels at the

      beamformer output, i.e. considering only those channels actually processed and beam assignments.

    • antenna - (int) antenna index ranging from 0 to 255, in

      (tile, antenna) order

    • polarization index ranges from 0 to 3.

      • 0: X polarization direct element

      • 1: X->Y polarization cross element

      • 2: Y->X polarization cross element

      • 3: Y polarization direct element

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> first_channel = 8
>>> complex_coefficients = [[complex(3.4, 1.2), complex(2.3, 4.1),
>>>            complex(4.6, 8.2), complex(6.8, 2.4)]]*256*8
>>> inp = list(itertools.chain.from_iterable(complex_coefficients))
>>> out = ([v.real, v.imag] for v in inp]
>>> coefficients = list(itertools.chain.from_iterable(out))
>>> coefficients.insert(0, float(first_channel))
>>> input = list(itertools.chain.from_iterable(coefficients))
>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dp.command_inout("LoadCalibrationCoefficientsForChannels", input)
LoadPointingDelays(argin)

Set the pointing delay parameters of this Station’s Tiles.

Parameters:

argin (list[float]) – an array containing a beam index followed by pairs of antenna delays + delay rates, delay in seconds and the delay rate in seconds/second. In order of antenna EEP.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises:

ValueError – if parameters are illegal or inconsistent

Example:

>>> # example delays: 256 values from -32 to +32 ns, rates = 0
>>> delays = [step * 0.25e-9 for step in list(range(-128, 128))]
>>> rates = [0.0]*256
>>> beam = 0.0
>>> dp = tango.DeviceProxy("mccs/station/01")
>>> arg = [beam]
>>> for i in range(256)
>>>   arg.append(delays[i])
>>>   arg.append(rates[i])
>>> dp.command_inout("LoadPointingDelays", arg)
LoadScanId(scan_id, channel_groups=None)

Set the scan ID for specified channel groups.

Parameters:
  • scan_id (int) – unique scan ID to assign to the channel groups,

  • channel_groups (Optional[list[int]]) – Channel groups to be affected, default all

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/station/01")
>>> dict = {"channel_groups": [0,1,4,5], "scan_id": 12345603}
>>> jstr = json.dumps(dict)
>>> dp.command_inout("LoadScanId", jstr)
ReInitialise(start_bandpasses=None, global_reference_time=None)

Reinitialise the station with overridable defaults.

This runs the same sequence as Initialise, except that the tiles are re-initialised without reprogramming their FPGAs.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

A json string adhering to the initialise schema:

Parameters:
  • start_bandpasses (Optional[bool]) – whether to start the bandpasses after initialisation defaults to true

  • global_reference_time (Optional[str]) – the global synchronization time, in ISO9660 format or “” to use current time, defaults to “”

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://skao.int/SpsStation_Initialise.json",
    "title": "SpsStation Initialise schema",
    "description": "Schema for SpsStations's Initialise command",
    "type": "object",
    "properties": {
        "global_reference_time": {
            "description": "Common global reference time for all TPMs, needs to be some time in the last 2 weeks. If not provided, 8am on the most recent Monday AWST will be used.",
            "type": "string"
        },
        "start_bandpasses": {
            "description": "Whether to configure the TPMs to send integrated channel data to the bandpass DAQ.",
            "type": "boolean"
        }
    },
    "required": []
}
Example:
>>> dp = tango.DeviceProxy("mccs/station/001")
>>> dp.command_inout("Reinitialise")
ResetCspIngest()

Reset link for beam data packets to CSP to defaults.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

RunTest(test_name, count=1)

Run a self-check test an optional amount of times.

A json-string containing a required ‘test_name’, and optional

‘count’

Parameters:
  • test_name (str) – the name of the test to run, should be one of the available tests in testList attribute.

  • count (int) – the number of times to run the test, defaults to 1 if not specified.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("low-mccs/spsstation/aavs3")
>>> dp.RunTest(json.dumps({"test_name" : "my_test", "count" : 5}))
SelfCheck()

Run all the self-check tests once.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("low-mccs/spsstation/aavs3")
>>> dp.SelfCheck()
SendDataSamples(argin)

Transmit a snapshot containing raw antenna data.

Parameters:

argin (str) – json dictionary with optional keywords:

  • data_type - type of snapshot data (mandatory): “raw”, “channel”,

    “channel_continuous”, “narrowband”, “beam”

  • start_time - Time (UTC string) to start sending data. Default immediately

  • seconds - (float) Delay if timestamp is not specified. Default 0.2 seconds

  • force - (bool) Whether or not to cancel ongoing data requests.

Depending on the data type: raw:

  • sync: bool: send synchronised samples for all antennas, vs. round robin

    larger snapshot from each antenna

channel:

  • n_samples: Number of samples per channel, default 1024

  • first_channel - (int) first channel to send, default 0

  • last_channel - (int) last channel to send, default 511

channel_continuous

  • channel_id - (int) channel_id (Mandatory)

  • n_samples - (int) number of samples to send per packet, default 128

narrowband:

  • frequency - (int) Sky frequency for band centre, in Hz (Mandatory)

  • round_bits - (int) Specify whow many bits to round

  • n_samples - (int) number of spectra to send

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises:

ValueError – if mandatory parameters are missing

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"data_type": "raw", "Sync":True, "Seconds": 0.2}
>>> jstr = json.dumps(dict)
>>> dp.command_inout("SendDataSamples", jstr)
SetBeamFormerRegions(argin)

Set the frequency regions which are going to be beamformed into each beam.

region_array is defined as a flattened 2D array, for a maximum of 48 regions. Total number of channels must be <= 384.

Parameters:

argin (list[int]) – list of regions. Each region comprises:

  • start_channel - (int) region starting channel, must be even in range 0 to 510

  • num_channels - (int) size of the region, must be a multiple of 8

  • beam_index - (int) beam used for this region with range 0 to 47

  • subarray_id - (int) Subarray

  • subarray_logical_channel - (int) logical channel # in the subarray

  • subarray_beam_id - (int) ID of the subarray beam

  • substation_id - (int) Substation

  • aperture_id: ID of the aperture (station*100+substation?)

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises:

ValueError – if parameters are illegal or inconsistent

Example:

>>> regions = [[4, 24, 0, 0, 0, 3, 1, 101], [26, 40, 1, 0, 24, 4, 2, 102]]
>>> input = list(itertools.chain.from_iterable(regions))
>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dp.command_inout("SetBeamFormerRegions", input)
SetBeamFormerTable(argin)

Set the beamformer table which are going to be beamformed into each beam.

region_array is defined as a flattened 2D array, for a maximum of 48 entries. Each entry corresponds to 8 consecutive frequency channels. This is equivalent to SetBeamFormerRegions, with a different way to specify the bandwidth of each spectral region. Input is consistent with the beamformerTable attribute

Parameters:

argin (list[int]) – list of regions. Each region comprises:

  • start_channel - (int) region starting channel, must be even in range 0 to 510

  • beam_index - (int) beam used for this region with range 0 to 47

  • subarray_id - (int) Subarray

  • subarray_logical_channel - (int) logical channel # in the subarray

  • subarray_beam_id - (int) ID of the subarray beam

  • substation_id - (int) Substation

  • aperture_id: ID of the aperture (station*100+substation?)

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises:

ValueError – if parameters are illegal or inconsistent

Example:

>>> regions = [[4, 0, 0, 0, 3, 1, 101], [26, 1, 0, 24, 4, 2, 102]]
>>> input = list(itertools.chain.from_iterable(regions))
>>> dp = tango.DeviceProxy("mccs/station/01")
>>> dp.command_inout("SetBeamFormerTable", input)
SetChanneliserRounding(channeliser_rounding)

Set the ChanneliserRounding to all Tiles in this Station.

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

Parameters:

channeliser_rounding (list[int]) – list of 512 values, one per channel. this will apply to all Tiles in this station.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("low-mccs/station/aavs3")
>>> dp.command_inout("SetChanneliserRounding", np.array([2]*512))
SetCspIngest(argin)

Configure link for beam data packets to CSP.

Parameters:

argin (str) –

json dictionary with optional keywords:

  • destination_ip - (string) Destination IP

  • source_port - (int) Source port for integrated data streams

  • destination_port - (int) Destination port for integrated data streams

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"destination_ip"="10.0.1.23"}
>>> jstr = json.dumps(dict)
>>> dp.command_inout("SetCspIngest", jstr)
SetLmcDownload(argin)

Specify whether control data will be transmitted over 1G or 40G networks.

Parameters:

argin (str) –

json dictionary with optional keywords:

  • mode - (string) ‘1G’ or ‘10G’ (Mandatory) (use ‘10G’ for 40G also)

  • data_type - (string) Data type to configure (omit for all).

  • payload_length - (int) SPEAD payload length for channel data

  • destination_ip - (string) Destination IP.

  • source_port - (int) Source port for integrated data streams

  • destination_port - (int) Destination port for integrated data streams

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>> dp = tango.DeviceProxy(“mccs/tile/01”) >> dict = {“mode”: “1G”, “payload_length”: 1024, “destination_ip”: “10.0.1.23”} >> jstr = json.dumps(dict) >> dp.command_inout(“SetLmcDownload”, jstr)

SetLmcIntegratedDownload(argin)

Configure link and size for integrated data packets, for all tiles.

Parameters:

argin (str) –

json dictionary with optional keywords:

  • mode - (string) ‘1G’ ‘10G’ ‘40G’ - default 40G

  • channel_payload_length - (int) SPEAD payload length for integrated

    channel data

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

  • destination_ip - (string) Destination IP

  • source_port - (int) Source port for integrated data streams

  • destination_port - (int) Destination port for integrated data streams

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"mode": "1G", "channel_payload_length":4,
            "beam_payload_length": 1024, "destination_ip"="10.0.1.23"}
>>> jstr = json.dumps(dict)
>>> dp.command_inout("SetLmcIntegratedDownload", jstr)
StartAcquisition(start_time=None, delay=None)

Start the acquisition synchronously for all tiles, checks for synchronisation.

If a start time isn’t given, it will default to ‘now’.

Parameters:
  • start_time (Optional[str]) – Start acquisition time in ISO9601 format

  • delay (Optional[int]) – Optional delay in seconds before starting acquisition

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("mccs/station/001")
>>> dp.command_inout("StartAcquisition", "20230101T12:34:55.000Z")
StartBeamformer(start_time=None, duration=-1, channel_groups=None, scan_id=0)

Start the beamformer at the specified time delay.

NOTE: Supplying start_time is recommended. Transient station beamformer error spikes at startup are caused by non-synchronised TPM beamformer start (SKB-1397). Simultaneous starts avoid the issue. A start time 4 seconds in the future is typically sufficient for the request to arrive on the TPMs.

A json dictionary with optional keywords:

Parameters:
  • start_time (Optional[str]) – (str, ISO UTC time) start time

  • duration (int) – (int) if > 0 is a duration in seconds if < 0 run forever

  • channel_groups (Optional[list[int]]) – (list(int)) : list of channel groups to be started Command affects only beamformed channels for given groups Default: all channels

  • scan_id (int) – (int) The unique ID for the started scan. Default 0

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"StartTime": "2022-01-02T34:56:08.987Z", "Duration": 30.0}
>>> jstr = json.dumps(dict)
>>> dp.command_inout("StartBeamformer", jstr)
StopBeamformer()

Stop the beamformer for all channel groups.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dp.command_inout("StopBeamformer")
StopBeamformerForChannels(channel_groups=None)

Stop the beamformer for given channel groups.

A json dictionary with optional keywords:

Parameters:

channel_groups (Optional[list[int]]) – (list(int)) : list of channel groups to be started Command affects only beamformed channels for given groups Default: all channels

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dict = {"channel_groups": [0,1,4] }
>>> jstr = json.dumps(dict)
>>> dp.command_inout("StopBeamformerForChannels", jstr)
StopDataTransmission()

Stop data transmission from board.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:

>>> dp = tango.DeviceProxy("mccs/tile/01")
>>> dp.command_inout("StopDataTransmission")
StopIntegratedData()

Stop the integrated data.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

property TileGroupTimeout

Set the timeout [ms] for all devices in the tile group. Any method which takes longer than this time to execute will throw an exception.

TriggerAdcEqualisation(target_adc=17.0, bias=0.0)

Get the equalised ADC values.

Getting the equalised values takes up to 20 seconds (to get an average to avoid spikes). So we trigger the collection and publish to dbmPowers

A JSON string containing:

Parameters:
  • target_adc (float) – the expected average power received by antennas in ADU units. Has an input minimum of 0, but in code its limited to 4.2e-7 (corresponds to the maxiumum output of 31.75 dB). There is no maximum value, however, 40 ADUs will result in 0 dB with no bias and 1600 ADUs will result in 0 dB with the maxiumum bias allowed of 32dB. Defaults to 17.

  • bias (float) – user specifed bias in dB added to the antenna preadu levels. Bias input value rounded as part of value sanitation and as a result it increases in steps of 0.25. Ranges from -32 to 32 with default 0.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> dp = tango.DeviceProxy("mccs/station/001")
>>> json_arg = json.dumps({"target_adc" : "18"})
>>> dp.command_inout("TriggerAdcEqualisation", json_arg)
UpdateStaticDelays()

Update static delays from TelModel.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

WrenHealthCheckFailOnTimeout(enabled)

Set whether the WREN Health Check feature is enabled.

Parameters:

enabled (bool) – True to enable WREN Health Check, False to disable.

Return type:

None

WrenHealthCheckTimeout(timeout)

Set the WREN Health Check timeout in seconds.

Parameters:

timeout (float) – The timeout in seconds for WREN Health Check.

Return type:

None

property WrenTRL

The TRL of this SpsStation’s White Rabbit End Node (WREN) instance.

__init__(*args, **kwargs)

Initialise this device object.

Parameters:
  • args (Any) – positional args to the init

  • kwargs (Any) – keyword args to the init

property adcPower

Get the ADC RMS input levels for all input signals. NaN for every channel of a tile whose value is invalid.

Unit:

ADC units

property antennaInfo: str

Return a json string coded by antenna number containing an antenna’s Station_ID, Tile_ID and location information.

property antennasMapping: str

Return a mapping of antenna number to TPM port number.

property beamformerDaisyChainValid: bool

Return whether all TPMs are correctly daisy-chained for beamforming.

property beamformerRegions

Get beamformer region table.Bidimensional array of one row for each 8 channels, with elements: 0. start physical channel, 1. number of channels, 2. beam index, 3. subarray ID, 4. subarray_logical_channel, 5. subarray_beam_id, 6. substation_id, 8. aperture_id. Each row is a set of 8 consecutive elements in the list. Every element is -1 while the final tile’s value is invalid.

property beamformerTable

Get beamformer 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. Every element is -1 while the final tile’s value is invalid.

property boardTemperaturesSummary

Get summary of board temperatures (minimum, average, maximum). Tiles whose value is invalid are excluded.

Unit:

Celsius

property channeliserRounding

Number of LS bits dropped in each channeliser freq channel. -1 for every channel of a tile whose value is invalid.

property clockPresentSummary: bool

Get a summary of clock present status for all tiles. True if 10 MHz clock signal is present in all tiles.

create_component_manager()

Create and return a component manager for this device.

Return type:

SpsStationComponentManager

Returns:

a component manager for this device.

property cspIngestAddress: str

Get the CSP ingest address for this station.

property cspIngestConfig

Report the CSP Ingest configuration in use for this station.

property cspIngestPort: int

Get the CSP ingest port for this station.

property cspRounding

CSP formatter rounding. Range 0 to 7, as number of discarded LS bits. -1 for every channel while the final tile’s value is invalid.

Unit:

Decibel

property cspSourcePort: int

Get the CSP source port for this station.

property cspSpeadFormat: str

Gets the SPEAD format currently in use. (AAVS or SKA)

property daqPath: str

The folder location where DAQ data files are stored.

property dataReceivedResult

Read the result of the receiving of data. A tuple containing the data mode and a json string with additional info.

delete_device()

Do any necessary cleanup.

Return type:

None

property executeAsync: bool

Whether to execute MccsTile methods asynchronously.

property finalTileBeamformerFlaggedCountOk: bool

Return whether the final tile’s station beamformer flagged packet count is zero.

property fortyGbNetworkAddress: str

Get the 40Gb network address for this station.

property fortyGbNetworkErrors

Get the number of network errors for all 40Gb interfaces.

property fpgaTemperaturesSummary

Get summary of FPGA temperatures (minimum, average, maximum). Tiles whose value is invalid are excluded.

Unit:

Celsius

property globalReferenceTime: str

Return the global FPGA synchronization time. (UTC)

property healthModelParams: str

Get the health model parameters (old Health Model).

property healthReport: str

The current health report.

property healthThresholds: str

Get the current health thresholds in use. (New health model.)

init_device()

Initialise the device.

Return type:

None

property isBeamformerRunning: bool

Get the state of the beamformer across this station’s tiles. Returns True if the beamformer is active in all tiles. Returns False if any tile’s value is invalid.

property isCalibrated: bool

Return a flag indicating whether this station is currently calibrated.

property isConfigured: bool

Return a flag indicating whether this station is currently configured.

property isProgrammed: bool

Return a flag indicating whether of not the TPM boards are programmed. Attribute is False if at least one TPM is not programmed.

is_ConfigureStationForCalibration_allowed(request_type=ska_tango_base.long_running_commands.LRCReqType.ENQUEUE_REQ)

Return whether the ConfigureStationForCalibration command is allowed.

Parameters:

request_type (LRCReqType | None) – the request type.

Return type:

bool

Returns:

True if the command is allowed.

is_Initialise_allowed(request_type=ska_tango_base.long_running_commands.LRCReqType.ENQUEUE_REQ)

Return whether the Initialise command is allowed.

Parameters:

request_type (LRCReqType | None) – the request type.

Return type:

bool

Returns:

True if the command is allowed.

is_ReInitialise_allowed(request_type=ska_tango_base.long_running_commands.LRCReqType.ENQUEUE_REQ)

Return whether the ReInitialise command is allowed.

Parameters:

request_type (LRCReqType | None) – the request type.

Return type:

bool

Returns:

True if the command is allowed.

is_SetLmcDownload_allowed(request_type=ska_tango_base.long_running_commands.LRCReqType.ENQUEUE_REQ)

Return whether the SetLmcDownload command is allowed.

Parameters:

request_type (LRCReqType | None) – the request type. Unused, as SetLmcDownload is a fast command, but accepted so that this keeps working if it ever becomes an LRC.

Return type:

bool

Returns:

True if the command is allowed.

is_StartAcquisition_allowed(request_type=ska_tango_base.long_running_commands.LRCReqType.ENQUEUE_REQ)

Return whether the StartAcquisition command is allowed.

Parameters:

request_type (LRCReqType | None) – the request type.

Return type:

bool

Returns:

True if the command is allowed.

property keepTestData: bool

Whether to keep or discard test data after self-check tests are run.

property lastPointingDelays

Return the last pointing delays applied to the tiles. Values in antenna EEP order.

property pllLockedSummary: bool

Get summary of PLL locked status for all tiles. True if PLL is locked to reference in all tiles. False if any tile’s value is invalid.

property pointingDelays

Read the last pointing delays received from hardware.

property ppsDelayCorrections

Get PPS delay corrections, one value per tile.

Unit:

Clock Cycle (/1.25ns)

property ppsDelaySpread: int

Returns the difference between the max and min PPS delays across all tiles in this Station.

Unit:

Clock Cycle (/1.25ns)

property ppsDelaySummary

Get summary of PPS delays (minimum, average, maximum).

Unit:

Clock Cycle (/1.25ns)

property ppsDelays

Get PPS delay, one value per tile.

Unit:

Clock Cycle (/1.25ns)

property ppsPresentSummary: bool

Get summary of PPS present status for all tiles. True if PPS signal is present in all tiles. False if any tile’s value is invalid.

property preaduLevels

Get attenuator level of preADU channels, one per input channel. NaN for every channel of a tile whose value is invalid.

property staticTimeDelays

Get the current static time delays. Array of one value per antenna/polarization (32 per tile), in range +/-124. Delay in nanoseconds (positive = increase the signal delay) to correct for static delay mismatches, e.g. cable length. NaN for every channel of a tile whose value is invalid.

Unit:

Nanoseconds

property sysrefPresentSummary: bool

Get summary of SYSREF present status for all tiles. True if SYSREF signal is present in all tiles.

property testGeneratorActive: bool

Get the state of the test generator across this station’s tiles. Returns True if the test generator is active in at least one tile. A tile whose value is invalid is treated as inactive.

property testList

Get the list of available self-check tests.

property testLogs: str

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

property testReport: str

Get the report for the most recently run self-check test set.

testResults()

Get the last result of each self-check test, in testList order.

Values correspond to TestResult: PASSED=0, FAILED=1, ERROR=2, NOT_RUN=3.

Return type:

list[int]

Returns:

list of TestResult integer values, one per test.

property tileProgrammingState

Returns the Tile Programming State of all tiles in this Station.

property timeToFrameCounterWrap

Number of seconds until the station’s frame counter wraps around.

Unit:

Seconds

Min warning:

86400

Min alarm:

0

property useNewHealthModel: bool

Return a flag indicating whether the new health model is in use.

property xPolBandpass

Read the last bandpass plot for the x-polarisation.

property yPolBandpass

Read the last bandpass plot for the y-polarisation.

class SpsStationComponentManager(station_id, subrack_fqdns, tile_fqdns, lmc_daq_trl, bandpass_daq_trl, calibration_daq_trl, wren_trl, sdn_first_interface, sdn_gateway, csp_ingest_ip, channeliser_rounding, csp_rounding, antenna_config_uri, start_bandpasses_in_initialise, bandpass_integration_time, wren_health_check_fail_on_timeout, wren_health_check_timeout, logger, communication_state_changed_callback, component_state_changed_callback, tile_health_changed_callback, subrack_health_changed_callback, wren_health_changed_callback, tile_group, event_serialiser=None)

A component manager for a station.

__init__(station_id, subrack_fqdns, tile_fqdns, lmc_daq_trl, bandpass_daq_trl, calibration_daq_trl, wren_trl, sdn_first_interface, sdn_gateway, csp_ingest_ip, channeliser_rounding, csp_rounding, antenna_config_uri, start_bandpasses_in_initialise, bandpass_integration_time, wren_health_check_fail_on_timeout, wren_health_check_timeout, logger, communication_state_changed_callback, component_state_changed_callback, tile_health_changed_callback, subrack_health_changed_callback, wren_health_changed_callback, tile_group, event_serialiser=None)

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

  • lmc_daq_trl (str) – The TRL of this Station’s DAQ Receiver for general LMC use. Could be empty if the device property is not set.

  • bandpass_daq_trl (str) – The TRL of this Station’s DAQ Receiver for bandpasses. Could be empty if the device property is not set.

  • calibration_daq_trl (str) – The TRL of this Station’s DAQ Receiver for calibration data. Could be empty if the device property is not set.

  • wren_trl (str) – The TRL of this Station’s WREN instance. Could be empty if the device property is not set.

  • sdn_first_interface (IPv4Interface) – 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 (Optional[IPv4Address]) – IP address of the SDN gateway, or None if the network has no gateway.

  • csp_ingest_ip (Optional[IPv4Address]) – IP address of the CSP ingest for this station.

  • channeliser_rounding (Optional[list[int]]) – The channeliser rounding to use for this station.

  • csp_rounding (int) – The CSP rounding to use for this station. An integer value between 0 and 7. Currently the underlying library accepts a list of 384 values (one for each coarse channel sent to CSP) but it actually only uses the first one of these. Until it is updated to support a full list, we restrict this interface to one integer.

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

  • start_bandpasses_in_initialise (bool) – whether to start bandpasses in initialise.

  • bandpass_integration_time (float) – the integration time for channelised data capture started in initialise.

  • wren_health_check_fail_on_timeout (bool) – Should initialise fail in WREN health check times-out

  • wren_health_check_timeout (float) – The timeout for the WREN initialisation

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

  • 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

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

  • event_serialiser (Optional[EventSerialiser]) – the event serialiser to be used by this object.

  • tile_group (Group) – An optional injected group.

acquire_data_for_calibration(first_channel, last_channel, start_time=None, daq_mode='TCC', nof_samples=1835008, task_callback=None, task_abort_event=None)

Acquire data for calibration.

Parameters:
  • start_time (Optional[str]) – UTC Time for start sending data.

  • first_channel (int) – first channel to calibrate for

  • last_channel (int) – last channel to calibrate for

  • daq_mode (str) – the correlator mode to start, xGPU or TCC.

  • nof_samples (int) – the number of samples to integrate, only variable in TCC.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

Return type:

None

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:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

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:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

property beamformer_daisy_chain_valid: bool | None

Return whether the station beamformer daisy chain is correctly configured.

None until all non-last tiles have reported their destination IPs.

Returns:

True if correctly configured, False if misconfigured, None if unknown.

property beamformer_regions: list[list[int]]

Get beamformer region table.

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

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

Returns:

list of up to 8*48 values

beamformer_running_for_channels(channel_groups)

Check if the beamformer is running in a list of channel blocks.

Parameters:

channel_groups (Optional[list[int]]) – List of channel blocks to check

Return type:

bool

Returns:

True if the beamformer is running

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:

Optional[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. A tile whose value is INVALID reports -1 for every channel.

Returns:

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

cleanup()

Cleanup resources held by the component manager.

This includes cleaning up resources held by all sub-component managers.

Return type:

None

clock_present_summary()

Get summary of 10 MHz clock presence.

Return type:

bool

Returns:

TRUE if 10 MHz clock is present in all tiles. Always False for now, as clockPresent is not yet implemented in ska-low-sps-tpm-api and so is not subscribed to.

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:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

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:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

configure_station_for_calibration(task_callback=None, task_abort_event=None, **daq_config)

Configure station for calibration.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

  • daq_config (Any) – any extra config to configure DAQ with

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing the result code and a human-readable status message.

configure_test_generator(argin)

Distribute to tiles command configure_test_generator.

Parameters:

argin (str) – Json encoded parameter List

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

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 csp_spead_format: str

Get CSP SPEAD format.

CSP format is: AAVS for the format used in AAVS2-AAVS3 system, using a reference Unix time specified in the header. SKA for the format defined in SPS-CBF ICD, based on TAI2000 epoch.

Returns:

CSP Spead format. AAVS or SKA

describe_test(test_name)

Return the doc string of a given self-check test.

Parameters:

test_name (str) – name of the test.

Return type:

str

Returns:

the doc string of a given self-check test.

property final_tile_beamformer_flagged_count_ok: bool | None

Return whether the final tile’s station beamformer flagged count is zero.

None until the final tile has reported its flagged packet counts, or while a count is INVALID and the other is zero.

Returns:

True if both FPGA counts are zero, False otherwise, None if unknown.

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:

Optional[list[float]]

Returns:

minimum, average and maximum of FPGAs temperatures

property global_reference_time: str

Return the UTC time used as global synchronization time.

Returns:

UTC time in ISOT format used as global synchronization time

initialise(start_bandpasses=None, global_reference_time=None, force_reprogramming=True, task_callback=None, task_abort_event=None)

Initialise this station.

Parameters:
  • start_bandpasses (Optional[bool]) – Whether to configure TPMs to send integrated data.

  • global_reference_time (Optional[str]) – Common global reference time for all TPMs, needs to be some time in the last 2 weeks. If not provided, midnight today (TAI) will be used.

  • force_reprogramming (bool) – whether to erase and reprogram the tile FPGAs. If false, the tiles keep their firmware and are only re-initialised (used by ReInitialise).

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

  • task_abort_event (Optional[Event]) – Abort the task

Return type:

None

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

property keep_test_data: bool

Get whether test data will be kept from the self_check_manager.

Returns:

whether the test data will be kept.

property last_test_results: list[int]

Get the last result of each self-check test in testList order.

Returns:

list of TestResult integer values, one per test.

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_calibration_coefficients_for_channels(calibration_coefficients, task_callback=None, task_abort_event=None)

Load calibration coefficients for all antennas and specific channels.

Parameters:
  • calibration_coefficients (list[float]) – a tridimensional complex array of coefficients, indexed by channels, antennas, polarizations, flattened into a list. First element is first channel. Dimension of antennas is 256, in tile antenna order, Dimension of polarizations is 4.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

Raises:

ValueError – when the number of coefficients is insufficient or not a multiple of 2048 (i.e. 8 coefficients per channel per antenna)

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. First element in the array is beam_index: specifies which beam is desired (range 0-47, limited to 7 in the current firmware) Other elements are pairs of delay and delay rate for each antenna, in EEP antenna order. delay_list[2*eep_index -1] is delay, in seconds, and delay_list[2*eep] is the delay rate, in second/second, for antenna with given EEP index (range 1-256)

Only Synchronised tiles will accept pointing delays; tiles that aren’t are skipped (nothing is committed until the subsequent apply_pointing_delays()).

Parameters:

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

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

load_scan_id(scan_id, channel_groups)

Load or change the scan ID to a set of channel groups.

Used in the Scan/EndScan ObsMode command to update the scan ID at the beginning of a scan, without stopping the beamformer

Parameters:
  • scan_id (int) – the new scan ID to set

  • channel_groups (list[int]) – list of channel groups, in range 0:48. group 0 for channels 0-7, to group 47 for channels 380-383

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

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

property pps_delay_spread: int

Get PPS delay delta.

Returns the difference between the maximum and minimum delays so that users can track an observed pps drift. Returns a result in samples, each sample is 1.25ns.

Returns:

Maximum delay difference between tiles in samples.

pps_delay_summary()

Get summary of PPS delays.

Return type:

Optional[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(count, test_name, task_callback=None, task_abort_event=None)

Run a specific self check test.

Parameters:
  • count (int) – how many times to run the test.

  • test_name (str) – which test to run.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

Return type:

None

self_check(task_callback=None, task_abort_event=None)

Run all self check tests.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

Return type:

None

send_data_samples(argin, force=False)

Front end for send_xxx_data methods.

Parameters:
  • argin (str) – Json encoded parameter List

  • force (bool) – whether to cancel ongoing requests first.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

set_beamformer_table(beamformer_table)

Set the frequency regions to be beamformed into each beam.

Parameters:

beamformer_table (list[list[int]]) – a list encoding up to 48 regions, with each region corresponding to 8 channels. Entry items specify:

  • start physical channel

  • beam_index: subarray beam used for this region, range [0:48)

  • subarray_id: ID of the subarray [1:48]

  • subarray_logical_channel: Logical channel in the subarray

    it is the same for all (sub)stations in the subarray Defaults to station logical channel

  • subarray_beam_id: ID of the subarray beam

    Defaults to beam index

  • substation_ID: ID of the substation

    Defaults to 0 (no substation)

  • aperture_id: ID of the aperture (station*100+substation?)

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

set_channeliser_rounding(channeliser_rounding, task_callback=None, task_abort_event=None)

Set the channeliserRounding in all Tiles.

Parameters:
  • channeliser_rounding (np.ndarray | list[int]) – the number of LS bits dropped in each channeliser frequency channel.

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

  • task_abort_event (Optional[threading.Event]) – Check for abort, defaults to None

Return type:

None

set_csp_ingest(dst_ip, src_port, dst_port)

Configure last tile 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:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

tuple containing Resultcode and message.

set_lmc_download(mode, payload_length, dst_ip, data_type=None, 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

  • data_type (Optional[str]) – Data type to configure or None for all.

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

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

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

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

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

  • lock_mode (bool) – whether this call should lock integrated-mode auto refresh.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

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(start_time=None, delay=2, task_callback=None, task_abort_event=None)

Start acquisition using slow command.

Parameters:
  • start_time (Optional[str]) – the time at which to start data acquisition, defaults to None

  • delay (Optional[int]) – delay start, defaults to 2

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

Return type:

None

start_adcs()

Start ADCs on all tiles.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

start_beamformer(start_time=None, duration=-1, channel_groups=None, scan_id=0, task_callback=None, task_abort_event=None)

Start the beamformer at the specified time.

NOTE: Supplying start_time is recommended. Transient station beamformer error spikes at startup are caused by non-synchronised TPM beamformer start (SKB-1397). Simultaneous starts avoid the issue. A start time 4 seconds in the future is typically sufficient for the request to arrive on the TPMs.

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

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

  • channel_groups (Optional[list[int]]) – Channel groups to which the command applies.

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

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

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 nanoseconds (positive = increase the signal delay) to correct for static delay mismathces, e.g. cable length.

Tiles that have not yet reported a value, or whose last reported value was flagged invalid, contribute NaN for their 32 entries so that every other tile’s entries stay at their correct antenna offset.

Returns:

Array of one value per antenna/polarization (32 per tile), NaN where a tile’s static delays are unknown or invalid.

stop_adcs()

Stop ADCs on all tiles.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

stop_beamformer(channel_groups, task_callback=None, task_abort_event=None)

Stop the beamformer.

Parameters:
  • channel_groups (Optional[list[int]]) – Channel groups to which the command applies.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

Return type:

None

stop_beamformer_for_channels(task_callback=None, task_abort_event=None, *, channel_groups=None)

Run the stop_beamformer method.

Parameters:
  • channel_groups (Optional[list[int]]) – Channel groups to which the command applies.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

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:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

stop_integrated_data()

Stop the integrated data.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

submit_calibration_task(func, args=None, kwargs=None, is_cmd_allowed=None, task_callback=None)

Submit a task to the calibration lane of the task executor.

Tasks submitted here run independently of the tasks submitted with submit_task(), so a calibration acquisition does not stop other commands from executing. Abort still aborts them, as it aborts every lane.

Parameters:
  • func (Callable) – function/bound method to be run

  • args (Optional[Any]) – positional arguments to the function

  • kwargs (Optional[Any]) – keyword arguments to the function

  • is_cmd_allowed (Optional[Callable[[], bool]]) – sanity check for func

  • task_callback (Optional[Callable]) – callback to be called whenever the status of the task changes.

Return type:

tuple[TaskStatus, str]

Returns:

tuple of TaskStatus & message

sysref_present_summary()

Get summary of SYSREF presence.

Return type:

bool

Returns:

TRUE if SYSREF is present in all tiles. Always False for now, as sysrefPresent is not yet implemented in ska-low-sps-tpm-api and so is not subscribed to.

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(target_adc=17.0, bias=0.0, task_callback=None, task_abort_event=None)

Equalise adc using slow command.

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

  • task_abort_event (Optional[Event]) – Check for abort, defaults to None

  • target_adc (float) – adc value in ADU units. Defaults to 17.

  • bias (float) – user specifed bias in dB added to the antenna preadu levels. Defaults to 0.

Return type:

None

property wren_health_check_fail_on_timeout: bool

Get whether WREN health checking is enabled during initialisation.

Returns:

True if WREN health checking is enabled, False otherwise.

property wren_health_check_timeout: float

Get the timeout for WREN health checking during initialisation.

Returns:

The timeout in seconds for WREN health checking.

class SpsStationHealthModel(subrack_fqdns, tile_fqdns, wren_fqdn, health_changed_callback, thresholds=None)

A health model for a Sps station.

__init__(subrack_fqdns, tile_fqdns, wren_fqdn, health_changed_callback, thresholds=None)

Initialise a new instance.

Parameters:
  • subrack_fqdns (Sequence[str]) – the FQDNs of this station’s subracks

  • tile_fqdns (Sequence[str]) – the FQDNs of this station’s tiles

  • wren_fqdn (str) – the FQDN of this station’s WREN

  • health_changed_callback (HealthChangedCallbackProtocol) – callback to be called whenever there is a change to this this health model’s evaluated health state.

  • thresholds (Optional[dict[str, float]]) – the threshold parameters for the health rules

evaluate_health()

Compute overall health of the station.

The overall health is based on the fault and communication status of the station overall, together with the health of the tiles that it manages.

This implementation simply sets the health of the station to the health of its least healthy component.

Return type:

tuple[HealthState, str]

Returns:

an overall health of the station

subrack_health_changed(subrack_fqdn, subrack_health)

Handle a change in subrack health.

Parameters:
  • subrack_fqdn (str) – the FQDN of the tile whose health has changed

  • subrack_health (Optional[HealthState]) – the health state of the specified tile, or None if the subrack’s admin mode indicates that its health should not be rolled up.

Return type:

None

tile_health_changed(tile_fqdn, tile_health)

Handle a change in tile health.

Parameters:
  • tile_fqdn (str) – the FQDN of the tile whose health has changed

  • tile_health (Optional[HealthState]) – the health state of the specified tile, or None if the tile’s admin mode indicates that its health should not be rolled up.

Return type:

None

wren_health_changed(wren_fqdn, wren_health)

Handle a change in WREN health.

Parameters:
  • wren_fqdn (str) – the FQDN of the WREN whose health has changed

  • wren_health (Optional[HealthState]) – the health state of the specified WREN, or None if the WREN’s admin mode indicates that its health should not be rolled up.

Return type:

None

class SpsStationHealthRules(*args, **kwargs)

A class to handle transition rules for station.

property default_thresholds: dict[str, float]

Get the default thresholds for this device.

Returns:

the default thresholds

degraded_rule(subrack_healths, tile_healths, wren_health, station_state)

Test whether DEGRADED is valid for the station.

Parameters:
  • subrack_healths (dict[str, HealthState | None]) – dictionary of subrack healths

  • tile_healths (dict[str, HealthState | None]) – dictionary of tile healths

  • wren_health (dict[str, HealthState | None]) – dictionary containing WREN health

  • station_state (dict[str, Any | None]) – dictionary of station state attributes.

Return type:

tuple[bool, str]

Returns:

True if DEGRADED is a valid state, along with a text report.

failed_rule(subrack_healths, tile_healths, wren_health, station_state)

Test whether FAILED is valid for the station.

Parameters:
  • subrack_healths (dict[str, HealthState | None]) – dictionary of subrack healths

  • tile_healths (dict[str, HealthState | None]) – dictionary of tile healths

  • wren_health (dict[str, HealthState | None]) – dictionary containing WREN health

  • station_state (dict[str, Any | None]) – dictionary of station state attributes.

Return type:

tuple[bool, str]

Returns:

True if FAILED is a valid state, along with a text report.

healthy_rule(subrack_healths, tile_healths, wren_health, station_state)

Test whether OK is valid for the station.

Parameters:
  • subrack_healths (dict[str, HealthState | None]) – dictionary of subrack healths

  • tile_healths (dict[str, HealthState | None]) – dictionary of tile healths

  • wren_health (dict[str, HealthState | None]) – dictionary containing WREN health

  • station_state (dict[str, Any | None]) – dictionary of station state attributes.

Return type:

tuple[bool, str]

Returns:

True if OK is a valid state, along with a text report.

unknown_rule(subrack_healths, tile_healths, wren_health, station_state)

Test whether UNKNOWN is valid for the station.

Parameters:
  • subrack_healths (dict[str, HealthState | None]) – dictionary of subrack healths

  • tile_healths (dict[str, HealthState | None]) – dictionary of tile healths

  • wren_health (dict[str, HealthState | None]) – dictionary containing WREN health

  • station_state (dict[str, Any | None]) – dictionary of station state attributes.

Return type:

tuple[bool, str]

Returns:

True if UNKNOWN is a valid state, along with a text report.

class SpsStationObsStateModel(logger, obs_state_changed_callback)

An observation state model for a station.

__init__(logger, obs_state_changed_callback)

Initialise a new instance.

Parameters:
  • logger (Logger) – a logger for this model to use

  • obs_state_changed_callback (Callable[[ObsState], None]) – callback to be called when there is a change to this model’s evaluated observation state.

is_configured_changed(is_configured)

Handle a change in whether the station is configured.

Parameters:

is_configured (bool) – whether the station is configured

Return type:

None

update_obs_state()

Update the observation state, ensuring that the callback is called.

Return type:

None

class SpsStationSelfCheckManager(logger, tile_trls, subrack_trls, daq_trl, wren_trl, component_manager)

A class for initiating station self-check procedures.

__init__(logger, tile_trls, subrack_trls, daq_trl, wren_trl, component_manager)

Initialise a new instance.

Parameters:
  • logger (Logger) – a logger for this model to use.

  • tile_trls (list[str]) – trls of tiles the station has.

  • subrack_trls (list[str]) – trls of subracks the station has.

  • daq_trl (str) – trl of the daq the station has.

  • wren_trl (str) – trl of the WREN the station has.

  • component_manager (SpsStationComponentManager) – SpsStation component manager under test.

cleanup()

Stop the threads that the self-check tests started.

Return type:

None

property keep_test_data: bool

Return whether or not to keep any test data.

Returns:

whether or not to keep any test data.

property last_test_results: list[int]

Return the last result of each self-check test in testList order.

Returns:

list of TestResult integer values, one per test.

run_test(test_name, count)

Run a specific test, with an optional count parameter to run multiple times.

Parameters:
  • test_name (str) – name of the test to run.

  • count (int) – number of times to run test.

Return type:

list[TestResult]

Returns:

results of the tests.

run_tests()

Run all self check tests.

Return type:

list[TestResult]

Returns:

results of the test set.