Subarray Node

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 tmcprototype.subarraynode.src.subarraynode.subarray_node.SubarrayNode(*args: Any, **kwargs: Any)

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

class InitCommand(*args: Any, **kwargs: Any)

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

do()

Initializes the attributes and properties of the Subarray Node.

Returns

A tuple containing a return code and a string message indicating status.

The message is for information purpose only.

Return type

(ReturnCode, str)

Raises

DevFailed if the error while subscribing the tango attribute

Track(argin)

Invokes Track command on the Dishes assigned to the Subarray.

always_executed_hook()

Internal construct of TANGO.

calculate_observation_state()

Calculates aggregated observation state of Subarray.

command_class_object()

Sets up the command objects :return: None

delete_device()

Internal construct of TANGO.

get_deviceproxy(device_fqdn)

Returns device proxy for given FQDN.

health_state_cb(event)

Retrieves the subscribed health states, aggregates them to calculate the overall subarray health state.

Parameters

event – A TANGO_CHANGE event on Subarray healthState.

Returns

None

init_command_objects()

Initialises the command handlers for commands supported by this device.

is_Track_allowed()

Checks whether this command is allowed to be run in current device state

Returns

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

Return type

boolean

Raises

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

observation_state_cb(evt)

Retrieves the subscribed CSP_Subarray AND SDP_Subarray obsState.

Parameters

evt – A TANGO_CHANGE event on CSP and SDP Subarray obsState.

Returns

None

pointing_state_cb(evt)

Retrieves the subscribed DishMaster health state, aggregate them to evaluate health state of the Subarray.

Parameters

evt – A TANGO_CHANGE event on DishMaster healthState.

Returns

None

read_activityMessage()

Internal construct of TANGO. Returns activityMessage. Example: “Subarray node is initialized successfully” //result occured after initialization of device.

read_receptorIDList()

Internal construct of TANGO. Returns the receptor IDs allocated to the Subarray.

read_sbID()

Internal construct of TANGO. Returns the scheduling block ID.

read_scanID()

Internal construct of TANGO. Returns the Scan ID.

EXAMPLE: 123 Where 123 is a Scan ID from configuration json string.

receive_addresses_cb(event)

Retrieves the receiveAddresses attribute of SDP Subarray.

Parameters

event – A TANGO_CHANGE event on SDP Subarray receiveAddresses attribute.

Returns

None

remove_receptors_from_group()

Deletes tango group of the resources allocated in the subarray.

Note: Currently there are only receptors allocated so the group contains only receptor ids.

Parameters

argin – DevVoid

Returns

DevVoid

validate_obs_state()
write_activityMessage(value)

Internal construct of TANGO. Sets the activityMessage.

tmcprototype.subarraynode.src.subarraynode.subarray_node.main(args=None, **kwargs)

Runs the SubarrayNode. :param args: Arguments internal to TANGO :param kwargs: Arguments internal to TANGO :return: SubarrayNode TANGO object.

OnCommand class for SubarrayNode

class tmcprototype.subarraynode.src.subarraynode.on_command.OnCommand(*args: Any, **kwargs: Any)

A class for the SubarrayNode’s On() command.

do()

This command invokes On Command on CSPSubarray and SDPSubarray through respective leaf nodes. This comamnd changes Subaray device state from OFF to ON.

Returns

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

Return type

(ResultCode, str)

Raises

DevFailed if the command execution is not successful

OffCommand class for SubarrayNode

class tmcprototype.subarraynode.src.subarraynode.off_command.OffCommand(*args: Any, **kwargs: Any)

A class for the SubarrayNodes’s Off() command.

do()

This command invokes Off Command on CSPSubarray and SDPSubarray through respective leaf nodes. This comamnd changes Subaray device state from ON to OFF.

Returns

A tuple containing a return code and a string message indicating status.

The message is for information purpose only.

Return type

(ResultCode, str)

Raises

DevFailed if the command execution is not successful

AssignResourcesCommand class for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.assign_resources_command.AssignResourcesCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s AssignResources() command.

add_receptors_in_group(argin)

Creates a tango group of the successfully allocated resources in the subarray. Device proxy for each of the resources is created. The healthState and pointintgState attributes from all the devices in the group are subscribed so that the changes in the respective device are received at Subarray Node.

