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, **kwargs)¶ Provides the monitoring and control interface required by users as well as other TM Components (such as OET, Central Node) for a Subarray.
-
class
AssignResourcesCommand(*args, **kwargs)¶ A class for SubarrayNode’s AssignResources() command.
-
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 Exception if command execution throws any type of exception DevFailed if the command execution is not successful
-
-
class
ConfigureCommand(*args, **kwargs)¶ 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
-
-
CspSubarrayFQDN¶ Used by autodoc_mock_imports.
-
CspSubarrayLNFQDN¶ Used by autodoc_mock_imports.
-
DishLeafNodePrefix¶ Used by autodoc_mock_imports.
-
class
EndCommand(*args, **kwargs)¶ 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: Exception if command execution throws any generic type of exception DevFailed if the command execution is not successful
-
-
class
EndScanCommand(*args, **kwargs)¶ 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: Exception if command execution throws any type of exception DevFailed if the command execution is not successful
-
-
class
InitCommand(*args, **kwargs)¶ 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
-
-
class
OffCommand(*args, **kwargs)¶ A class for the SubarrayNodes’s Off() command.
-
do()¶ Stateless hook for Off() command functionality.
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
-
-
class
OnCommand(*args, **kwargs)¶ A class for the SubarrayNode’s On() command.
-
do()¶ Stateless hook for On() command functionality.
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
-
-
class
ReleaseAllResourcesCommand(*args, **kwargs)¶ 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: Exception if command execution throws any type of exception DevFailed if the command execution is not successful
-
-
class
ScanCommand(*args, **kwargs)¶ A class for SubarrayNode’s 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: Exception if command execution throws any type of exception DevFailed if the command execution is not successful
-
-
SdpSubarrayFQDN¶ Used by autodoc_mock_imports.
-
SdpSubarrayLNFQDN¶ Used by autodoc_mock_imports.
-
Track(argin)¶ Invokes Track command on the Dishes assigned to the Subarray.
-
class
TrackCommand(*args, **kwargs)¶ A class for SubarrayNode’s Track command.
-
check_allowed()¶ 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)
-
-
activityMessage¶ Used by autodoc_mock_imports.
-
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’]
-
always_executed_hook()¶ Internal construct of TANGO.
-
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. Example: [‘PB1’, ‘PB2’] Returns: List of strings. 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.
-
calculate_observation_state()¶ Calculates aggregated observation state of Subarray.
-
call_end_scan_command()¶
-
call_stop_track_command()¶
-
command_class_object()¶ Sets up the command objects :return: None
-
create_csp_ln_proxy()¶ Creates proxy of CSP Subarray Leaf Node.
-
create_sdp_ln_proxy()¶ Creates proxy of SDP Subarray Leaf Node.
-
delete_device()¶ Internal construct of TANGO.
-
health_state_cb(event)¶ Retrieves the subscribed health states, aggregates them to calculate the overall subarray health state.
Parameters: evt – 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()¶ Whether this command is allowed to be run in current device state :return: True if this command is allowed to be run in
current device stateReturn 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. :param evt: A TANGO_CHANGE event on CSP and SDP Subarray obsState. :return: 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: evt – A TANGO_CHANGE event on SDP Subarray receiveAddresses attribute. Returns: None
-
receptorIDList¶ Used by autodoc_mock_imports.
-
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
-
remove_receptors_in_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
-
sbID¶ Used by autodoc_mock_imports.
-
scanID¶ Used by autodoc_mock_imports.
-
throw_exception(excpt_msg_list, read_actvity_msg)¶
-
validate_obs_state()¶
-
write_activityMessage(value)¶ Internal construct of TANGO. Sets the activityMessage.
-
class
-
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.