ska_tmc_subarraynode package

Link to the TMC User documentation is here.

Subpackages

Submodules

subarraynode_node

Path: src/ska_tmc_subarraynode/subarray_node.py

Subarray Node Provides the monitoring and control interface required by users as well as other TM Components (such as OET, Central Node) for a Subarray.

class ska_tmc_subarraynode.subarray_node.BaseSubarrayNode(*args, **kwargs)

Bases: SKASubarray, TMCBaseDevice

Provides the monitoring and control interface required by users as well as other TM Components (such as OET, Central Node) for a Subarray.

BaseSubarrayNode class is inherited from SKASubarray class and TMCBaseDevice class. TMCBaseDevice class is further inherited from SKABaseDevice class.

Common attributes and device_properties within TMC nodes are getting inherited from TMCBaseDevice.

Device Properties
SdpSubarrayLNFQDN:

This property contains the FQDN of the SDP Subarray Leaf Node associated with the Subarray Node.

CspSubarrayLNFQDN:

This property contains the FQDN of the CSP Subarray Leaf Node associated with the Subarray Node.

CspSubarrayFQDN:

FQDN of the CSP Subarray Tango Device Server.

SdpSubarrayFQDN:

FQDN of the SDP Subarray Tango Device Server.

Device Attributes
scanID:

ID of ongoing SCAN

sbID:

ID of ongoing Scheduling Block

isSubarrayAvailable:

Shows availability of subarray device

class InitCommand(*args, **kwargs)

Bases: InitCommand

A class for the TMC SubarrayNode’s init_device() method.

do()

Initializes the attributes and properties of the Subarray Node.

Return type

Tuple[ResultCode, str]

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises

DevFailed if the error while subscribing the tango attribute

Off()

Invokes Off command on SubarrayNode

Return type

Tuple[List[ResultCode], List[str]]

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

On()

Invokes On command on SubarrayNode

Returns

A tuple containing a return code and a string

Return type

(ResultCode, str)

Standby()

Invokes Standby command on SubarrayNode

Return type

Tuple[List[ResultCode], List[str]]

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

always_executed_hook()

Internal construct of TANGO.

create_component_manager()

Create component manager object for command invocation.

Return type

None

delete_device()
init_command_objects()

Initialises the command handlers for commands supported by this device.

Return type

None

internalModel_read()

Internal construct of TANGO. Returns the internal model.

Returns

JSON-encoded string with the internal model

Return type

str

is_Abort_allowed()

Check if command Abort is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_AssignResources_allowed()

Return whether the AssignResource command may be called in the current state.

Returns

whether the command may be called in the current observational state

Return type

bool

is_Configure_allowed()

Check if command Configure is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_EndScan_allowed()

Check if command EndScan is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_End_allowed()

Check if command End is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_Off_allowed()

Checks whether the command is allowed to be run in the current state

Return type

bool

Returns

True if this command is allowed to be run in current device state, False otherwise.

Raises:DevFailed if this command is not allowed to be run

in current device state

is_On_allowed()

Checks whether the command is allowed to be run in the current state

Returns

True if this command is allowed to be run in current device state, False otherwise.

Return type

bool

Raises

DevFailed if this command is not allowed to be run in current device state

is_ReleaseAllResources_allowed()

Check if command ReleaseAllResources is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_Restart_allowed()

Check if command Restart is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_Scan_allowed()

Check if command Scan is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_SetAdminMode_allowed()

Check if command Restart is allowed in the current device state.

Return type

bool

Returns

True if the command is allowed

is_Standby_allowed()

Checks whether the command Standby is allowed to be run in the current state

Return type

bool

Returns

True if this command is allowed to be run in current device state, False otherwise.

Raises:DevFailed if this command is not allowed to be run

in current device state

read_assignedResources()

Returns assignedResources attribute value.

Returns

JSON-encoded string with the assigned resources

Return type

str

read_isAdminModeEnabled()

Return the isAdminModeEnabled attribute value

Returns

True if the admin mode is enabled, False otherwise

Return type

bool

read_isSubarrayAvailable()

Return the TMC Subarray availability status. True/False

Returns

True if the subarray is available, False otherwise

Return type

bool

read_sbID()

Internal construct of TANGO. Returns the scheduling block ID.

Returns

string with the scheduling block ID

Return type

str

read_scanID()

Internal construct of TANGO. Returns the Scan ID.

EXAMPLE: 123

Where 123 is a Scan ID from configuration json string.

Returns

string with the scan ID

Return type

str

scanDuration()

This attribute is used for exposing the scan duration of ongoing scan to other subsystems.

Returns

The scan duration of the ongoing scan

Return type

float

transformedInternalModel_read()

Internal construct of TANGO. Returns the transformed internal model.

Returns

JSON-encoded string with the transformed internal model

Return type

str

update_assigned_resources_callback(assigned_resources)

Triggers a push change event for the assigned resources.

Parameters

assigned_resources (str) – The assigned resources to update.

Return type

None

update_device_callback(dev_info)

Updates the last device information changed and triggers a push change event.

Parameters

dev_info (DeviceInfo) – The device information to update.

Return type

None