Note: Currently there are only receptors allocated so the group contains only receptor ids.

Parameters

argin – DevVarStringArray. List of receptor IDs to be allocated to subarray. Example: [‘0001’, ‘0002’]

Returns

DevVarStringArray. List of Resources added to the Subarray. Example: [‘0001’, ‘0002’]

assign_csp_resources(argin)

This function accepts the receptor IDs list as input and invokes the assign resources command on the CSP Subarray Leaf Node.

Parameters

argin

List of strings Contains the list of strings that has the resources ids. Currently this list contains only receptor ids.

Example: [‘0001’, ‘0002’]

Returns

List of strings. Returns the list of CSP resources successfully assigned to the Subarray. Currently, the CSPSubarrayLeafNode.AssignResources function returns void. The function only loops back the input argument in case of successful resource allocation, or returns exception object in case of failure.

assign_sdp_resources(argin)

This function accepts the receptor ID list as input and assigns SDP resources to SDP Subarray through SDP Subarray Leaf Node.

Parameters

argin – List of strings Contains the list of strings that has the resources ids. Currently processing block ids are passed to this function.

Returns

List of strings.

Example: [‘PB1’, ‘PB2’]

Returns the list of successfully assigned resources. Currently the SDPSubarrayLeafNode.AssignResources function returns void. Thus, this function just loops back the input argument in case of success or returns exception object in case of failure.

do(argin)

Assigns resources to the subarray. It accepts receptor id list as well as SDP resources string as a DevString. Upon successful execution, the ‘receptorIDList’ attribute of the subarray is updated with the list of receptors and SDP resources string is pass to SDPSubarrayLeafNode, and returns list of assigned resources as well as passed SDP string as a DevString.

Note: Resource allocation for CSP and SDP resources is also implemented but currently CSP accepts only receptorIDList and SDP accepts resources allocated to it.

Parameters

argin – DevString.

Example:

{“dish”:{“receptorIDList”:[“0002”,”0001”]},”sdp”:{“id”: “sbi-mvp01-20200325-00001”,”max_length”:100.0,”scan_types”:[{“id”:”science_A”, “coordinate_system”:”ICRS”,”ra”:”02:42:40.771”,”dec”:”-00:00:47.84”,”channels”: [{“count”:744,”start”:0,”stride”:2,”freq_min”:0.35e9,”freq_max”:0.368e9, “link_map”:[[0,0],[200,1],[744,2],[944,3]]},{“count”:744,”start”:2000,”stride”:1, “freq_min”:0.36e9,”freq_max”:0.368e9,”link_map”:[[2000,4],[2200,5]]}]},{“id”: “calibration_B”,”coordinate_system”:”ICRS”,”ra”:”12:29:06.699”,”dec”:”02:03:08.598”, “channels”:[{“count”:744,”start”:0,”stride”:2,”freq_min”:0.35e9, “freq_max”:0.368e9,”link_map”:[[0,0],[200,1],[744,2],[944,3]]},{“count”:744, “start”:2000,”stride”:1,”freq_min”:0.36e9,”freq_max”:0.368e9,”link_map”:[[2000,4], [2200,5]]}]}],”processing_blocks”:[{“id”:”pb-mvp01-20200325-00001”,”workflow”: {“type”:”realtime”,”id”:”vis_receive”,”version”:”0.1.0”},”parameters”:{}}, {“id”:”pb-mvp01-20200325-00002”,”workflow”:{“type”:”realtime”,”id”:”test_realtime”, “version”:”0.1.0”},”parameters”:{}},{“id”:”pb-mvp01-20200325-00003”,”workflow”: {“type”:”batch”,”id”:”ical”,”version”:”0.1.0”},”parameters”:{},”dependencies”:[ {“pb_id”:”pb-mvp01-20200325-00001”,”type”:[“visibilities”]}]},{“id”: “pb-mvp01-20200325-00004”,”workflow”:{“type”:”batch”,”id”:”dpreb”,”version”:”0.1.0”}, “parameters”:{},”dependencies”:[{“pb_id”:”pb-mvp01-20200325-00003”,”type”: [“calibration”]}]}]}}

