Subarray Component Manager

class ska_csp_lmc_common.manager.CSPSubarrayComponentManager(*args: Any, **kwargs: Any)

Bases: CSPBaseComponentManager

Component Manager for the Csp Subarray.

__init__(health_model: SubarrayHealthModel, op_state_model: SubarrayOpStateModel, obs_state_model: SubarrayObsStateModel, properties: ComponentManagerConfiguration, update_device_property_cbk: Callable, logger: Logger | None = None, communication_state_changed_callback: Callable[[ska_control_model.CommunicationStatus], None] | None = None, component_state_changed_callback: Callable[[dict[str, Any]], None] | None = None) None

Instantiate the Component Manager for the Csp Subarray.

Parameters:
  • health_model – The Health State Model to evaluate the CSP Subarray health state.

  • op_state_model – The Operational State Model to evaluate the CSP Subarray device operational state.

  • obs_state_model – The Observing State Model to evaluate the CSP Subarray device observing state.

  • properties – A class instance whose properties are the CSP Subarray TANGO Device Properties.

  • update_device_property_cbk – The CSP Subarray method invoked to update the properties. Defaults to None.

  • logger – The device or python logger if default is None.

update_attribute(property_name, property_value)

Update attribute

property sub_id: int

Return the subarray identification number.

Returns:

The identification number of the CSP Subarray handled by the manager.

property valid_scan_configuration: str

Return the programmed configuration.

property assigned_timing_beams_ids: List[int]

Return the list of assigned timing beams IDs.

property assigned_timing_beams_state: List[int]

Return the state of the assigned timing beams

property assigned_timing_beams_health_state: List[int]

Return the state of the assigned timing beams

property assigned_resources: List[str]

Return the FQDN od the resources assigned to the subsystems

property config_id: str

Return the ID of the received configuration.

Returns:

a string with the ID of the received configuration.

_observing_factory(logger: Logger) ObservingComponentFactory

Configure the Factory to create the CSP sub-systems components.

This class is specialized in Mid.CSP and Low.CSP.

Parameters:

logger – the logger for this instance.

Returns:

A factory object to create CSP Subarray sub-systems observing components.

_add_subsystems_components() None

Instantiate a Python class for each CSP sub-system subordinate device.

Each sub-system component works as an adapter and cache for the associated CSP sub-system and provides the methods or calls to operate on the associate sub-system TANGO device.

On failure, the state and health state of the CSP Subarray is forced to FAULT/FAILED.

_task_submitter(task_name: str, task_callback: Callable | None = None, argin: Any | None = None) Tuple[ska_control_model.TaskStatus, str]

Common method to submit a command

Parameters:
  • task_name – the name of the task to be submitted

  • argin – input argument of the task

Returns:

a tuple with TaskStatus and an informative msg

_json_configuration_parser(argin) JsonConfigurationParser

Configure the class that handles the parsing of the input JSON files sent as argument of AssignResources, Configure and Scan.

This class is specialized in Mid.CSP and Low.CSP.

_on(task_name: str, task_callback: Callable | None = None, task_abort_event: Event | None = None) None

Method submitted into thread executor for on command

Parameters:
  • task_name – the name of the task

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

_off(task_name: str, task_callback: Callable | None = None, task_abort_event: Event | None = None) None

Method submitted into thread executor for off command

Parameters:
  • task_name – the name of the task

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

force_health_state(faulty_flag: bool) None

Method to set/unset the subarray healthState to FAILED.

Parameters:

faulty_flag – whether to force the healthstate to FAILED or not.

_pre_cbf_configure()

Callback method invoked at CBF configuration.

If other processing modes are active besides IMAGING, CBF has to collect information about PST and/od PSS beams addresses to send beam-formed data.

Returns:

a dictionary with the PstBeams addresses

configure_pst_beams(macro_input_list: List, resources_to_send: Dict) List

Configure PST beams when PST processing mode is active.

configure_cbf(macro_input_list, resources_to_send)

Configure CBF subarray.

configure_pss(observer, resources_to_send: Dict, task_abort_event: Event)

Configure PSS subarray when PSS processing mode is active.

_configure(task_name: str, argin: dict, task_callback: Callable | None = None, task_abort_event: Event | None = None) None

Method submitted into thread executor for configure command.@

