Subarray Interface

Interfaces for subarray devices.

class ska_tango_base.subarray.subarray_interface.SubarrayInterface[source]

Bases: LRCMixin, AbstractSubarrayInterface

Provides the Tango interface for an SKA subarray.

static __new__(cls, *args: Any, **kwargs: Any) Any
class ska_tango_base.subarray.subarray_interface.AbstractSubarrayInterface[source]

Bases: AbstractLRCMixin, ObsInterface

Provides the Tango interface for an SKA subarray.

The long running command implementation is abstract and a task_executor must be provided.

obs_state_model: ObsStateModel

The Observing State Machine for the subarray.

component_scanning() None[source]

Perform scanning action on the ObsStateModel.

component_not_scanning() None[source]

Perform not scanning action on the ObsStateModel.

component_resourced() None[source]

Perform resourced action on the ObsStateModel.

component_unresourced() None[source]

Perform unresourced action on the ObsStateModel.

component_configured() None[source]

Perform configured action on the ObsStateModel.

component_unconfigured() None[source]

Perform unconfigured action on the ObsStateModel.

component_obsfault() None[source]

Perform fault action on the ObsStateModel.

_activation_time

Signal for the activation time of the device.

Write to this signal to report the time of activation to Tango clients.

activationTime

Activation time attribute of the device.

This should be set by subclasses of this interface by writing to _activation_time.

assignedResources

The resources assigned to the device.

read_assignedResources() list[str][source]

Read the resources assigned to the device.

Subclasses of this interface must provide this method.

configuredCapabilities

The configured capabilities of the device.

For example, [“Correlators:512”, “PssBeams:4”, “PstBeams:4”, “VlbiBeams:0”].

read_configuredCapabilities() list[str][source]

Read the capabilities configured in the device.

Subclasses of this interface must provide this method.

read_activationTime() float | tuple[float, float, AttrQuality][source]

Read the activation time of the device.

Subclasses can override this to change the behaviour of the activationTime attribute.

is_activationTime_allowed(attr: AttReqType) bool[source]

Check if the activationTime can be read currently.

This can be overridden by subclasses to restrict when clients can access the attribute.

CapabilityTypes

Types of capability supported by this subarray.

SubID

Unique identifier for this subarray.