update_scan_duration_callback(scan_duration)

Triggers a push change event for the change in scan duration.

Parameters

scan_duration (float) – The scan duration to update.

Return type

None

update_subarray_availability_status_callback(subarray_availability)

Triggers a push change event for the isSubarrayAvailable.

Parameters

subarray_availability (bool) – The subarray availability status.

Return type

None

update_subarray_health_state_callback(subarray_health_state)

This method updates the subarray health state and triggers a push change event.

Parameters

subarray_health_state (str) – The subarray health state to update.

Return type

None

write_isAdminModeEnabled(value)

Set the value of isAdminModeEnabled attribute

Parameters

value (bool) – The value to set for the isAdminModeEnabled attribute

Return type

None

subarraynode_node_low

Path: src/ska_tmc_subarraynode/subarray_node_low.py

Subarray Node Low provides the monitoring and control interface required by users as well as other TM Components (such as OET, Central Node) for a Subarray Low.

class ska_tmc_subarraynode.subarray_node_low.LowTmcSubarray(*args, **kwargs)

Bases: BaseSubarrayNode

Provides the monitoring and control interface required by users as well as other TM Components (such as OET, Central Node) for a Subarray.

Device Properties
MccsSubarrayLNFQDN:

This property contains the FQDN of the MCCS Subarray Leaf Node associated with the Subarray Node.

MccsSubarrayFQDN:

This property contains the FQDN of the MCCS Subarray associated with the Subarray Node.

Device Attributes

class InitCommand(*args, **kwargs)

Bases: InitCommand

A class for the TMC LowTmcSubarray’s init_device() method.

do()

Initializes the attributes and properties of the Subarray Node Mid.

Return type

Tuple[ResultCode, str]

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises

DevFailed if the error while subscribing the tango attribute

create_component_manager()

Create instance of component manager

Return type

SubarrayNodeComponentManagerLow

Returns

Instance of component manager

ska_tmc_subarraynode.subarray_node_low.main(args=None, **kwargs)

Runs the LowTmcSubarray.

Parameters
  • args – Arguments internal to TANGO

  • kwargs – Arguments internal to TANGO

Returns

LowTmcSubarray TANGO object.

subarraynode_node_mid

Path: src/ska_tmc_subarraynode/subarray_node_mid.py

Subarray Node Mid provides the monitoring and control interface required by users as well as other TM Components (such as OET, Central Node) for a Subarray Mid.

class ska_tmc_subarraynode.subarray_node_mid.MidTmcSubarray(*args, **kwargs)

Bases: BaseSubarrayNode

Provides the monitoring and control interface required by users as well as other TM Components (such as OET, Central Node) for a Subarray.

Device Properties
DishLeafNodePrefix:

Device name prefix for the Dish Leaf Node.

Device Attributes

class InitCommand(*args, **kwargs)

Bases: InitCommand

A class for the TMC MidTmcSubarray’s init_device() method.

do()
Initializes the attributes and properties of the

Subarray Node Mid.

Return type

Tuple[ResultCode, str]

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Raises

DevFailed if the error while subscribing the tango attribute

create_component_manager()

Create instance of component manager

Return type

SubarrayNodeComponentManagerMid

Returns

Instance of component manager

ska_tmc_subarraynode.subarray_node_mid.main(args=None, **kwargs)

Runs the SubarrayNode.

Parameters
  • args – Arguments internal to TANGO

  • kwargs – Arguments internal to TANGO

Returns

SubarrayNode TANGO object.

exceptions

Path: src/ska_tmc_subarraynode/exceptions.py

This module has custom exception for repository ska_tmc_subarraynode

exception ska_tmc_subarraynode.exceptions.CommandNotAllowed

Bases: Exception

Raised when a command is not allowed.

exception ska_tmc_subarraynode.exceptions.DeviceUnresponsive

Bases: Exception

Raised when a device is not responsive.

exception ska_tmc_subarraynode.exceptions.InvalidObsStateError

Bases: ValueError

Raised when subarray is not in required obsState.

release

Path: src/ska_tmc_subarraynode/release.py

Release information for Python Package

transaction_id

Path: src/ska_tmc_subarraynode/transaction_id.py

This module is for identifing and changing the transaction ids

ska_tmc_subarraynode.transaction_id.identify_with_id(name, arg_name)

This method decorator that identifies a transaction with a unique ID and adds it to the wrapped function’s object.

Parameters
  • name (str) – Name of the function

  • arg_name (str) – Name of the argument to be used for the transaction

Returns

A decorator that wraps the function with transaction ID logic

ska_tmc_subarraynode.transaction_id.inject_id(obj, data)

This method injecting a transaction id

Parameters
  • obj – The object to inject the transaction ID into

  • data (Dict) – The dictionary object to update with the transaction ID

Return type

Dict

Returns

The updated dictionary object with the transaction ID

ska_tmc_subarraynode.transaction_id.inject_with_id(arg_position, arg_name)

For this method A decorator that injects an ID field into a dictionary-like argument of a function.

Parameters
  • arg_position (int) – The position of the argument in the function

  • arg_name (str) – The name of the argument to be used for the transaction

Returns