Parameters:
  • task_name – the name of the task

  • argin – configuration input for Subarray

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

_deconfigure(task_name: str, task_callback: Callable | None = None, task_abort_event: Event | None = None) None

Method submitted into thread executor for gotoidle command

Parameters:
  • task_name – the name of the task

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

_shutdown_executors()

Shutdown the executors (CSPexecutor, subarray_executor, clean priority queue).

Returns:

a tuple with ResultCode and an informative message string.

_abort_executor(task_callback)
Create a thread pool to perform the following action:
  • create abort command for the CSP subarrays

  • send abort command to any running stoppable CSP subarray task

  • shutdown the executors (CSPexecutor, subarray_executor, clean priority queue)

  • re-init the executors (CSPexecutor, subarray_executor, priority queue)

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with ResultCode and an informative message string.

_create_abort_cmd(task_callback: Callable | None = None)

Method submitted into thread executor for abort command

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with ResultCode and an informative message string.

_abort(abort_cmd) None

Method submitted into thread executor for abort command

Parameters:
  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

Returns:

a tuple with ResultCode and an informative message string.

_obsreset(task_name: str, task_callback: Callable | None = None, task_abort_event: Event | None = None) None

Method submitted into thread executor for obsreset command

Parameters:
  • task_name – the name of the task

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

_restart(task_name: str, task_callback: Callable | None = None, task_abort_event: Event | None = None) None

Method submitted into thread executor for restart command

Parameters:
  • task_name – the name of the task

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

_assign(task_name: str, argin: dict, task_callback: Callable | None = None, task_abort_event: Event | None = None)

Method submitted into thread executor for assignresources command

Parameters:
  • task_name – the name of the task

  • argin – resources to be assigned to Subarray

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

_assignresources_completed()

Method invoked at task completion. When the task_status of this task is COMPLETED, this method is invoked to:

  • update the Pst beams allocated to the subarray

  • subscribe for Pst Beams attributes

  • release all the Pst Beams erroneously allocated to the subarray

  • update the list of allocated resources on all subsystems: cbf, pst, pss

_release_completed()

Method invoked at task completion. When the task_status of this task is COMPLETED, this method is invoked to:

  • update the Pst beams allocated to the subarray

  • unsubscribe the released Pst Beams attributes

  • update the list of allocated resources on all subsystems: cbf, pst, pss

_release(task_name: str, argin: dict, task_callback: Callable | None = None, task_abort_event: Event | None = None)

Method submitted into thread executor for release command

Parameters:
  • task_name – the name of the task

  • argin – resources to be released by Subarray

  • task_abort_event – flag to signal an abort request pending

Param:

task_callback: method called to update the task result related attributes

_release_all(task_name: str, task_callback: Callable | None = None, task_abort_event: Event | None = None)

Method submitted into thread executor for release_all command

Parameters:
  • task_name – the name of the task

  • task_callback – method called to update the task result

  • task_abort_event – flag to signal an abort request pending

Param:

task_callback: method called to update the task result related attributes

_scan(task_name: str, argin: str, task_callback: Callable | None = None, task_abort_event: Event | None = None)

Method submitted into thread executor for scan command

Parameters:
  • task_name – the name of the task

  • argin – resources to be assigned to Subarray

  • task_callback – method called to update the task result related attributes

  • task_abort_event – flag to signal an abort request pending

_end_scan(task_name: str, task_callback: Callable | None = None, task_abort_event: Event | None = None)

Method submitted into thread executor for end_scan command

Parameters:
  • task_name – the name of the task

  • task_abort_event – flag to signal an abort request pending

Param:

task_callback: method called to update the task result related attributes

init()

Initialize the Subarray ComponentManager. Instantiate:

  • the command factory

  • the json parser for the configuration files

  • the event manager

  • an ObservingComponent object for each CSP sub-system defined in the CSP Subarray Device Properties.

start_communicating()

Method to start the monitoring of the CSP subordinate devices. It establishes the connection with the CSP subordinate sub-systems observing devices. On success, the main sub-systems attributes are subscribed for events.

It is invoked when the adminMode of the device is OFFLINE or MAINTENANCE.

stop_communicating() None

Method invoked when the CSP Subarray TANGO Device is set OFFLINE.

