Subarray Component Manager

This module implements component management for subarrays.

class SubarrayComponentManager(*args: Any, **kwargs: Any)[source]

A component manager for a subarray.

__init__(subarray_id: int, skuid_url: str, logger: Logger, obs_command_timeout: int, communication_state_callback: Callable[[ska_control_model.CommunicationStatus], None], component_state_callback: Callable[[...], None], default_solution_type: str = 'fitted', event_serialiser: ska_low_mccs_common.EventSerialiser | None = None) None[source]

Initialise a new instance.

Parameters:
  • subarray_id – the subarray ID for this device

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

  • obs_command_timeout – the default timeout for obs commands in seconds.

  • logger – the logger to be used by this object.

  • communication_state_callback – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_state_callback – callback to be called when the component state changes.

  • default_solution_type – default calibration solution type used when an aperture in Configure does not specify solution_type.

  • event_serialiser – the event serialiser to be used by this object.

abort(task_callback: Callable | None = None, task_abort_event: Event | None = None) tuple[ska_control_model.TaskStatus, str][source]

Abort the observation.

Parameters:
  • task_callback – callback to be called when the status of the command changes

  • task_abort_event – Check for abort, defaults to None

Returns:

A task status and response message.

abort_device(task_callback: Callable | None = None, task_abort_event: Event | None = None) Any[source]

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

Parameters:
  • task_callback – callback to be called when the status of the command changes

  • task_abort_event – Check for abort, defaults to None

Returns:

A task status 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.

cleanup() None[source]

Cleanup resources held by the component manager.

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

configure(subarray_beams: list[dict[str, Any]], task_callback: Callable | None, task_abort_event: Event | None = None, transaction_id: str | None = '') None[source]

Configure the resources for a scan.

Parameters:
  • subarray_beams – the beam configurations to be applied

  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

  • transaction_id – the transaction id for the configuration Will be generated if not provided.

deconfigure(task_callback: Callable | None = None, task_abort_event: Event | None = None) None[source]

Deconfigure resources.

Parameters:
  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

do_assign(subarray_id: int, subarray_beams: dict, task_callback: Callable | None = None, task_abort_event: Event | None = None) None[source]

Assign resources to this subarray.

This is just for communication and health roll-up, resource management is done by controller.

Parameters:
  • subarray_id – ID of the subarray

  • subarray_beams – resource specification for each beam

  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

end_scan(task_callback: Callable | None = None, task_abort_event: Event | None = None) None[source]

Execute the end_scan slow command.

Parameters:
  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

get_coords(subarray_beams: list[dict]) list[dict][source]

Modify the coordinates to have correct pointing.

Parameters:

subarray_beams – subarray beams

Raises:

KeyError – coordinates are invalid

Returns:

The modified beams with correct coords

property max_executing_tasks: int

Get the max number of tasks that can be executing at once.

Returns:

max number of simultaneously executing tasks.

obsreset(task_callback: Callable | None = None, task_abort_event: Event | None = None) None[source]

Reset the observation by returning to unconfigured state.

Parameters:
  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

property power_state: ska_control_model.PowerState | None

Return my power state.

Returns:

my power state

release(beam_resources: dict[str, list[str]], task_callback: Callable | None, task_abort_event: Event | None) None[source]

Release resources from this subarray.

Parameters:
  • beam_resources – list of resource TRLs to release.

  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

Raises:

NotImplementedError – because MCCS Subarray cannot perform a partial release of beam_resources.

release_all(task_callback: Callable | None, task_abort_event: Event | None = None) None[source]

Release all resources from this subarray.

Parameters:
  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

restart(task_callback: Callable | None = None, task_abort_event: Event | None = None) None[source]

Restart the subarray by returning to unresourced state.

Parameters:
  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

scan(scan_id: int = 0, start_time: str | None = None, duration: float = 0.0, task_callback: Callable | None = None, task_abort_event: Event | None = None) None[source]

Start scanning.

Parameters:
  • scan_id – the id of the scan

  • start_time – the start time of the scan

  • duration – Scan duration in seconds. 0.0 or omitted means forever

  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

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: list[int], task_callback: Callable | None = None, task_abort_event: Event | None = None) None[source]

Send the transient buffer.

Parameters:
  • argin – list of list of requested segment.

  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

start_communicating() None[source]

Establish communication with the station components.

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() None[source]

Break off communication with the station components.

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.