Returns

A tuple containing a return code and string of Resources added to the Subarray. Example of string of Resources :

[“0001”,”0002”]

as argout if allocation successful.

Return type

(ResultCode, str)

Raises

ValueError if input argument json string contains invalid value DevFailed if the command execution is not successful

ReleaseAllResourcesCommand for SubarrayNode

class tmcprototype.subarraynode.src.subarraynode.release_all_resources_command.ReleaseAllResourcesCommand(*args: Any, **kwargs: Any)

A class for SKASubarray’s ReleaseAllResources() command.

do()

It checks whether all resources are already released. If yes then it throws error while executing command. If not it Releases all the resources from the subarray i.e. Releases resources from TMC Subarray Node, CSP Subarray and SDP Subarray. If the command execution fails, array of receptors(device names) which are failed to be released from the subarray, is returned to Central Node. Upon successful execution, all the resources of a given subarray get released and empty array is returned. Selective release is not yet supported.

Returns

A tuple containing a return code and “[]” as a string on successful release all resources.

Example: “[]” as string on successful release all resources.

Return type

(ResultCode, str)

Raises

DevFailed if the command execution is not successful

release_csp_resources()

This function invokes releaseAllResources command on CSP Subarray via CSP Subarray Leaf Node.

Parameters

argin – DevVoid

Returns

DevVoid

release_sdp_resources()

This function invokes releaseAllResources command on SDP Subarray via SDP Subarray Leaf Node.

Parameters

argin – DevVoid

Returns

DevVoid

ConfigureCommand class for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.configure_command.ConfigureCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s Configure() command.

do(argin)

Configures the resources assigned to the Subarray.The configuration data for SDP, CSP and Dish is extracted out of the input configuration string and relayed to the respective underlying devices (SDP Subarray Leaf Node, CSP Subarray Leaf Node and Dish Leaf Node).

Parameters

argin – DevString.

JSON string that includes pointing parameters of Dish - Azimuth and Elevation Angle, CSP Configuration and SDP Configuration parameters. JSON string example is: {“pointing”:{“target”:{“system”:”ICRS”,”name”:”Polaris Australis”,”RA”:”21:08:47.92”,”dec”:”-88:57:22.9”}}, “dish”:{“receiverBand”:”1”},”csp”:{“id”:”sbi-mvp01-20200325-00001-science_A”,”frequencyBand”:”1”, “fsp”:[{“fspID”:1,”functionMode”:”CORR”,”frequencySliceID”:1,”integrationTime”:1400,”corrBandwidth”:0}]}, “sdp”:{“scan_type”:”science_A”},”tmc”:{“scanDuration”:10.0}} CSP block in json string is as per earlier implementation and not aligned to SP-872 Note: While invoking this command from JIVE, provide above JSON string without any space.

Returns

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

Return type

(ReturnCode, str)

Raises

JSONDecodeError if input argument json string contains invalid value

class tmcprototype.subarraynode.src.subarraynode.configure_command.ElementDeviceData
static build_up_csp_cmd_data(scan_config, attr_name_map, receive_addresses_map)

Here the input data for CSP is build which is used in configuration of CSP. Below is the csp_config_schema variable value generated by using ska_telmodel library. {‘id’: ‘sbi-mvp01-20200325-00001-science_A’, ‘frequencyBand’: ‘1’, ‘fsp’: [{‘fspID’: 1, ‘functionMode’ : ‘CORR’, ‘frequencySliceID’: 1, ‘integrationTime’: 1400, ‘corrBandwidth’: 0, ‘channelAveragingMap’: [[0, 2], [744, 0]], ‘fspChannelOffset’: 0, ‘outputLinkMap’: [[0, 0], [200, 1]], ‘outputHost’: [[0, ‘192.168.0.1’], [400, ‘192.168.0.2’]], ‘outputMac’: [[0, ‘06-00-00-00-00-00’]], ‘outputPort’: [[0, 9000, 1], [400, 9000, 1]]}, {‘fspID’: 2, ‘functionMode’: ‘CORR’, ‘frequencySliceID’: 2, ‘integrationTime’: 1400, ‘corrBandwidth’: 0, ‘channelAveragingMap’: [[0, 2], [744, 0]], ‘fspChannelOffset’: 744, ‘outputLinkMap’: [[0, 4], [200, 5]], ‘outputHost’: [[0, ‘192.168.0.3’], [400, ‘192.168.0.4’]], ‘outputMac’: [[0, ‘06-00-00-00-00-01’]], ‘outputPort’: [[0, 9000, 1], [400, 9000, 1]]}]}

