Subarray Component Manager

This module implements component management for subarrays.

class SubarrayComponentManager(subarray_id, skuid_url, logger, max_workers, communication_state_callback, component_state_callback)

A component manager for a subarray.

__init__(subarray_id, skuid_url, logger, max_workers, communication_state_callback, component_state_callback)

Initialise a new instance.

Parameters:
  • subarray_id (int) – the subarray ID for this device

  • skuid_url (str) – The address at which a SKUID service is running.

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

  • communication_state_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_callback (Callable[..., None]) – callback to be called when the component state changes.

  • max_workers (int) – Maximum number of workers in the worker pool. Defaults to None.

abort(task_callback=None)

Abort the observation.

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

abort_device(task_callback=None)

Abort only this device, for use in RestartSubarray().

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

assign(task_callback=None, **kwargs)

Submit the AssignResources slow command.

This method returns immediately after it is submitted for execution.

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

  • kwargs (Any) – keyword arguments to the command. Required keys are “subarray_id” (the ID of the subarray), and subarray_beams (resource specification for each beam).

Return type:

tuple[TaskStatus, str]

Returns:

a result code and response message.

property assigned_resources: list[str]

Return this subarray’s resources.

Returns:

this subarray’s resources.

property assigned_resources_dict: dict[str, Sequence[Any]]

Return a dictionary of resource types and TRLs.

Returns:

this subarray’s resources.

configure(task_callback=None, **kwargs)

Submit the configure slow command.

This method returns immediately after it is submitted for execution.

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

  • kwargs (Any) – keyword arguments to the command. The only required key is “subarray_beams”, which contains the beam configuration.

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

deconfigure(task_callback=None)

Submit the deconfigure (End) slow command.

Parameters:

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

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

end_scan(task_callback=None)

Submit the end_scan slow command.

Parameters:

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

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

obsreset(task_callback=None)

Submit the ObsReset slow command.

Parameters:

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

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

property power_state: ska_control_model.PowerState | None

Return my power state.

Returns:

my power state

release(task_callback=None, **kwargs)

Submit the release slow command.

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

  • kwargs (Any) – keyword arguments to the command. The only required key is “resources”, which contains a list of resource names to release

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

release_all(task_callback=None)

Submit the ReleaseAllResources slow command.

Release all resources from this subarray. :type task_callback: Optional[Callable] :param task_callback: Update task state, defaults to None :rtype: tuple[TaskStatus, str] :return: a task status and response message

restart(task_callback=None)

Submit the Restart slow command.

Parameters:

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

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

scan(task_callback=None, *, interface=None, scan_id, start_time=None, duration=0.0)

Submit the Scan command.

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

  • interface (Optional[str]) – the schema version this is running against.

  • scan_id (int) – The ID for this scan

  • start_time (Optional[str]) – UTC time for begin of scan, None for immediate start

  • duration (Optional[float]) – Scan duration in seconds. 0.0 or omitted means foreve

Return type:

tuple[TaskStatus, str]

Returns:

A task status and response message.

property scan_id: int | None

Return the scan id, or None if a scan is not current.

Returns:

the scan id, or None if a scan is not current.

send_transient_buffer(argin, task_callback=None)

Submit the send_transient_buffer slow task.

This method returns immediately after it is submitted for execution.

Parameters:
  • argin (list[int]) – list of requested segments.

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

Return type:

tuple[TaskStatus, str]

Returns:

Task status and response message.

start_communicating()

Establish communication with the station components.

Return type:

None

property station_beam_trls: set[str]

Return the set of TRLs of station beams assigned to this subarray.

Returns:

the set of TRLs of station beams assigned to this subarray.

property station_trls: set[str]

Return the set of TRLs of stations assigned to this subarray.

Returns:

the set of TRLs of stations assigned to this subarray.

stop_communicating()

Break off communication with the station components.

Return type:

None

property subarray_beam_trls: set[str]

Return the set of TRLs of subarray beams assigned to this subarray.

Returns:

the set of TRLs of subarray beams assigned to this subarray.