Station Device

@startuml
class MccsStation
MccsStation : +__init__()
MccsStation : +do()
MccsStation : -_initialise_connections()
MccsStation : -_initialise_device_pool()
MccsStation : -_initialise_health_monitoring()
MccsStation : +interrupt()
MccsStation : +always_executed_hook()
MccsStation : +delete_device()
MccsStation : +health_changed()
MccsStation : +subarrayId()
MccsStation : +transientBufferTrl()
MccsStation : +isCalibrated()
MccsStation : +isConfigured()
MccsStation : +calibrationJobId()
MccsStation : +daqJobId()
MccsStation : +dataDirectory()
MccsStation : +beamTrls()
MccsStation : +delayCentre()
MccsStation : +calibrationCoefficients()
MccsStation : +init_command_objects()
MccsStation : +Configure()
MccsStation : +InitialSetup()
MccsStation : -_thread
MccsStation : -_lock
MccsStation : -_interrupt
MccsStation : -_health_state
MccsStation : -_subarray_id
MccsStation : -_delay_centre

SKAObsDevice <|-- MccsStation
@enduml

This module implements the MCCS station device.

class MccsStation(*args, **kwargs)

An implementation of a station beam Tango device for MCCS.

ApplyConfiguration(transaction_id)

Apply the aggregated channel table to this Station’s SpsStation.

Parameters:

transaction_id (str) – transaction id for the configuration

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/station/ci-1")
>>> dp.command_inout("ApplyConfiguration")
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("low-mccs/station/ci-1")
>>> time_string = switch time as ISO formatted time
>>> dp.command_inout("ApplyPointingDelays", time_string)
ConfigureChannels(argin)

Set the beamformer table entries for a station beam.

Entries are defined as a flattened 2D array, for a maximum of 48 entries Each entry is 7 channels long and corresponds to 8 consecutive frequency channels.

Parameters:

argin (list[int]) – list of channel block description. Elements are: * channel block index: value in range 0:47 for the channel block to set * start_channel - (int) region starting channel, even in range 0 to 510 * beam_index - (int) beam used for this region with range 0 to 47 * subarray_id - (int) Subarray: 0 is reserved for unallocated entry * 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.

Example:

>>> dp = tango.DeviceProxy("low-mccs/station/ci-1")
>>> dp.command_inout("ConfigureChannels", block_table)
ConfigureSemiStatic(argin)

Configure semi static information like position of antennas.

Parameters:

argin (str) – Semi static information

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/station/ci-1")
>>> config = json.dumps({
    "station": {
        "StationId": 1,
        "ref_latitude": 1.0,
        "ref_longitude": 1.0,
        "ref_height": 1.0,
    }
})
>>> dp.command_inout("ConfigureSemiStatic", config)
DeallocateSubarray(subarray_id)

Deallocates entries relative to a subarray in aggregate tables.

Parameters:

subarray_id (int) – the ID of the subarray to deallocate

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.

EndScan(subarray_id)

Stop the current scan associated with the station_beam.

Parameters:

subarray_id (int) – the subarray for which the command applies

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.

GetPointingDelays(argin)

Get Pointing Coefficients.

Parameters:

argin (str) – stringified dict of args

Return type:

Tuple[ndarray, ndarray]

Returns:

The pointing delays

class InitCommand(*args, **kwargs)

A class for MccsStation’s Init command.

The do() method below is called upon MccsStation’s initialisation.

do(*args, **kwargs)

Initialise the MccsStation.

Parameters:
  • args (Any) – positional args to the component manager method

  • kwargs (Any) – keyword args to the component manager method

Return type:

tuple[ResultCode, str]

Returns:

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

Initialise()

Initialise this station’s 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.

LoadPointingDelays(argin)

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

Parameters:

argin (ndarray) – an array containing a beam index followed by antenna delays

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/station/ci-1")
>>> dp.command_inout("LoadPointingDelays", delay_list)
Scan(argin)

Start the scan associated with the station_beam.

Parameters:

argin (str) – Configuration parameters encoded in a json string

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.

StartAcquisition(argin)

Start data acquisition.

Parameters:

argin (str) – json dictionary with optional keywords:

  • start_time - (ISO UTC time) start time

  • delay - (int) delay start if StartTime is not specified, default 2s

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.

class StartAcquisitionCommand(command_tracker, component_manager, callback=None, logger=None)

Class for handling the StartAcquisition() command.