Returns

csp confiuration schema

static build_up_dsh_cmd_data(scan_config, only_dishconfig_flag)
static build_up_sdp_cmd_data(scan_config)

ScanCommand class for SubarrayNode

class tmcprototype.subarraynode.src.subarraynode.scan_command.ScanCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s Scan() command.

call_end_scan_command()
do(argin)

This command accepts id as input. And it Schedule scan on subarray from where scan command is invoked on respective CSP and SDP subarray node for the provided interval of time. It checks whether the scan is already in progress. If yes it throws error showing duplication of command.

Parameters

argin – DevString. JSON string containing id.

JSON string example as follows:

{“id”: 1}

Note: Above JSON string can be used as an input argument while invoking this command from JIVE.

Returns

A tuple containing a return code and a string message indicating status.

The message is for information purpose only.

Return type

(ReturnCode, str)

Raises

DevFailed if the command execution is not successful

EndScanCommand class for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.end_scan_command.EndScanCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s EndScan() command.

do()

Ends the scan. It is invoked on subarray after completion of the scan duration. It can also be invoked by an external client while a scan is in progress, Which stops the scan immediately irrespective of the provided scan duration.

Returns

A tuple containing a return code and a string message indicating status.

The message is for information purpose only.

Return type

(ReturnCode, str)

Raises

DevFailed if the command execution is not successful.

EndCommand class for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.end_command.EndCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s End() command.

do()

This command on Subarray Node invokes EndSB command on CSP Subarray Leaf Node and SDP Subarray Leaf Node, and stops tracking of all the assigned dishes.

Returns

A tuple containing a return code and a string message indicating status.

The message is for information purpose only.

Return type

(ResultCode, str)

Raises

DevFailed if the command execution is not successful.

stop_dish_tracking()

AbortCommand for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.abort_command.AbortCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s Abort() command.

do()

This command on Subarray Node invokes Abort command on CSP Subarray Leaf Node and SDP Subarray Leaf Node, and stops tracking of all the assigned dishes.

Returns

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

Return type

(ResultCode, str)

Raises

DevFailed if error occurs in invoking command on any of the devices like CSPSubarrayLeafNode, SDPSubarrayLeafNode or DishLeafNode

RestartCommand for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.restart_command.RestartCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s Restart() command.

do()

This command invokes Restart command on CSPSubarrayLeafNode, SDpSubarrayLeafNode and DishLeafNode.

Returns

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

Return type

(ResultCode, str)

Raises

DevFailed if error occurs while invoking command on CSPSubarrayLeafNode, SDpSubarrayLeafNode or DishLeafNode.

ObsResetCommand for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.obsreset_command.ObsResetCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s ObsReset() command.

do()

This command invokes ObsReset command on CspSubarrayLeafNode, SdpSubarrayLeafNode and DishLeafNode.

Returns

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

Return type

(ResultCode, str)

Raises

DevFailed if error occurs while invoking command on CspSubarrayLeafNode, SdpSubarrayLeafNode or DishLeafNode.

TrackCommand class for SubarrayNode.

class tmcprototype.subarraynode.src.subarraynode.track_command.TrackCommand(*args: Any, **kwargs: Any)

A class for SubarrayNode’s Track command.

check_allowed()

Checks whether this command is allowed to be run in current device state.

Returns

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

Return type

boolean

Raises

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

do(argin)

Invokes Track command on the Dishes assigned to the Subarray.

Parameters

argin – DevString

Example: radec|21:08:47.92|-88:57:22.9 as argin Argin to be provided is the Ra and Dec values where first value is tag that is radec, second value is Ra in Hr:Min:Sec, and third value is Dec in Deg:Min:Sec.

Returns

A tuple containing a return code and a string message indicating status.

The message is for information purpose only.

Return type

(ResultCode, str)