A decorator that wraps the function with transaction ID logic

ska_tmc_subarraynode.transaction_id.update_with_id(obj, parameters)

Updates the given dictionary-like obj with an ID field and the values in parameters.

Parameters
  • obj – The object to inject the transaction ID into

  • parameters (Any) – A dictionary-like object to update with the transaction ID.

Return type

Union[Dict, str]

Returns

The updated dictionary object with the transaction ID

Raises

Exception – If parameters is not a dictionary or string

input_validator

Path: src/ska_tmc_subarraynode/input_validator.py

This module is for validationg the input strings for the repository

class ska_tmc_subarraynode.input_validator.ConfigureValidator(component_manager, logger=<Logger ska_tmc_subarraynode.input_validator (WARNING)>)

Bases: object

Class to validate the input string of Configure command of Subarray Node

check_pattern_in_partial_configure(partial_config)

This method checks pattern provided in partial configure. It raises error if pattern name not supported by TMC.

Parameters

partial_config (Dict) – partial configuration data

Return type

None

loads(input_string)

Validates the input string received as an argument of Configure command. If the request is correct, returns the Serialized JSON string. The ska-tmc-cdm is used to validate the JSON.

Parameters

input_string (str) – A JSON string

Returns

Serialized JSON string if successful.

Return type

str

Raises

InvalidJSONError – When the JSON string is not formatted properly.

validate_groups_key_data(group_list)

Validate the trajectory pattern and receptors in the provided holography configuration.

This method checks the trajectory pattern for each group in the provided list. Currently, the TMC only supports the ‘mosaic’ pattern. If any other pattern is provided, the command will be rejected

It also validates receptors based on the number of groups. If there are multiple groups, receptors must be provided for each group

Parameters

group_list (list) – A list containing groups with configuration data, including trajectory and receptors information.

Raises

InvalidJSONError – If the validation fails.

Return type

None

verify_json_with_keys(input_json, telescope)

Verify the given json to check if it contains all the expected keys for a configure json.

Parameters
  • input_json (dict) – The input json for the Configure command.

  • telescope (str) – The telescope type, either “LOW” or “MID”.

Raises

InvalidJSONError – If the json is missing any of the expected keys.

Return type

None

verify_receptor_in_assigned_resources(receptors)

Verify if receptors are in assigned_resources.

Parameters

receptors (List) – List of receptors to be verified.

Raises

InvalidJSONError – If the receptors are not in assigned_resources.

Return type

None

class ska_tmc_subarraynode.input_validator.ScanValidator(logger=<Logger ska_tmc_subarraynode.input_validator (WARNING)>)

Bases: object

Class to validate the input string of Scan command of Subarray Node

loads(input_string)

Validates the input string received as an argument of Scan command. If the request is correct, returns the Serialized JSON string. The ska-tmc-cdm is used to validate the JSON.

Parameters

input_string (str) – A JSON string

Returns

Serialized JSON string if successful.

Return type

str

Raises

InvalidJSONError – When the JSON string is not formatted properly.

Module contents

Properties in Subarray Node

Property Name

Data Type

Description

CspSubarrayLNFQDN

DevString

FQDN of the CSP Subarray Leaf Node device

SdpSubarrayLNFQDN

DevString

FQDN of the SDP Subarray Leaf Node device

CspSubarrayFQDN

DevString

FQDN of the CSP Subarray device

SdpSubarrayFQDN

DevString

FQDN of the SDP Subarray device

AbortCommandTimeOut

DevUShort

Timeout for the Subarray ABORTED obsState transition. Once the AbortCommandTimeOut exceeds, SubarrayNode transitions to obsState FAULT.

CspScanInterfaceURL

DevString

Interface URL of the CSP sub-system for Scan command

SdpScanInterfaceURL

DevString

Interface URL of the SDP sub-system for Scan command

CspAssignResourcesInterfaceURL

DevString

Interface URL of the CSP sub-system for AssignResources command

CommandTimeOut

DevUShort

Timeout for the command execution

LivelinessCheckPeriod

DevFloat

Period for the liveliness probe to monitor each device in a loop

EventSubscriptionCheckPeriod

DevFloat

Period for the event subscriber to check the device subscriptions in a loop

Additional Properties in Subarray Node Mid

Property Name

Data Type

Description

DishLeafNodePrefix

DevString

Device name prefix for Dish Leaf Node. This property is for internal use.

DishMasterIdentifier

DevString

Device name tag/identifier for Dish Master device. This property is for internal use.

DishMasterFQDNs

DevStringArray

List of Dish Master devices. This property derived from the values of properties DishIDs and DishMasterIdentifier. It is for internal use.

Additional Properties in Subarray Node Low

Property Name

Data Type

Description

MccsSubarrayLNFQDN

DevString

FQDN of the MCCS Subarray Leaf Node Tango Device Server

MccsSubarrayFQDN

DevString

FQDN of the MCCS Subarray device

MccsConfigureInterfaceURL

DevString

Interface URL of the MCCS sub-system for Configure command

MccsScanInterfaceURL

DevString

Interface URL of the MCCS sub-system for Scan command

JonesURI

DevString

URI for Jones Matrix