ska_tmc_cspsubarrayleafnode.commands package
Submodules
ska_tmc_cspsubarrayleafnode.commands.csp_subarray_leaf_node_command_command module
Command class for CSP Subarray Leaf Node
This module defines a command class CspSLNCommand for the CSPSubarrayLeafNode The CspSLNCommand class provides implementation for commands that interact with the CSP Subarray Leaf Node It includes methods for initializing adapters, checking device responsiveness, and handling commands for both low-level and mid-level devices.
- ska_tmc_cspsubarrayleafnode.commands.csp_subarray_leaf_node_command.LOGGER
The logger for the module.
- Type:
logging.Logger
- class ska_tmc_cspsubarrayleafnode.commands.csp_subarray_leaf_node_command.CspSLNCommand(*args: Any, **kwargs: Any)
Bases:
TmcLeafNodeCommand
Abstract command class for all CspSubarrayLeafNode
- do(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Handle a command.
- Parameters:
argin (str, optional) – Command argument. Defaults to None.
- Returns:
A tuple containing the result code and message.
- Return type:
Tuple[ResultCode, str]
- do_low(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Abstract Method from TmcLeafNodeCommand is defined here but not utilized by this Class. :param argin: Accepts argument if required. :type argin: _type_, optional :param Defaults to None.:
- do_mid(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Abstract Method from TmcLeafNodeCommand is defined here but not utilized by this Class. :param argin: Accepts argument if required. :type argin: _type_, optional :param Defaults to None.:
- init_adapter() Tuple[ska_tango_base.commands.ResultCode, str]
Creates adapter for underlying CSP subarray device.
- Returns:
A tuple containing the result code and message.
- Return type:
Tuple[ResultCode, str]
- init_adapter_low()
Initialize the adapter for the low-level device.
- init_adapter_mid()
Initialize the adapter for the low-level device.
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_control_model.task_status.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
ska_tmc_cspsubarrayleafnode.commands.assign_resources_command module
AssignResources command class for CspSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.assign_resources_command.AssignResources(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarayLeafNode’s AssignResources() command.
It accepts subarrayID and receptor IDs in JSON string format and invokes the AssignResources command on the CSP Subarray.
- do_low(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke the AssignResources command on the CSP low Subarray
- Parameters:
argin –
DevString. The string in JSON format. The JSON contains the following values: subarray_id: integer
Example: {“interface”: “https://schema.skao.int/ska-low-csp-assignresources/2.0”, “common”:{“subarray_id”:1},”lowcbf”:{“resources”: [{“device”:”fsp_01”, “shared”:true, “fw_image”:”pst”,”fw_mode”:”unused”}, {“device”:”p4_01”, “shared”:true,”fw_image”:”p4.bin”,”fw_mode”:”p4”}]},}
Note: Enter the JSON string without spaces as an input.
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
- Raises:
Exception – If the command execution is not successful.
- do_mid(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke AssignResources command on CSP Subarray.
- Parameters:
argin – DevString. The string in JSON format. The JSON contains the following values: - subarray_id: integer - dish: Mandatory JSON object consisting of receptor_ids, DevVarString The individual string should contain dish numbers in string format with preceding zeroes up to 3 digits. E.g. SKA001, SKA002. Example: { “interface”: “https://schema.skao.int/ska-mid-csp-assignresources/2.0”, “subarray_id”:1,”dish”:{“receptor_ids”:[“SKA001”,”SKA002”]}}
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
- Raises:
Exception – If the command execution is not successful.
- validate_json_argument(input_argin: dict[str, Any]) Tuple[ska_tango_base.commands.ResultCode, str]
Validates the JSON argument for the AssignResources command.
- Parameters:
input_argin (dict[str, Any]) – Input JSON argument as a dictionary.
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
- validate_json_argument_low(input_argin: dict[str, Any]) Tuple[ska_tango_base.commands.ResultCode, str]
Validates the JSON argument for the AssignResources command for CSP low.
- Parameters:
input_argin (dict[str, Any]) – Input JSON argument as a dictionary.
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
ska_tmc_cspsubarrayleafnode.commands.release_all_resources_command module
ReleaseAllResources command class for CSPSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.release_all_resources_command.ReleaseAllResources(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarayLeafNode’s ReleaseAllResources() command.
Releases all the resources of given CSP Subarray Leaf Node.
- do_low() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke ReleaseAllResources command on CSP Subarray.
- Parameters:
argin – DevString. The string in JSON format. Defaults to None.
- Returns:
(ResultCode, message)
- Raises:
Exception – if the command execution is not successful
- do_mid() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke ReleaseAllResources command on CSP Subarray.
- Parameters:
argin – DevString. The string in JSON format. Defaults to None.
- Returns:
(ResultCode, message)
- Raises:
Exception – if the command execution is not successful
ska_tmc_cspsubarrayleafnode.commands.configure_command module
Configure command class for CSPSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.configure_command.Configure(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarayLeafNode’s Configure() command.
It accepts CSP configuration in JSON string format and invokes Configure command on CSP Subarray.
- do_low(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Configure command on CSP low Subarray.
- Parameters:
argin – The string in JSON format. The JSON contains following values:
Example: {“interface”:”https://schema.skao.int/ska-low-csp-configure/3.2”, “common”:{“config_id”:”sbi-mvp01-20200325-00001-science_A”,”eb_id”: “eb-test-20220916-00000”},”lowcbf”:{“stations”:{“stns”:[[1,1],[2,1], [3,1],[4,1],[5,1],[6,1]],”stn_beams”:[{“beam_id”:1,”freq_ids”:[400], “delay_poly”:”low-tmc/subarray-leaf-node-csp/01/delayModel”}]}, “vis”:{“fsp”:{“firmware”:”vis”,”fsp_ids”:[1]},”stn_beams”:[ {“stn_beam_id”:1,”integration_ms”:849}]},”timing_beams”:{“fsp”: {“firmware”:”pst”,”fsp_ids”:[2]},”beams”:[{“pst_beam_id”:1,”field”: {“target_id”:”PSR J0024-7204R”,”reference_frame”:”icrs”,”attrs”: {“c1”:6.023625,”c2”:-72.08128333,”pm_c1”:4.8,”pm_c2”:-3.3}}, “stn_beam_id”:1,”stn_weights”:[0.9,1,1,1,0.9,1]}]}},”pst”:{“beams”: [{“beam_id”:1,”scan”:{“activation_time”:”2022-01-19T23:07:45Z”, “bits_per_sample”:32,”num_of_polarizations”:2,”udp_nsamp”:32, “wt_nsamp”:32,”udp_nchan”:24,”num_frequency_channels”:432, “centre_frequency”:200000000,”total_bandwidth”:1562500, “observation_mode”:”VOLTAGE_RECORDER”,”observer_id”:”jdoe”, “project_id”:”project1”,”pointing_id”:”pointing1”,”source”:”J1921+2153” ,”itrf”:[5109360.133,2006852.586,-3238948.127],”receiver_id”: “receiver3”,”feed_polarization”:”LIN”,”feed_handedness”:1,”feed_angle”: 1.234,”feed_tracking_mode”:”FA”,”feed_position_angle”:10, “oversampling_ratio”:[8,7],”coordinates”:{“equinox”:2000,”ra”: “19:21:44.815”,”dec”:”21:53:02.400”},”max_scan_length”:20000, “subint_duration”:30,”receptors”:[“receptor1”,”receptor2”], “receptor_weights”:[0.4,0.6],”num_channelization_stages”:2, “channelization_stages”:[{“num_filter_taps”:1,”filter_coefficients”: [1],”num_frequency_channels”:1024,”oversampling_ratio”:[32,27]}, {“num_filter_taps”:1,”filter_coefficients”:[1],”num_frequency_channels” :256,”oversampling_ratio”:[4,3]}]},”delay_poly”: “low-tmc/subarray-leaf-node-csp/01/delayModelPSTBeam1”, “jones”:”tango://jones.skao.int/low/stn-beam/1”}]}}
Note: Enter the json string without spaces as a input. :type argin: str
- Returns:
(ResultCode, message)
- do_mid(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Configure command on CSP Subarray.
- Parameters:
argin – The string in JSON format. The JSON contains following values:
Example: {“interface”:”https://schema.skao.int/ska-csp-configure/2.0”, “subarray”:{“subarray_name”:”science period 23”},”common”: {“config_id”:”sbi-mvp01-20200325-00001-science_A”,”frequency_band”: “1”,”subarray_id”:”1”},”cbf”:{“delay_model_subscription_point”: “mid-tmc/subarray-leaf-node-csp/01/delayModel”,”fsp”:[{“fsp_id”:1, “function_mode”:”CORR”,”frequency_slice_id”:1,”integration_factor”:1, “zoom_factor”:0,”channel_averaging_map”:[[0,2],[744,0]], “channel_offset”:0,”output_link_map”:[[0,0],[200,1]],},{“fsp_id”:2, “function_mode”:”CORR”,”frequency_slice_id”:2,”integration_factor”:1, “zoom_factor”:1,”zoom_window_tuning”:650000,”channel_averaging_map”: [[0,2],[744,0]],”channel_offset”:744,”output_link_map”:[[0,4], [200,5]],”output_host”:[[0,”192.168.1.1”]],”output_port”: [[0,9744,1]]}],”vlbi”:{}},”pss”:{},”pst”:{},”pointing”:{“target”: {“reference_frame”:”ICRS”,”target_name”:”Polaris Australis”, “ra”:”21:08:47.92”,”dec”:”-88:57:22.9”}}}
- Returns:
(ResultCode, message)
- Raises:
Exception – if the command execution is not successful
DevFailed if the command execution is not successful –
ValueError if input argument json string contains invalid value –
- load_low_configure_json(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
Method loads low configure json.
- Parameters:
argin (str) – Input JSON string
- Returns:
Tuple[ResultCode, str]: result code and message
- start_delay(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
A method to start delay thread and starts generating delay polynomials.
- Parameters:
argin (str) – Input JSON string
- Returns:
Tuple[ResultCode, str]: result code and message
- update_station_ids(argin_json: dict) Tuple[ska_tango_base.commands.ResultCode, str]
Method to extract station IDs from MCCS apertures and update station IDs from component manager.
- Parameters:
argin (dict) – MCCS configuration dict
- Returns:
Tuple[ResultCode, str]: result code and message
ska_tmc_cspsubarrayleafnode.commands.end_command module
End command class for CSPSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.end_command.End(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarayLeafNode’s End() command.
It invokes End command on CSP Subarray.
- do_low() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke End command on CSP Subarray.
- Parameters:
argin – None.
- Returns:
(ResultCode, message)
- Raises:
Exception – if the command execution is not successful
- do_mid() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke End command on CSP Subarray.
- Parameters:
argin – None.
- Returns:
(ResultCode, message)
- Raises:
Exception – if the command execution is not successful
- reset_delay_model_values(delay_json: dict)
Method to reset delayModel attribute value to empty delayModel json :param delay_json: delay json :type delay_json: dict
ska_tmc_cspsubarrayleafnode.commands.scan_command module
Scan command class for CspSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.scan_command.Scan(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarrayLeafNode’s Scan() command. Scan command is inherited from CspSLNCommand.
This command invokes Scan command on CSP Subarray.
- do_low(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Scan command on CSP Low Subarray.
- Parameters:
argin – JSON string consists of scan id (int).
Example: {“common”:{“subarray_id”:1},”lowcbf”:{“scan_id”:987654321, “scan_seconds”:30}}
Note: Enter the json string without spaces as a input.
- Returns:
(ResultCode, message)
- do_mid(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Scan command on CSP Mid Subarray.
- Parameters:
argin – JSON string consists of scan id (int).
Example: {“interface”:”https://schema.skao.int/ska-mid-csp-scan/2.0”, “scan_id”:1}
Note: Enter the json string without spaces as a input.
- Returns:
(ResultCode, message)
- validate_json_argument(input_argin: str) tuple
Validates the json argument
- validate_json_argument_low(input_argin: dict) tuple
Validates the json argument for low
ska_tmc_cspsubarrayleafnode.commands.end_scan_command module
EndScan command class for CspSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.end_scan_command.EndScan(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarrayLeafNode’s EndScan() command.
It invokes EndScan command on CSP Subarray. This command is allowed when CSP Subarray is in obsState SCANNING.
- do_low() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke EndScan command on CSP Low Subarray.
- Parameters:
argin (String) – Json input string, defaults to None
- Returns:
(ResultCode, message)
- do_mid() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke EndScan command on CSP Mid Subarray.
- Parameters:
argin (String) – Json input string, defaults to None
- Returns:
(ResultCode, message)
ska_tmc_cspsubarrayleafnode.commands.abort_command module
Abort Command for CspSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.abort_command.Abort(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarrayLeafNode’s Abort() command. Aborts the CSP Subarray device.
- do()
This method invokes Abort command on CSP Subarray
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- rtype:
(ResultCode, str)
- Raises:
Exception if error occurs in invoking command –
on any of the devices like CspSubarrayLeafNode –
- invoke_abort()
This method calls do for Abort command
- reset_delay_model_values()
Method to reset delayModel attribute value to empty delayModel json
:param None :return None
ska_tmc_cspsubarrayleafnode.commands.restart_command module
Restart command class for CspSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.restart_command.Restart(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
A class for CspSubarrayLeafNode’s Restart command. Restarts the CSP Subarray device.
- do() tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Restart command on CSP Subarray.
- Parameters:
None –
Note: Enter the json string without spaces as a input.
- Returns:
(ResultCode, message)
- restart(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
This is a long running method for a Restart command, it executes do hook, invokes Restart command on CspSubarray.
- Parameters:
argin (str) – Input JSON string
logger (logging.Logger) – logger
task_callback (TaskCallbackType) – Update task state, defaults to None
task_abort_event (Event, optional) – Check for abort, defaults to None
ska_tmc_cspsubarrayleafnode.commands.set_csp_subarray_admin_mode module
SetAdminMode command class for CSPSubarrayLeafNode.
- class ska_tmc_cspsubarrayleafnode.commands.set_csp_subarray_admin_mode.SetAdminMode(*args: Any, **kwargs: Any)
Bases:
CspSLNCommand
,FastCommand
A class for CspSubarrayLeafNode’s SetAdminMode() command.
SetAdminMode command on CspSubarrayLeafNode enables to set the adminMode of the csp subarray device
- do(argin: ska_control_model.AdminMode) Tuple[ska_tango_base.commands.ResultCode, str]
A method to set the adminMode of the CSP Subarray device :param argin: A adminMode enum value to be set for subarray device