This command takes as input a JSON string that conforms to the following schema:

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://skao.int/Mccs_StartAcquisition.json",
    "title": "StartAcquisition schema",
    "description": "Schema for StartAcquisition command",
    "type": "object",
    "properties": {
        "start_time": {
            "description": "",
            "type": "string",
            "format": "time"
        },
        "delay": {
            "description": "An acquisition start delay",
            "type": "integer"
        }
    }
}
__init__(command_tracker, component_manager, callback=None, logger=None)

Initialise a new instance.

Parameters:
  • command_tracker (CommandTracker) – the device’s command tracker

  • component_manager (StationComponentManager) – the device’s component manager

  • callback (Optional[Callable]) – an optional callback to be called when this command starts and finishes.

  • logger (Optional[Logger]) – a logger for this command to log with.

StopTracking(track_id)

Stop tracking an object.

Parameters:

track_id (int) – The ID of the thread you wish to stop tracking.

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.

StopTrackingAll()

Stop all tracking.

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.

TrackObject(argin)

Track an object through the sky.

Parameters:

argin (str) – Configuration parameters encoded in a json string

Return type:

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

Returns:

The id of the tracking thread.

__init__(*args, **kwargs)

Initialise this device object.

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

  • kwargs (Any) – keyword args to the init

beamTrls()

Return the TRLs of station beams associated with this station.

Return type:

list[str]

Returns:

the TRLs of station beams associated with this station

beamformerTable()

Return the ids of the channels configured for this beam.

Return type:

list[list[int]]

Returns:

channel table

calibrationCoefficients()

Return the calibration coefficients for the station.

Todo:

How big should this array be? 4 complex values (Jones matrix) per channel. This station can have up to 16 tiles of up to 16 antennas, so that is 8 x 16 x 16 = 2048 coefficients per channel. But how many channels? 384 channels, 786432 elements per station (402M for SKA Low)

Return type:

list[float]

Returns:

the calibration coefficients

calibrationJobId()

Return the calibration job id.

Return type:

int

Returns:

the calibration job id

create_component_manager()

Create and return a component manager for this device.

Return type:

StationComponentManager

Returns:

a component manager for this device.

daqJobId()

Return the DAQ job id.

Return type:

int

Returns:

the DAQ job id

dataDirectory()

Return the data directory.

(the parent directory for all files generated by this station)

Return type:

str

Returns:

the data directory

delayCentre(value)

Set the delay centre of the station.

Parameters:

value (list[float]) – WGS84 position

Return type:

None

healthModelParams(argin)

Set the params for health transition rules.

Parameters:

argin (str) – JSON-string of dictionary of health states

Return type:

None

health_changed(health)

Handle change in this device’s health state.

This is a callback hook, called whenever the HealthModel’s evaluated health state changes. It is responsible for updating the tango side of things i.e. making sure the attribute is up to date, and events are pushed.

Parameters:

health (HealthState) – the new health value

Return type:

None

init_command_objects()

Set up the handler objects for Commands.

Return type:

None

init_device()

Initialise the device.

This is overridden here to change the Tango serialisation model.

Return type:

None

isCalibrated()

Return a flag indicating whether this station is currently calibrated or not.

Return type:

bool

Returns:

a flag indicating whether this station is currently calibrated or not.

isConfigured()

Return a flag indicating whether this station is currently configured or not.

Return type:

bool

Returns:

a flag indicating whether this station is currently configured or not.

isInitialised()

Return true if all tiles in the SpsStation are initialised.

Return type:

bool

Returns:

true if all tiles in the SpsStation are initialised.

isSynchronised()

Return true if all tiles in the SpsStation are synchronised.

Return type:

bool

Returns:

true if all tiles in the SpsStation are synchronised.

is_On_allowed()

Check if command Off is allowed in the current device state.

Return type:

bool

Returns:

True if the command is allowed

numberOfChannels()

Return the total number of channels in the beamformer.

Return type:

int

Returns:

the total number of channels

outsideTemperature()

Return the OutsideTemperature.

Return type:

Optional[float]

Returns:

the OutsideTemperature.

refHeight()

Return the refHeight attribute.

Return type:

float

Returns:

the ellipsoidal height of the station reference position

refLatitude()

Return the refLatitude attribute.

Return type:

float

Returns:

the WGS84 Latitude of the station reference position

refLongitude()

Return the refLongitude attribute.

Return type:

float

Returns:

the WGS84 Longitude of the station reference position

transientBufferTrl()

Return the TRL of the TANGO device that managers the transient buffer.

Return type:

str

Returns:

the TRL of the TANGO device that managers the transient buffer

main(*args, **kwargs)

Entry point for module.

Parameters:
  • args (str) – positional arguments

  • kwargs (str) – named arguments

Return type:

int

Returns:

exit code