ska_tmc_subarraynode.manager package

Link to the TMC User documentation is here.

Subpackages

Submodules

aggregators

Path: src/ska_tmc_subarraynode/manager/aggregators.py

This Module is for Aggregating the HealthState and ObsStates of Devices

class ska_tmc_subarraynode.manager.aggregators.SubarrayAvailabilityAggregatorLow(component_manager, logger)

Bases: Aggregator

Class to aggregate tmc low subarray device availability depending on tmc low leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Optional[Tuple[bool, List]]

Returns

a tuple containing bool representing subarray availability and list containing unavailable devices

class ska_tmc_subarraynode.manager.aggregators.SubarrayAvailabilityAggregatorMid(component_manager, logger)

Bases: Aggregator

class to aggregate tmc mid subarray device availability depending on tmc mid leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Tuple[bool, List]

Returns

a tuple comtaining bool representing subarray availability and list conataining unavailable devices

aggregate_process

Path: src/ska_tmc_subarraynode/manager/aggregate_process.py

This module contain process for aggregation

class ska_tmc_subarraynode.manager.aggregate_process.AggregationProcessLow(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Low

set_state_aggregator()

Return an instance of StateAggregator for Low

Return type

StateAggregator

Returns

An instance of StateAggregator for Low

class ska_tmc_subarraynode.manager.aggregate_process.AggregationProcessMid(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Mid

set_state_aggregator()

Return an instance of StateAggregator for Mid

Return type

StateAggregator

Returns

An instance of StateAggregator for Mid

class ska_tmc_subarraynode.manager.aggregate_process.HealthAggregatorFactory

Bases: object

Factory class to return the appropriate HealthStateAggregator instance.

static get_aggregator(telescope)

Static method to return aggregator class instance

Parameters

telescope (str) – Type of telescope (“mid” or “low”)

Return type

StateAggregator

Returns

An instance of StateAggregator for the given telescope type.

Raises

ValueError – If the telescope type is unknown.

class ska_tmc_subarraynode.manager.aggregate_process.HealthStateAggregationProcessor(event_data_queue, aggregated_health_state, aggregate_update_event, telescope='mid', callback=None)

Bases: AggregationProcess

Health State Aggregation Processor

Inherits from AggregationProcess and implements health-specific state aggregation logic.

set_state_aggregator()

Return an instance of HealthStateAggregator for the given telescope.

Return type

StateAggregator

Returns

An instance of HealthStateAggregator for the given telescope.

event_data_manager

Path: src/ska_tmc_subarraynode/manager/event_data_manager.py

Use event manager to manager all event related data

class ska_tmc_subarraynode.manager.event_data_manager.AdminModeData(admin_mode, event_timestamp)

Bases: object

DataClass for admin mode and its timestamp

admin_mode
event_timestamp
class ska_tmc_subarraynode.manager.event_data_manager.CommandResultData(result, unique_id, event_timestamp)

Bases: object

DataClass for longrunningcommandresult and its timestamp.

event_timestamp
result
unique_id
class ska_tmc_subarraynode.manager.event_data_manager.DishModeData(dish_mode, event_timestamp)

Bases: object

DataClass for DishMode and its timestamp.

dish_mode
event_timestamp
class ska_tmc_subarraynode.manager.event_data_manager.EventDataManager(component_manager, logger=<Logger ska_tmc_subarraynode.manager.event_data_manager (WARNING)>)

Bases: object

A class to update the values of events received for different attributes in EventDataStorage class

clear_dish_data()

clear dish data from event info

Return type

None

clear_liveliness_data()

clears LivelinessData

clear_lrcr()

clears LongRunning Command Results

Return type

None

compare_timevals(current_timestamp, received_timestamp)

A method to compare the timestamps of events received with the existing timestamp.

Parameters
  • current_timestamp (datetime) – Curent time stamp.

  • received_timestamp (datetime) – Received time stamp.

Returns

True, if current timestamp is less than received timestamp. False, otherwise.

Return type

bool

get_enum_name_from_value(enum_class, value)

Get the name from value of enum

Parameters
  • enum_class – Enum class.

  • valuename, member of enum.

Returns

Name of the enum

Return type

str

remove_device_liveliness_data(device_name)
removes a device data after a device has been removed from

liveliness probe

update_aggregation_queue(is_health_event=False)

A method to put a copy of the EventDataStorage object whenever it receives an event.

Parameters

is_health_event (bool) – True, if health event. False otherwise.

Return type

None

update_event_data(device, data, data_type, received_timestamp=None)

A method to receive and update device name, data, and timestamp in the EventDataStorage Class

Parameters
Return type

None

class ska_tmc_subarraynode.manager.event_data_manager.EventDataStorage(obs_state_data=<factory>, liveliness_data=<factory>, command_result_data=<factory>, dish_mode_data=<factory>, pointing_state_data=<factory>, health_state_data=<factory>, admin_mode_data=<factory>, kvalue_validation_data=<factory>, command_timestamp=None, command_in_progress='', is_partial_configuration=False, subarrays_to_config=<factory>, assigned_resources_len=0, is_auto_recovery_enabled=False, configured_dishlns=<factory>)

Bases: object

A class to store the Events received for different attributes.

admin_mode_data
assigned_resources_len = 0
command_in_progress = ''
command_result_data
command_timestamp = None
configured_dishlns
dish_mode_data
health_state_data
is_auto_recovery_enabled = False
is_partial_configuration = False
kvalue_validation_data
liveliness_data
obs_state_data
pointing_state_data
subarrays_to_config
class ska_tmc_subarraynode.manager.event_data_manager.HealthStateData(health_state, is_dish, is_dish_master=False, is_dish_leaf_node=False, event_timestamp=None)

Bases: object

DataClass for health state and its timestamp

event_timestamp = None
health_state
is_dish
is_dish_leaf_node = False
is_dish_master = False
class ska_tmc_subarraynode.manager.event_data_manager.LivelinessData(unresponsive, event_timestamp=None)

Bases: object

DataClass for device livelienss status

event_timestamp = None
unresponsive
class ska_tmc_subarraynode.manager.event_data_manager.ObsStateData(obs_state, event_timestamp)

Bases: object

DataClass for ObsState and its Timestamp.

event_timestamp
obs_state
class ska_tmc_subarraynode.manager.event_data_manager.PointingStateData(pointing_state, event_timestamp)

Bases: object

DataClass for PointingState and its timestamp.

event_timestamp
pointing_state
class ska_tmc_subarraynode.manager.event_data_manager.kValueValidationData(is_failed, event_timestamp)

Bases: object

DataClass for KValue Validation and its timestamp.

event_timestamp
is_failed
ska_tmc_subarraynode.manager.event_data_manager.pre_process(func)

Decorator for preprocessing event data

Return type

Callable

event_manager

Path: src/ska_tmc_subarraynode/manager/event_manager.py

Event manager class for SubarrayNode

class ska_tmc_subarraynode.manager.event_manager.SubarrayNodeEventManager(component_manager, subscription_configuration=None, logger=<Logger ska_tmc_subarraynode.manager.event_manager (WARNING)>, stateless=True, event_subscription_check_period=1, event_error_max_count=10, status_update_callback=None, maximum_status_queue_size=50)

Bases: EventManager

Event manager for handling TANGO events for the SubarrayNode component. Inherits from ska_tmc_common.v2.EventManager and provides specific callbacks for different TANGO attributes and states relevant to SubarrayNode.

adminmode_event_callback(event)

Callback for handling adminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

assignedresources_event_callback(event)

Callback for handling assignedResources TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayadminmode_event_callback(event)

Callback for handling cspSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayobsstate_event_callback(event)

Callback for handling cspSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

dishmode_event_callback(event)

Callback for handling dishMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

healthinfo_event_callback(event)

Callback for handling healthInfo TANGO events.

Return type

None

healthstate_event_callback(event)

Callback for handling healthState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

issubsystemavailable_event_callback(event)

Callback for handling isSubsystemAvailable TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

longrunningcommandresult_event_callback(event)

Callback for handling longRunningCommandResult TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

mccscontrolleradminmode_event_callback(event)

Callback for handling mccsControllerAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

mccssubarrayadminmode_event_callback(event)

Callback for handling mccsSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

obsstate_event_callback(event)

Callback for handling obsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

pointingstate_event_callback(event)

Callback for handling pointingState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

receiveaddresses_event_callback(event)

Callback for handling receiveAddresses TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayadminmode_event_callback(event)

Callback for handling sdpSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayobsstate_event_callback(event)

Callback for handling sdpSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

state_event_callback(event)

Callback for handling state TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

subarray_node_component_manager

Path: src/ska_tmc_subarraynode/manager/subarray_node_component_manager.py

This module provided a reference implementation of a SubarrayComponentManager inherited from BaseComponentManager.

class ska_tmc_subarraynode.manager.subarray_node_component_manager.SubarrayNodeComponentManager(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, scan_start_time_enabled, logger, _update_device_callback, _update_subarray_health_state_callback, _update_subarray_health_info_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, component_state_changed_callback, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, csp_assign_interface='', csp_scan_interface='', sdp_scan_interface='', jones_uri='', subarray_device_name='', tel_model_source='', tel_model_path='')

Bases: TmcComponentManager, SubarrayComponentManager

A component manager for The Subarray Node component.

It supports:

  • Monitoring its component, e.g. detect that it has been turned off or on

  • Fetching the latest SCM indicator values and receiving change events of the components periodically and trigger the subarray health state and observation state aggregation

abstract abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abort_timer()

Method for managing abort timer

Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Raises

NotImplementedError – Not implemented in this class

Return type

None

add_multiple_devices(device_list)

Add multiple devices to the liveliness probe

Parameters

device_list (List) – list of device names

Return type

List

Returns

list after adding the devices

add_similar_low_mid_device(device_name)

Add Similar Low and Mid device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

aggregate_process_monitor()

This method keep tracking aggregate obs state changed from aggregation process

Return type

None

property array_layout_url

Return the currently stored Array Layout URI.

abstract assign(argin, task_callback)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

  • task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

property assigned_resources

Return the resources assigned to the component.

Returns

the resources assigned to the component

build_device_attribute_map()

Builds a dictionary mapping device names to lists of attributes to be subscribed.

Returns

A mapping from device names to list of attributes.

Return type

Dict[str, List[str]]

check_command_not_allowed_exception(op_state, states_not_allowed, cmd_name)

This method checks command not allowed exception

Parameters
  • op_state – Current op_state

  • states_not_allowed (list) – List of states that dont allow command

  • cmd_name (str) – Command name

Raises

CommandNotAllowed – When Command is not allowed in current state

Return type

None

check_event_error(event, callback)

Method for checking event error.

Parameters
  • event (EventData) – Event Data

  • callback (str) – Event callback

Returns

True if there is an event error, else False

Return type

bool

check_for_incremental_assign_and_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for incremental assign resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

check_if_sdp_sln_is_available()

Check if the sdp subarray device availability is True.

Returns

True if sdp subarray leafnode is available

Return type

bool

check_subarray_device_availability()

Checks if the subarray device availability is True if not, raises exception CommandNotAllowed.

Raises

CommandNotAllowed – When Command is not allowed due to unavailability of device

Return type

None

check_successive_configure_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for successive configure resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

property checked_devices

Return the list of the checked monitored devices

Returns

list of the checked monitored devices

cleanup()

shutdown aggregation process

Return type

None

clear_assigned_resources()

Clears assigned resources after the aggregation of obsState EMPTY This method is overridden by the child classes. For Mid it clears dish dev names. For low currently no resources are cleared.

Return type

None

clear_dish_health_info()

Remove any dish-related entries from aggregated HealthInfo.

The SN HealthInfo attribute is backed by self.resultant_health_info. Dish devices typically contribute entries keyed by their device names (lower-cased). When dish monitoring is cleared (e.g. on Restart), those entries should be removed too.

Return type

None

clear_internal_error_from_health_info(device_name)

Clears all internal errors from healthinfo

Return type

None

command_allowed_callable(command_name)

This method provides callable for is_cmd_allowed parameter set while submitting the task. This check will be done after command has been put on the queue.

Parameters

command_name (str) – Tango Device Command Name

Returns

True if the command is callable, else false

Return type

bool

property command_in_progress

Returns the command_in_progress variable

Returns

command in progress

Return type

str

component_state_changed_callback_and_logging(callback_action, command_in_progress, aggregated_obsstate)

Method calls component_state_changed_callback to complete aggregate obsState change and logs completion message.

Parameters
  • callback_action (Union[list, Dict]) – contains details required by component state changed callback and log statement.

  • command_in_progress (Optional[str]) – name of command in progress

  • aggregated_obsstate (ObsState) – obsstate aggregated from subsystem obsstate values.

Return type

None

abstract configure(argin, task_callback)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

property devices

Return the list of the monitored devices

Returns

list of the monitored devices

download_array_layout_json(telmodel_info)

Download array layout JSON from TelModel using AssignResources schema.

This method retrieves the array layout file from TelModel based on the provided source URIs and layout path, then parses the JSON content. It returns both downloaded layout data and an error message, if any.

Parameters
  • telmodel_info (dict) – Dictionary containing ‘source_uris’ and

  • 'array_layout_path'.

Returns

A tuple containing:
  • dict: The parsed layout JSON content.

  • str: An error message if download fails.

Return type

Tuple[dict, str]

Raises

ValueError – If the provided TelModel structure is invalid.

abstract end(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abstract end_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abstract end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

generate_command_result(result_code, message)

Method for generating command result

Parameters
  • result_code (int) – send result_code

  • message (str) – message of invoking command

Return type

tuple

Returns

A tuple containing ResultCode and message

get_adapter_by_device_name(device_name)

The get_adapter_by_device_name method takes a device_name as input and searches for an adapter object in the adapter_factory object’s adapters attribute that matches the input device_name. If a matching adapter object is found, it is returned. If no matching adapter object is found, first adapter is returned.

Parameters

device_name (str) – The name of the device to search for.

Returns

An adapter object if a matching device is found, otherwise first adapter object is returned.

static get_allowed_obs_states()

Function to keep a map of allowed observation states for a given command Returns: Dict of allowed observation states of commands

Return type

dict

get_array_centre_coord_from_tmdata(coordinate_system='geocentric')

Fetch coordinates of array centre from TM Data.

Parameters
  • coordinate_system (str) – Coordinate system to use.

  • "geocentric". (Defaults to) –

Returns

[x, y, z] coordinates of array centre.

Return type

list

Raises

Exception – If error occurs fetching or parsing TM Data.

Notes

  • Retries up to 3 times with 1s delay on failure.

  • Logs debug info on success and errors on failure.

get_assigned_resources()
Returns

assigned_resources

Return type

list

get_csp_subarray_admin_mode()

Retrieve the adminMode of csp subarray

Returns

This method returns the adminMode of CSP Subarray Node.

Return type

AdminMode

get_csp_subarray_dev_name()

Return Csp Subarray device name

Returns

CSP subarray device name

Return type

str

get_device(device_name)

Return the device info with device name device_name

Parameters

device_name (str) – name of the device

Return type

Optional[DeviceInfo]

Returns

a device info

get_mccs_subarray_admin_mode()

Retrieve the adminMode of MCCS subarray.

Returns

The adminMode of the TMC MCCS Subarray Node.

Return type

AdminMode

get_mccs_subarray_dev_name()

Returns Mccs Subarray device name

Returns

MCCS subarray device name

Return type

str

get_sb_id()

Returns sb_id value.

Returns

sb_id

Return type

str

get_scan_duration()

Returns scan_duration value.

Returns

scan duration

Return type

float

get_scan_id()

Returns scan_id value.

Returns

scan_id

Return type

str

get_sdp_subarray_admin_mode()

Retrieve the adminMode of SDP subarray.

Returns

The adminMode of the TMC SDP Subarray Node.

Return type

AdminMode

get_sdp_subarray_dev_name()

Return Sdp Subarray device name

Returns

SDP subarray device name

Return type

str

get_set_obs_state()

Return the set obs state dictionary

get_subarray_availability()

Returns subarray availability status

Return type

bool

Returns

subarray availability status

get_subarray_healthstate()

Returns value of subarray’s health state.

Return type

HealthState

Returns

value of subarray health state

get_subarray_id()

Returns subarray_id value.

Returns

subarray_id

Return type

int

get_subarray_obsstate()

Returns aggregated subarray ObsState

Return type

Optional[ObsState]

Returns

Current aggregated subarray ObsState

get_telmodel_version()

Extract and return the version identifier from the telmodel source URL.

The telmodel_source attribute may be either:

  • a single string URL

  • a list of URL strings

The version is assumed to be the URL query component (the part after ‘?’).

For example:

car://gitlab.com/ska-telescope/ska-telmodel-data?main#tmdata -> “main”

Returns

The extracted version string, or an empty string if not found or on error.

Return type

str

get_tmc_csp_sln_device_name()

Return Csp Subarray Leaf Node device name

Returns

CSP subarray leafnode device name

Return type

str

get_tmc_mccs_mln_device_name()

Return Mccs Master Leaf Node device name

Returns

MCCS master leafnode device name

Return type

str

get_tmc_mccs_sln_device_name()

Return Mccs Subarray Leaf Node device name

Returns

MCCS subarray leafnode device name

Return type

str

get_tmc_sdp_sln_device_name()

Return Sdp Subarray Leaf Node device name

Returns

SDP subarray leafnode device name

Return type

str

healthstate_aggregate_monitor()

This method keeps tracking aggregated health state changes from the aggregation process for the SubarrayNode.

Return type

None

property input_parameter

Return the input parameter

Returns

input parameter

is_command_allowed(command_name)

Checks whether this command is allowed It checks that the device is in a state to perform this command and that all the component needed for the operation are not unresponsive This check will be called before putting command in queue. It will also be called from tango device.

Parameters

command_name (str) – name of the command

Return type

bool

Returns

True if this command is allowed, False otherwise

Raises

CommandNotAllowed – Command is not allowed in adminMode OFFLINE ot NOT-FITTED

property is_operation_aborted

Aborted Flag

Returns

True if operation is aborted

property is_partial_configuration

Returns True if the configuration is partial.

Returns

True if configuration is partial

is_scan_completed()

A function to check whether Scan Command is completed successfully.

Return type

bool

Returns

True if scan is completed, False otherwise

is_scan_timer_running()

Checks if the scan_timer thread is alive.

Returns

True if Scan timer is running

Return type

bool

is_valid_admin_mode()

Validates that all relevant subarray devices are in a valid admin mode.

Returns

True if all subarrays are in a valid mode, False otherwise.

Return type

bool

log_state(msg='Device States')

Logs the state of devices and dishes.

This method logs the observation states of generic devices and

the pointing states of dish devices.

Parameters

msg (str) – A message to be included in the log.

Return type

None

abstract off(task_callback)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

abstract on(task_callback)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

process_event(attribute_name)

Process the given attribute’s event using the data from the event_queues and invoke corresponding process method.

Parameters

attribute_name (str) – Name of the attribute for which event is to be processed

Return type

None

abstract release_all(task_callback)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

remove_devices_from_lp(device_names)

Remove the given devices from liveliness probe.

Parameters

device_names (List[str]) – Device names for devices to be removed from Liveliness Probe

Return type

None

reset()

Method for resetting Not implemented

Return type

None

reset_sb_id()

Resets sb_id value.

Return type

None

reset_scan_duration()

Reset scan_duration value.

reset_scan_id()

Resets scan_id value.

Return type

None

reset_subarray_id()

Resets subarray_id value.

Return type

None

abstract restart(task_callback)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abstract scan(argin, task_callback)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

property scan_start_time_offset

Returns the offset for scan start time.

Returns

scan start time offset

Return type

float

set_abort_event()

Set Abort and abort flag for running commands

set_abort_flag_for_commands()

Set abort flags for command objects

set_admin_mode(argin, task_callback, task_abort_event)

set the admin mode of subarray devices

Parameters
  • argin (int) – Admin mode

  • task_callback (TaskCallbackType) – Task callback

  • task_abort_event (threading.Event) – Event to signal task abortion

Return type

Tuple[ResultCode, str]

Returns

a result code and message

set_pattern_scan_data(group_list)

This method set pattern scan data. Override this method to set pattern scan data provided in configure

Parameters

group_list – List of group

Return type

None

set_sb_id(sb_id)

Sets sb_id value.

Parameters

sb_id (str) – value to set

Return type

None

set_scan_duration(scan_duration)

Sets scan_duration value.

Parameters

scan_duration (float) – value to set

Return type

None

set_scan_id(scan_id)

Sets scan_id value.

Parameters

scan_id (float) – value to set

Return type

None

set_subarray_id(subarray_id)

Sets subarray_id value.

Parameters

subarray_id (int) – value to set

Return type

None

setup_event_subscription()

Sets up the event subscription after input parameters are updated.

Return type

None

stop()

stops liveliness probe

Return type

None

stop_all_process()

This stop aggregation process

Return type

None

stop_event_manager()

Stops the Event Receiver

Return type

None

stop_liveliness_probe()

Stops the liveliness probe

Return type

None

stop_scan_timer()

Stops scan_timer thread.

Return type

None

property subarray_obsstate

Keeps track of aggregated subarray ObsState

Returns

Current aggregated ObsState

property unavailable_devices

Returns List of the unavailable_devices.

Returns

list of unavailable devices

unsubscribe_dish_events()

abstract - override

Return type

None

update_assigned_resources(device_name, assigned_resources, timestamp)

Update assignedResources for a monitored device

Parameters
  • device_name (str) – name of the device

  • assigned_resources (str) – assignedResources

  • timestamp (datetime) – timestamp of execution

Return type

None

update_device_admin_mode(device_name, admin_mode, timestamp)

Update a monitored device admin mode

Parameters
  • device_name (str) – name of the device

  • admin_mode (AdminMode) – admin mode of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_dish_mode(device_name, dish_mode, timestamp)

Update the dish mode for given device.

Parameters
  • device_name (str) – name of the device

  • dish_mode (DishMode) – dish mode of the device

  • timestamp (datetime) – timestamp of start

update_device_health_info(device_name, health_info, timestamp)

Update a monitored device health info and trigger attribute update on Subarray node attribute.

Parameters
  • device_name (str) – name of the device

  • health_info (str) – diagnostic health info

  • timestamp (datetime) – event timestamp

Return type

None

update_device_health_state(device_name, health_state, timestamp)

Update a monitored device health state aggregate the health states available

Parameters
  • device_name (str) – name of the device

  • health_state (HealthState) – health state of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_obs_state(device_name, obs_state, timestamp)

Update a monitored device obs state, and call the relative callbacks if available

Parameters
  • device_name (str) – name of the device

  • obs_state (ObsState) – obs state of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_pointing_state(device_name, pointing_state, timestamp)

Update a monitored device pointing state aggregate the Subarray obs states and Dish pointing states

Parameters
  • device_name (str) – name of the device

  • pointing_state (PointingState) – pointing state of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_state(device_name, state, timestamp)

Update a monitored device state, aggregate the states available and call the relative callbacks if available

Parameters
  • device_name (str) – name of the device

  • state (DevState) – state of the device

  • timestamp (datetime) – timestamp of execution

Return type

None

update_event_failure(device_name)

Update the event failures if any for the given Device.

Parameters

device_name (str) – name of the device

Return type

None

update_exception_for_unresponsiveness(device_info, exception)

Set a device to failed and call the relative callback if available

Parameters
  • device_info (DeviceInfo) – a device info

  • exception (str) – an exception

Return type

None

update_health_info_details(device_name, event_data)

Function to extract the healthInfo from received events and update the healthInfo attribute on Subarray Node :type device_name: str :param device_name: Name of device :type device_name: str :type event_data: str :param event_data: Event data in string format :type event_data: str

Return type

None

update_input_parameter()

Updates the input parameter of a class instance with the current state of the instance.

Return type

None

update_liveliness_error_in_health_info(liveliness_data)

Updates Liveliness errors in healthinfo

Parameters

liveliness_data (dict) – dict of device and liveliness status

Return type

None

update_receive_addresses(device_name, receive_addresses, timestamp)

Update receiveAddresses for a monitored device

Parameters
  • device_name (str) – name of the device

  • receive_addresses (str) – receiveAddresses

  • timestamp (datetime) – timestamp of start

Return type

None

update_responsiveness_info(device_name)

Update a device with correct ping information.

Parameters

device_name (str) – name of the device

Return type

None

update_subarray_availability_status(device_name, availability_status, timestamp)

Update a monitored device availability status aggregate the subarray availability

Parameters
  • device_name (str) – name of the device

  • availability_status (bool) – availability status of the device

  • timestamp (datetime) – timestamp of execution

Return type

None

validate_layout_schema(layout_data)

Validate the basic structure of the array layout JSON.

This method performs minimal checks to ensure that the provided layout data includes the required top-level and receptor fields.

Parameters

layout_data (dict) – The layout JSON data to validate. Expected to contain a “receptors” list, where each receptor includes at least “station_label” and “location” keys.

Returns

A tuple containing:
  • bool: True if the validation passes, False otherwise.

  • str: A descriptive message indicating the validation result.

Return type

tuple[bool, str]

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

subarray_node_component_manager_low

Path: src/ska_tmc_subarraynode/manager/subarray_node_component_manager_low.py

This module is inherited from SubarrayNodeComponentManager.

Module for Low Telescope component manager.

class ska_tmc_subarraynode.manager.subarray_node_component_manager_low.SubarrayNodeComponentManagerLow(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, scan_start_time_enabled, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_subarray_health_info_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, _update_command_failure_info_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, is_auto_recovery_enabled=False, subarray_device_name='', csp_assign_interface='https://schema.skao.int/ska-low-csp-assignresources/3.0', csp_scan_interface='https://schema.skao.int/ska-low-csp-scan/3.2', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/1.1', mccs_configure_interface='https://schema.skao.int/ska-low-mccs-configure/1.0', mccs_scan_interface='https://schema.skao.int/ska-low-mccs-scan/3.0', mccs_release_interface='https://schema.skatelescope.org/ska-low-mccs-controller-release/2.0', jones_uri='tango://jones.skao.int/low/stn-beam/1', tel_model_source='', tel_model_path='', pre_recovery_check_time_duration=1.0)

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for low.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback, task_abort_event)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

  • task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

check_successive_configure_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for successive configure resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

clear_command_failure_info()

Clear command failure information after successful recovery

property command_failure_info

Return command failure info

Returns

command failure info

Return type

str

property config_json

Return config json

Returns

config json used

Return type

str

configure(argin, task_callback, task_abort_event)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

end(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_scan(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

Dictionary with devices and their availability

Return type

dict

get_set_obs_state()

Get Set Obs State dictionary based on is recovery flag

property is_recovery_in_progress

Return recovery in progress

Returns

flag to indicate recovery is in progress

Return type

bool

is_valid_admin_mode()

Extends the base admin mode validation with MCCS check for LOW telescope.

Returns

True if all subarrays including MCCS are in valid admin mode.

Return type

bool

move_sn_obs_state_to_empty()

Move Obs state back to EMPTY

move_sn_obs_state_to_idle()

Move Obs state back to IDLE

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

off(task_callback, task_abort_event)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

on(task_callback, task_abort_event)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

release_all(task_callback, task_abort_event)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

restart(task_callback, task_abort_event)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

scan(argin, task_callback, task_abort_event)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

set_assigned_resources(resources)

Method to assign and removes resources.

Parameters

resources (list) – name of the receptors.

Return type

None

set_command_failure_info(result_code, failure_info)

Set command failure information

Parameters

failure_info (str) – Command failure information to set

Return type

None

set_config_json(config_json)

Set configuration json after configure command is successful

Parameters

config_json (str) – Configuration json to set

Return type

None

standby(task_callback, task_abort_event)

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

Tuple[TaskStatus, str]

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

validate_configuration_json(argin)

_summary_

Parameters
  • argin (_type_) – _description_

  • json_argument (_type_) – _description_

  • configure_validator (_type_) – _description_

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

subarray_node_component_manager_mid

Path: src/ska_tmc_subarraynode/manager/subarray_node_component_manager_mid.py

This module is inherited from SubarrayNodeComponentManager.

It is component Manager for Mid Telecope.

class ska_tmc_subarraynode.manager.subarray_node_component_manager_mid.SubarrayNodeComponentManagerMid(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, scan_start_time_enabled, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_subarray_health_info_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, subarray_device_name='', csp_assign_interface='https://schema.skao.int/ska-csp-assignresources/2.0', csp_scan_interface='https://schema.skao.int/ska-csp-scan/2.2', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/0.4', tel_model_source='', tel_model_path='')

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for mid.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback, task_abort_event)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

  • task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

clear_assigned_resources()

Removes Dish Leaf Node and Dish Master devices from Input Parameter

Return type

None

configure(argin, task_callback, task_abort_event)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

end(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_scan(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

the dictionary with the devices and it’s availability

Return type

dict

get_dish_dev_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_dish_leaf_node_prefix()

Return the Dish Leaf Node prefix

Returns

Dish Leaf Node prefix

Return type

str

get_dish_ln_fqdn(receptor_id)

Return the dish leaf node FQDN.

Returns

Dish Leaf Node TRL

Return type

str

get_keys_required_for_getting_sdpqc_fqdn()

Returns the keys that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Return type

List

Returns

keys required for getting fqdn

get_normal_scan_dish_device_names()

Get normal scan dishln device names

Returns

normal scan dishln device names

Return type

list

get_tmc_dish_ln_device_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_trajectory_dish_device_names()

Get Trajectory dishln device names

Returns

Trajectory dishln device names

Return type

list

invoke_pointing_calibration(event_attribute_value)

This method get sdpQueueConnectorFqdn from event attribute value and set on dish leaf node

Parameters

event_attribute_value (str) – receiveAddresses attribute value

Return type

None

property kvalue_validation_failed

Gives the bool value for kvalue validation result

Returns

boolean value for kvalue validation result

mid_cleanup_on_abort_or_restart()

Method to clean the mid resources assigned on Abort or Restart command

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

off(task_callback, task_abort_event)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

on(task_callback, task_abort_event)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

process_lrcrevent(dev_name, value, timestamp)

Process Long Running Command Result

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

release_all(task_callback, task_abort_event)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

remove_dish_devices()

Removes dish devices from component

Return type

None

remove_dish_input_parameter_and_component(dish_ln_device, dish_dev)

Removes dish leaf node and dish master devices from Input Parameter and from Component.

Parameters
  • dish_ln_device – dish leaf node device names

  • dish_dev – dish master device names

Return type

None

restart(task_callback, task_abort_event)

Restarting the subarray.

Parameters
  • task_callback (TaskCallbackType) – task Callback

  • task_abort_event – Event to signal task abort, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

scan(argin, task_callback, task_abort_event)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

set_assigned_resources(resources)

Method to assign and remove dish receptors in subarray.

Parameters

resources (list) – name of the dish receptors

Return type

None

set_dish_device_names(dish_dev_names)

Update the names of the dishes assigned to Subarray

Parameters

dish_dev_names (List) – name of the dish devices

Return type

None

set_keys_required_for_getting_sdpqc_fqdn(set_the_keys)

Set the values that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Parameters

set_the_keys (List) – Set the values that are required to get sdpqc fqdn from dictionary received

Return type

None

set_normal_scan_dish_device_names(dish_ln_names)

Update the normal scan dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

set_pattern_scan_data(group_list)

Set up Pattern scan data

Parameters

group_list (List) – Group list

Return type

None

set_tmc_leaf_dish_device_names(tmc_dish_ln_device_names, dish_master_fqdns)

Update the names of the dish leaf nodes assigned to Subarray, and subscribe to dishMode and pointingState events.

Parameters

tmc_dish_ln_device_names (List[str]) – List of TMC dish leaf node FQDNs.

Return type

None

set_trajectory_dish_device_names(dish_ln_names)

Update the trajectory dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

standby(task_callback, task_abort_event)

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

Tuple[TaskStatus, str]

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

unsubscribe_dish_events()

abstract - override

Return type

None

unsubscribe_dish_leaf_node_events(dish_ln_device=None, dish_dev=None)

Unsubscribes from dishMode, pointingState, healthState, and longRunningCommandResult events for all currently assigned dish leaf node devices.

Return type

None

update_receive_addresses(device_name, receive_addresses, timestamp)

Update receiveAddresses for a monitored device

Parameters
  • device_name (str) – name of the device

  • receive_addresses (str) – receiveAddresses

  • timestamp (datetime) – timestamp

Return type

None

validate_configuration_json(argin)

Validate the configuration JSON.

Parameters

argin (str) – The JSON configuration string

Returns

Tuple of (validated_argin, json_argument, exception_msg)

Return type

Tuple[str, dict, str]

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

Module contents

Init module for manager

class ska_tmc_subarraynode.manager.AggregationProcessLow(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Low

set_state_aggregator()

Return an instance of StateAggregator for Low

Return type

StateAggregator

Returns

An instance of StateAggregator for Low

class ska_tmc_subarraynode.manager.AggregationProcessMid(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Mid

set_state_aggregator()

Return an instance of StateAggregator for Mid

Return type

StateAggregator

Returns

An instance of StateAggregator for Mid

class ska_tmc_subarraynode.manager.EventDataManager(component_manager, logger=<Logger ska_tmc_subarraynode.manager.event_data_manager (WARNING)>)

Bases: object

A class to update the values of events received for different attributes in EventDataStorage class

clear_dish_data()

clear dish data from event info

Return type

None

clear_liveliness_data()

clears LivelinessData

clear_lrcr()

clears LongRunning Command Results

Return type

None

compare_timevals(current_timestamp, received_timestamp)

A method to compare the timestamps of events received with the existing timestamp.

Parameters
  • current_timestamp (datetime) – Curent time stamp.

  • received_timestamp (datetime) – Received time stamp.

Returns

True, if current timestamp is less than received timestamp. False, otherwise.

Return type

bool

get_enum_name_from_value(enum_class, value)

Get the name from value of enum

Parameters
  • enum_class – Enum class.

  • valuename, member of enum.

Returns

Name of the enum

Return type

str

remove_device_liveliness_data(device_name)
removes a device data after a device has been removed from

liveliness probe

update_aggregation_queue(is_health_event=False)

A method to put a copy of the EventDataStorage object whenever it receives an event.

Parameters

is_health_event (bool) – True, if health event. False otherwise.

Return type

None

update_event_data(device, data, data_type, received_timestamp=None)

A method to receive and update device name, data, and timestamp in the EventDataStorage Class

Parameters
Return type

None

class ska_tmc_subarraynode.manager.HealthStateAggregationProcessor(event_data_queue, aggregated_health_state, aggregate_update_event, telescope='mid', callback=None)

Bases: AggregationProcess

Health State Aggregation Processor

Inherits from AggregationProcess and implements health-specific state aggregation logic.

set_state_aggregator()

Return an instance of HealthStateAggregator for the given telescope.

Return type

StateAggregator

Returns

An instance of HealthStateAggregator for the given telescope.

class ska_tmc_subarraynode.manager.SubarrayAvailabilityAggregatorLow(component_manager, logger)

Bases: Aggregator

Class to aggregate tmc low subarray device availability depending on tmc low leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Optional[Tuple[bool, List]]

Returns

a tuple containing bool representing subarray availability and list containing unavailable devices

class ska_tmc_subarraynode.manager.SubarrayAvailabilityAggregatorMid(component_manager, logger)

Bases: Aggregator

class to aggregate tmc mid subarray device availability depending on tmc mid leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Tuple[bool, List]

Returns

a tuple comtaining bool representing subarray availability and list conataining unavailable devices

class ska_tmc_subarraynode.manager.SubarrayNodeComponentManagerLow(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, scan_start_time_enabled, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_subarray_health_info_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, _update_command_failure_info_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, is_auto_recovery_enabled=False, subarray_device_name='', csp_assign_interface='https://schema.skao.int/ska-low-csp-assignresources/3.0', csp_scan_interface='https://schema.skao.int/ska-low-csp-scan/3.2', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/1.1', mccs_configure_interface='https://schema.skao.int/ska-low-mccs-configure/1.0', mccs_scan_interface='https://schema.skao.int/ska-low-mccs-scan/3.0', mccs_release_interface='https://schema.skatelescope.org/ska-low-mccs-controller-release/2.0', jones_uri='tango://jones.skao.int/low/stn-beam/1', tel_model_source='', tel_model_path='', pre_recovery_check_time_duration=1.0)

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for low.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback, task_abort_event)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

  • task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

check_successive_configure_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for successive configure resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

clear_command_failure_info()

Clear command failure information after successful recovery

property command_failure_info

Return command failure info

Returns

command failure info

Return type

str

property config_json

Return config json

Returns

config json used

Return type

str

configure(argin, task_callback, task_abort_event)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

end(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_scan(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

Dictionary with devices and their availability

Return type

dict

get_set_obs_state()

Get Set Obs State dictionary based on is recovery flag

property is_recovery_in_progress

Return recovery in progress

Returns

flag to indicate recovery is in progress

Return type

bool

is_valid_admin_mode()

Extends the base admin mode validation with MCCS check for LOW telescope.

Returns

True if all subarrays including MCCS are in valid admin mode.

Return type

bool

move_sn_obs_state_to_empty()

Move Obs state back to EMPTY

move_sn_obs_state_to_idle()

Move Obs state back to IDLE

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

off(task_callback, task_abort_event)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

on(task_callback, task_abort_event)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

release_all(task_callback, task_abort_event)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

restart(task_callback, task_abort_event)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

scan(argin, task_callback, task_abort_event)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

set_assigned_resources(resources)

Method to assign and removes resources.

Parameters

resources (list) – name of the receptors.

Return type

None

set_command_failure_info(result_code, failure_info)

Set command failure information

Parameters

failure_info (str) – Command failure information to set

Return type

None

set_config_json(config_json)

Set configuration json after configure command is successful

Parameters

config_json (str) – Configuration json to set

Return type

None

standby(task_callback, task_abort_event)

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

Tuple[TaskStatus, str]

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

validate_configuration_json(argin)

_summary_

Parameters
  • argin (_type_) – _description_

  • json_argument (_type_) – _description_

  • configure_validator (_type_) – _description_

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

class ska_tmc_subarraynode.manager.SubarrayNodeComponentManagerMid(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, scan_start_time_enabled, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_subarray_health_info_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, subarray_device_name='', csp_assign_interface='https://schema.skao.int/ska-csp-assignresources/2.0', csp_scan_interface='https://schema.skao.int/ska-csp-scan/2.2', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/0.4', tel_model_source='', tel_model_path='')

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for mid.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback, task_abort_event)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

  • task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

clear_assigned_resources()

Removes Dish Leaf Node and Dish Master devices from Input Parameter

Return type

None

configure(argin, task_callback, task_abort_event)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

end(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_scan(task_callback, task_abort_event)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

the dictionary with the devices and it’s availability

Return type

dict

get_dish_dev_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_dish_leaf_node_prefix()

Return the Dish Leaf Node prefix

Returns

Dish Leaf Node prefix

Return type

str

get_dish_ln_fqdn(receptor_id)

Return the dish leaf node FQDN.

Returns

Dish Leaf Node TRL

Return type

str

get_keys_required_for_getting_sdpqc_fqdn()

Returns the keys that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Return type

List

Returns

keys required for getting fqdn

get_normal_scan_dish_device_names()

Get normal scan dishln device names

Returns

normal scan dishln device names

Return type

list

get_tmc_dish_ln_device_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_trajectory_dish_device_names()

Get Trajectory dishln device names

Returns

Trajectory dishln device names

Return type

list

invoke_pointing_calibration(event_attribute_value)

This method get sdpQueueConnectorFqdn from event attribute value and set on dish leaf node

Parameters

event_attribute_value (str) – receiveAddresses attribute value

Return type

None

property kvalue_validation_failed

Gives the bool value for kvalue validation result

Returns

boolean value for kvalue validation result

mid_cleanup_on_abort_or_restart()

Method to clean the mid resources assigned on Abort or Restart command

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

off(task_callback, task_abort_event)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

on(task_callback, task_abort_event)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

process_lrcrevent(dev_name, value, timestamp)

Process Long Running Command Result

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

release_all(task_callback, task_abort_event)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

remove_dish_devices()

Removes dish devices from component

Return type

None

remove_dish_input_parameter_and_component(dish_ln_device, dish_dev)

Removes dish leaf node and dish master devices from Input Parameter and from Component.

Parameters
  • dish_ln_device – dish leaf node device names

  • dish_dev – dish master device names

Return type

None

restart(task_callback, task_abort_event)

Restarting the subarray.

Parameters
  • task_callback (TaskCallbackType) – task Callback

  • task_abort_event – Event to signal task abort, defaults to None

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

scan(argin, task_callback, task_abort_event)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[TaskStatus, str]

Returns

a result code and message

set_assigned_resources(resources)

Method to assign and remove dish receptors in subarray.

Parameters

resources (list) – name of the dish receptors

Return type

None

set_dish_device_names(dish_dev_names)

Update the names of the dishes assigned to Subarray

Parameters

dish_dev_names (List) – name of the dish devices

Return type

None

set_keys_required_for_getting_sdpqc_fqdn(set_the_keys)

Set the values that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Parameters

set_the_keys (List) – Set the values that are required to get sdpqc fqdn from dictionary received

Return type

None

set_normal_scan_dish_device_names(dish_ln_names)

Update the normal scan dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

set_pattern_scan_data(group_list)

Set up Pattern scan data

Parameters

group_list (List) – Group list

Return type

None

set_tmc_leaf_dish_device_names(tmc_dish_ln_device_names, dish_master_fqdns)

Update the names of the dish leaf nodes assigned to Subarray, and subscribe to dishMode and pointingState events.

Parameters

tmc_dish_ln_device_names (List[str]) – List of TMC dish leaf node FQDNs.

Return type

None

set_trajectory_dish_device_names(dish_ln_names)

Update the trajectory dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

standby(task_callback, task_abort_event)

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

Tuple[TaskStatus, str]

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

unsubscribe_dish_events()

abstract - override

Return type

None

unsubscribe_dish_leaf_node_events(dish_ln_device=None, dish_dev=None)

Unsubscribes from dishMode, pointingState, healthState, and longRunningCommandResult events for all currently assigned dish leaf node devices.

Return type

None

update_receive_addresses(device_name, receive_addresses, timestamp)

Update receiveAddresses for a monitored device

Parameters
  • device_name (str) – name of the device

  • receive_addresses (str) – receiveAddresses

  • timestamp (datetime) – timestamp

Return type

None

validate_configuration_json(argin)

Validate the configuration JSON.

Parameters

argin (str) – The JSON configuration string

Returns

Tuple of (validated_argin, json_argument, exception_msg)

Return type

Tuple[str, dict, str]

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

class ska_tmc_subarraynode.manager.SubarrayNodeEventManager(component_manager, subscription_configuration=None, logger=<Logger ska_tmc_subarraynode.manager.event_manager (WARNING)>, stateless=True, event_subscription_check_period=1, event_error_max_count=10, status_update_callback=None, maximum_status_queue_size=50)

Bases: EventManager

Event manager for handling TANGO events for the SubarrayNode component. Inherits from ska_tmc_common.v2.EventManager and provides specific callbacks for different TANGO attributes and states relevant to SubarrayNode.

adminmode_event_callback(event)

Callback for handling adminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

assignedresources_event_callback(event)

Callback for handling assignedResources TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayadminmode_event_callback(event)

Callback for handling cspSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayobsstate_event_callback(event)

Callback for handling cspSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

dishmode_event_callback(event)

Callback for handling dishMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

healthinfo_event_callback(event)

Callback for handling healthInfo TANGO events.

Return type

None

healthstate_event_callback(event)

Callback for handling healthState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

issubsystemavailable_event_callback(event)

Callback for handling isSubsystemAvailable TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

longrunningcommandresult_event_callback(event)

Callback for handling longRunningCommandResult TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

mccscontrolleradminmode_event_callback(event)

Callback for handling mccsControllerAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

mccssubarrayadminmode_event_callback(event)

Callback for handling mccsSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

obsstate_event_callback(event)

Callback for handling obsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

pointingstate_event_callback(event)

Callback for handling pointingState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

receiveaddresses_event_callback(event)

Callback for handling receiveAddresses TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayadminmode_event_callback(event)

Callback for handling sdpSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayobsstate_event_callback(event)

Callback for handling sdpSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

state_event_callback(event)

Callback for handling state TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

Command Timeout

The CommandTimeout attribute is introduced to allow updating the timeout value for commands without requiring a redeployment. This provides flexibility in tuning the timeout dynamically at runtime based on operational needs.

The CommandTimeOutDefault property is also introduced, which can be used to set a default timeout value during the deployment phase. This ensures that an initial timeout value is preconfigured when the component starts for the first time.

Usage

  • CommandTimeout attribute - Can be updated at runtime without redeployment. - Helps in adapting to varying command execution times.

  • CommandTimeOutDefault property - Configurable in the deployment configuration (e.g., values.yaml). - Sets the initial timeout value at startup.