Controller Component Manager

This module implements component management for the MCCS controller.

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

A component manager for an MCCS controller.

This component manager has three jobs:

  • Monitoring of the devices in the MCCS subsystem

  • Powering the MCCS subsystem off and on

  • Allocating resources to subarrays

__init__(subarray_trls: Iterable[str], station_trls: Iterable[str], subarray_beam_trls: Iterable[str], station_beam_trls: Iterable[str], logger: Logger, obs_command_timeout: int, communication_state_callback: Callable[[ska_control_model.CommunicationStatus], None], component_state_callback: Callable[[...], None], event_serialiser: ska_low_mccs_common.EventSerialiser | None = None) None[source]

Initialise a new instance.

Parameters:
  • subarray_trls – TRLS of all subarray devices

  • station_trls – TRLS of all station devices

  • subarray_beam_trls – TRLS of all subarray beam devices

  • station_beam_trls – TRLS of all station beam devices

  • 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

  • event_serialiser – an optional event serialiser to use when serialising events

abort_subarray(subarray_id: int, task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]

Abort an MCCS subarray.

Parameters:
  • subarray_id – an integer subarray_id.

  • task_callback – Update task state, defaults to None

Returns:

A tuple of (TaskStatus, message string).

allocate(task_callback: Callable | None = None, *, interface: str | None = None, subarray_id: int, subarray_beams: list[dict]) None[source]

Allocate and distribute a set of unallocated MCCS resources to a subarray.

The kwargs argument specifies the overall sub-array composition in terms of which stations should be allocated to the specified subarray_beam. It contains: :param interface: the schema version this is running against. :param subarray_id: int, ID of the subarray which requires allocation :param subarray_beams: list of dictionaries, each sepcifying a beam allocation :param task_callback: callback to signal end of command

static calculate_target_adc(epoch_time: float | None = None) float[source]

Calculate the targert RMS for ADC Equalisation.

In order to maintain the optimal range for ADC RMS value the telescope requires re-equalisation as the average power received by the antennas changes during sidereal time. This function calculates a target value for ADC re-equalisation, based on the sidereal time.

More details can be found in Memo 4: https://confluence.skatelescope.org/pages/viewpage.action?spaceKey=LC&title=Memo+004+-+Antenna+ADC+RMS+target+vs+LST

Parameters:

epoch_time – Time in seconds since the epcoh. Exists for testing.

Returns:

target ADC RMS value in ADUs

cleanup() None[source]

Cleanup proxies and task executor.

get_health_trl(trl: str) ska_control_model.HealthState | None[source]

Return the health of a subdevice with given TRL.

Parameters:

trl – TRL of device to return health of

Returns:

health of device given by TRL

Raises:

ValueError – if TRL is for an invalid device

get_healths(device_type: str = 'all') dict[str, dict[str, str | None]][source]

Return subdevice healths.

Parameters:

device_type – the type of device to return the health state of its instances.

Returns:

dictionary of [device_type: [TRL : HealthState]] for each device of that device type, or all devices if called without an argument.

Raises:

ValueError – if device_type is not a valid device type.

get_resources(subarray_id: int) str[source]

Return a dictionary of the resources assigned to a given subarray.

Parameters:

subarray_id – The subarray ID of the resources

Returns:

json formatted dictionary

Raises:

ValueError – if subarray_id is not valid

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

Turn off the MCCS subsystem.

This is simpler than turning ON MCCS, we simply need to command all MccsStations to turn off and wait for it to happen.

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

  • task_abort_event – Check for abort, defaults to None

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

Turn on the MCCS subsystem.

The procedure involves turning on all Stations.

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(task_callback: Callable | None = None, task_abort_event: Event | None = None, *, subarray_id: int, **kwargs: Any) None[source]

Release a subarray’s resources.

Parameters:
  • subarray_id – ID of the subarray which requires release

  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

  • kwargs – additional arguments

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

Release all subarrays resources.

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

  • task_abort_event – Check for abort, defaults to None

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

Restart an MCCS subarray.

Parameters:
  • subarray_id – an integer subarray_id.

  • task_callback – Update task state, defaults to None

  • task_abort_event – Check for abort, defaults to None

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

Put the MCCS subsystem into low power standby mode.

Parameters:
  • 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.

stop_communicating() None[source]

Break off communication with the station components.

trigger_adc_equalisation(task_callback: Callable | None = None, task_abort_event: Event | None = None, *, station_args: list[dict]) None[source]

Trigger adc equalisation.

Parameters:
  • station_args – a list of station ids

  • task_callback – callback to signal end of command

  • task_abort_event – Check for abort, defaults to None