In this case the CspSubarrayComponentManager stop monitoring the subordinate devices.

The admin mode is forwarded to all the online subordinate components. If the request fails, only the component offline are disconnected.

connect_to_capabilities()

Abstract method. To be specialized in Mid and Low to establish connection with the CSP.LMC Capability devices.

on(task_callback: Callable[[], None] | None = None) Tuple[ska_control_model.TaskStatus, str]

Enable the CSP Subarray to perform observing tasks. The command is forwarded to all the CSP Sub-systems observing devices (subarrays or _create_abort_cmd beams) that are currently online.

Parameters:

task_callback – method called to update the task result related attributes

:return a tuple with TaskStatus and an informative message.

off(task_callback: Callable[[], None] | None = None) Tuple[ska_control_model.TaskStatus, str]

Disable the CSP Subarray to perform observing tasks. The command is forwarded to all the CSP Sub-systems observing devices (subarrays or beams) that are currently online.

The command can be invoked from any observing state with the result that any ongoing process, is aborted and all the assigned resources released.

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

configure(task_callback: Callable[[], None] | None = None, **argin: dict) Tuple[ska_control_model.TaskStatus, str]

Configure the CSP Subarray to perform observing tasks. The command is forwarded to all the CSP Sub-systems observing devices (subarrays or beams) that are currently online.

Parameters:
  • argin – The CSP Subarray configuration data

  • task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

deconfigure(task_callback: Callable[[], None] | None = None) Tuple[ska_control_model.TaskStatus, str]

Force the CSP Subarray to IDLE to allow changes in the resources assigned to the subarray. The command is forwarded to al the online CSP sub-systems.

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

abort(task_callback: Callable) Tuple[ska_control_model.TaskStatus, str]

Abort any running stoppable CSP subarray task. The command is forwarded to all the CSP Sub-systems observing devices (subarrays or beams) that are currently online.

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

obsreset(task_callback: Callable[[], None] | None = None) Tuple[ska_control_model.TaskStatus, str]

Reset a FAULT or ABORTED condition of the CSP Subarray. The command is forwarded to all the CSP Sub-systems observing devices (subarrays or beams) that are currently online and in FAULT or ABORTED observing state.

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

restart(task_callback: Callable[[], None] | None = None) Tuple[ska_control_model.TaskStatus, str]

Restart a CSP Subarray in FAULT or ABORTED observing state.

The command is forwarded to all the CSP Sub-systems observing devices (subarrays or beams) that are currently online.

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

assign(task_callback: Callable[[], None] | None = None, **argin: dict) Tuple[ska_control_model.TaskStatus, str]

Load the configuration from file specifying the resources for subsystems. Forward the command to all the subsystems.

Parameters:
  • argin – the information with the resources to allocate to the CSP Subarray

  • task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

update_assigned_resources(resource_type: str, resource_value: List[str]) None

Update the list of the FQDN resources assigned to the subarray.

Parameters:
  • resource_type – the type of the resources handled by the capabilities

  • resource_value – the list of assigned resources’ FQDNs.

release(task_callback: Callable[[], None] | None, **argin: dict) Tuple[ska_control_model.TaskStatus, str]

Forward the command to release assigned resounces to all the subsystems.

Parameters:
  • argin – the information with the resources to remove from the CSP Subarray

  • task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

release_all(task_callback: Callable[[], None] | None = None) Tuple[ska_control_model.TaskStatus, str]

Forward the command to release all assigned resources to all the subsystems.

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

off_completed()

Method invoked on task completion. If the CSP Subarray has some timing beams assigned, these are disconnected, the attributes unsubscribed and the list updated.

scan(task_callback: Callable[[], None] | None = None, **argin: dict) Tuple[ska_control_model.TaskStatus, str]

Start a Scan. The command is forwarded to all the CSP Sub-systems observing devices (subarrays or beams) that are currently online.

Parameters:
  • argin – the scan information.

  • task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.

end_scan(task_callback: Callable[[], None] | None = None) Tuple[ska_control_model.TaskStatus, str]

Stop gracefully the execution of a scan.

The command is forwarded to all the CSP Sub-systems observing devices (subarrays or beams) that in scanning.

Parameters:

task_callback – method called to update the task result related attributes

Returns:

a tuple with TaskStatus and an informative message.