is_AssignResources_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether AssignResources() may be executed or enqueued.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_AssignResources(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard AssignResources command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • When this command is started, the commandedObsState should be EMPTY or IDLE.

  • While this command is running, the device should have obsState RESOURCING.

  • Once this command has completed successfully, the device should have obsState IDLE.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the resources to be assigned

Returns:

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

started_AssignResources() None[source]

AssignResources command started callback.

completed_AssignResources() None[source]

AssignResources command completed callback.

AssignResources(argin: str) tuple[list[ResultCode], list[str]][source]

Assign resources to this subarray.

Subclasses should override the execute_AssignResources method to change the behaviour of this command.

Parameters:

argin – the resources to be assigned

Returns:

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

is_ReleaseResources_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether ReleaseResources() may be executed or enqueued.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_ReleaseResources(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard ReleaseResources command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • When this command is started, the commandedObsState should be IDLE.

  • While this command is running, the device should have obsState RESOURCING.

  • Once this command has completed successfully, the device should have obsState IDLE.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the resources to be released

Returns:

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

started_ReleaseResources() None[source]

ReleaseResources command started callback.

completed_ReleaseResources() None[source]

ReleaseResources command completed callback.

ReleaseResources(argin: str) tuple[list[ResultCode], list[str]][source]

Delta removal of assigned resources.

Subclasses should override the execute_ReleaseResources method to change the behaviour of this command.

Parameters:

argin – the resources to be released

Returns:

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

is_ReleaseAllResources_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the ReleaseAllResources() command may be called.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_ReleaseAllResources() tuple[list[ResultCode], list[str]][source]

Execute the standard ReleaseAllResources command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • When this command is started, the commandedObsState should be EMPTY.

  • While this command is running, the device should have obsState RESOURCING.

  • Once this command has completed successfully, the device should have obsState EMPTY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Returns:

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

started_ReleaseAllResources() None[source]

ReleaseAllResources command started callback.

completed_ReleaseAllResources() None[source]

ReleaseAllResources command completed callback.

ReleaseAllResources() tuple[list[ResultCode], list[str]][source]

Remove all resources to tear down to an empty subarray.

Subclasses should override the execute_ReleaseAllResources method to change the behaviour of this command.

Returns:

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

is_Configure_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the Configure() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_Configure(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard Configure command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • When this command is started, the commandedObsState should be IDLE or READY.

  • While this command is running, the device should have obsState CONFIGURING.

  • Once this command has completed successfully, the device should have obsState READY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the scan configuration specification

Returns:

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

started_Configure() None[source]

Configure command started callback.

completed_Configure() None[source]

Configure command completed callback.

Configure(argin: str) tuple[list[ResultCode], list[str]][source]

Configure the capabilities of this subarray.

Subclasses should override the execute_Configure method to change the behaviour of this command.

Parameters:

argin – the scan configuration specification

Returns:

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

is_Scan_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the Scan() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_Scan(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard Scan command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • Once this command has completed successfully, the device should have obsState SCANNING.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the per-scan configuration

Returns:

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

Scan(argin: str) tuple[list[ResultCode], list[str]][source]

Start scanning.

Subclasses should override the execute_Scan method to change the behaviour of this command.

Parameters:

argin – the per-scan configuration

Returns:

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

is_EndScan_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the EndScan() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_EndScan() tuple[list[ResultCode], list[str]][source]

Execute the standard EndScan command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • Once this command has completed successfully, the device should have obsState READY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Returns:

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

EndScan() tuple[list[ResultCode], list[str]][source]

End the scan.

Subclasses should override the execute_EndScan method to change the behaviour of this command.

Raises:

NotImplementedError

is_End_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the End() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_End() tuple[list[ResultCode], list[str]][source]

Execute the standard End command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • When this command is started, the commandedObsState should be IDLE.

  • Once this command has completed successfully, the device should have obsState IDLE.

  • If this command does not complete successfully, the device should have obsState FAULT

Returns:

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

End() tuple[list[ResultCode], list[str]][source]

End the scan block.

Subclasses should override the execute_End method to change the behaviour of this command.

Returns:

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

is_ObsReset_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether ObsReset() may be executed or enqueued.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_ObsReset() tuple[list[ResultCode], list[str]][source]

Execute the standard ObsReset command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • When this command is started, the commandedObsState should be IDLE.

  • While this command is running, the device should have obsState RESETTING.

  • Once this command has completed successfully, the device should have obsState IDLE.

  • If this command does not complete successfully, the device should have obsState FAULT.

Note

ObsReset() is not to be implemented for AA 0.5 or AA 1.

Returns:

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

started_ObsReset() None[source]

ObsReset command started callback.

completed_ObsReset() None[source]

ObsReset command completed callback.

ObsReset() tuple[list[ResultCode], list[str]][source]

Reset the current observation process.

Subclasses should override the execute_ObsReset method to change the behaviour of this command.

Returns:

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

is_Restart_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the Restart() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_Restart() tuple[list[ResultCode], list[str]][source]

Execute the standard Restart command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Reset a long running command.

  • When this command is started, the commandedObsState should be FAULT or ABORTED.

  • While this command is running, the device should have obsState RESTARTING.

  • Once this command has completed successfully, the device should have obsState EMPTY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Returns:

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

started_Restart() None[source]

Restart command started callback.

completed_Restart() None[source]

Restart command completed callback.

Restart() tuple[list[ResultCode], list[str]][source]

Restart the subarray. That is, deconfigure and release all resources.

Subclasses should override the execute_Restart method to change the behaviour of this command.

Returns:

A tuple containing a result code and the unique ID of the command

static __new__(cls, *args: Any, **kwargs: Any) Any
is_Abort_allowed() bool[source]

Return whether the Abort() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

started_Abort() None[source]

Abort command started callback.

completed_Abort() None[source]

Abort command completed callback.