ska_tmc_dishleafnode.commands
Link to the TMC User documentation is here <https://confluence.skatelescope.org/display/UD/TMC+User+Documentation>_.
abort_command
Abort command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.abort_command.Abort(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishLeafNode’s Abort() command. Command to abort the Dish Master and bring it to its ABORTED state.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Invokes Abort command on the DishMaster.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Return type:
Tuple[ResultCode, str]
- invoke_abort(task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs)
Invoke Abort on Dish Master and track its completion. :param task_callback: A callback function to update the status :param of the task.: :param task_abort_event: An event to signal task abortion.
- stop_program_track_table() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke StopProgramTrackTable() when abort command is invoked.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_control_model.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
configure_band_command
ConfigureBand command class for Dishleafnode.
- class ska_tmc_dishleafnode.commands.configure_band_command.ConfigureBand(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for Dishleafnode’s ConfigureBand command. ConfigureBand command is inherited from DishLNCommand.
This command takes band as an input argument and invokes respective ConfigureBand{band} command on Dish Master
- configure_band(argin: str, task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for ConfigureBand command, it executes the do hook, invoking ConfigureBand command on Dish Master
- Parameters:
argin (str) – string containing band to be configured
- Returns:
: (ResultCode, str)
- Return type:
Tuple
- do(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke ConfigureBand command on Dish Master.
- Parameters:
argin (str) – Input Argument.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
configure_command
Configure class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.configure_command.Configure(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishLeafNode’s Configure command.
Configures the Dish by setting pointing coordinates for a given scan. This function accepts the input json and calculate pointing parameters of Dish- Azimuth and Elevation Angle. Calculated parameters are again converted to json and fed to the dish master.
- do(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Configure command on dish.
- Parameters:
argin (str) – A String in a JSON format that includes pointing parameters of Dish- Azimuth and Elevation Angle.
Example JSON for Configure{ "interface": "https://schema.skao.int/ska-tmc-configure/2.1", "transaction_id": "txn-....-00002", "layout_data" : { "interface": "https://schema.skao.int/ska-telmodel-layout-receptor/1.1", "diameter": 15.0, "location": {"interface": "https://schema.skao.int/ska-telmodel-layout-location/1.0", "geocentric": {"interface": "https://schema.skao.int/ska-telmodel-layout-geocentric/1.0", "coordinate_frame": "ITRF", "x": 5109058.062517257, "y": 2007302.435599506, "z": -3239167.000445203}, "geodetic": {"interface": "https://schema.skao.int/ska-telmodel-layout-geodetic/1.0", "coordinate_frame": "WGS84", "lat": -30.71329, "lon": 21.449412, "h": 1098.074}}, "fixed_delays": [{"interface": "https://schema.skao.int/ska-telmodel-layout-receptor-fixed-delay/0.0", "fixed_delay_id": "FIX_H", "polarisation": 0, "units": "m", "delay": 0.0}, {"interface": "https://schema.skao.int/ska-telmodel-layout-receptor-fixed-delay/0.0", "fixed_delay_id": "FIX_V", "polarisation": 0, "units": "m", "delay": 0.0}], "niao": 0.0, "station_label": "SKA001", "station_id": 65}, "pointing": { "target": { "reference_frame": "ICRS", "target_name": "Polaris Australis", "ra": "21:08:47.92", "dec": "-88:57:22.9" }, "correction": "UPDATE" }, "dish": { "receiver_band": "2" }, "tmc": { "scan_duration": 300 } }
Note
Enter input json without spaces.
- Returns:
Resultcode and message
- Return type:
Tuple[ResultCode, str]
- Raises:
DevFailed – If error occurs while invoking ConfigureBand<> command on DishMaster or if the json string contains invalid data.
- get_ie_ca_offsets_if_provided(config_json: dict, reset_offset: bool) list
This check if ca_offset_arcsec or ie_offset_arcsec provided in config json and return offsets
- Parameters:
config_json (dict) – Configuration json
reset_offset (bool) – Bool value
include_trajectory_offsets (bool) – whether trajectory based offsets (x, y) should be considered.
- Returns:
Offset list
- invoke_configure(argin: str, task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for Configure command, it executes do hook, invokes Configure command on Dish Master.
- Parameters:
argin (str) – Input JSON string
- Returns:
: (ResultCode, str)
- Return type:
Tuple
- invoke_configure_band_on_dish(json_argument) Tuple[ska_tango_base.commands.ResultCode, str]
Invoke Configure band on Dish
- Parameters:
json_argument (dict) – Input json
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- invoke_generate_program_track_table(target_data: str) Tuple[ska_tango_base.commands.ResultCode, str]
Invoke Generate program track table on dish pointing device
- Parameters:
target_data (str) – targetData
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- invoke_track_command(json_argument: dict)
Invoke Track command on dish
- Parameters:
json_argument (dict) – json argument.
- invoke_track_command_on_dish(json_argument: dict)
Invoke Track command on dish
- Parameters:
json_argument (dict) – json argument for invoking track command.
- is_tracktable_provided(json_argument: str) CommandResult
Returns enum ACHIEVED if programTrackTable is provided to dish.
- Parameters:
json_argument (str) – json argument.
- Returns:
Enum ACHIEVED if programTrackTable is provided to dish, NOT_ACHIEVED if it is not provided and ABORTED if Abort() is called while configuring dish.
- Return type:
CommandResult
- normalise_pointing_data(config_json: dict) dict
Normalise configure JSON to support both old and ADR-63 formats.
Converts legacy offsets
ca_offset_arcsec/ie_offset_arcsectopointing.trajectory.attrs.x/ywhen trajectory offsets are not already present.
- Parameters:
config_json (dict) – Input configure JSON as dictionary.
- Returns:
Normalised configure JSON.
- Return type:
dict
- start_dish_tracking(json_argument: dict)
Invoke Track after waiting for DishMode to Operate
- Parameters:
json_argument (dict) – json argument.
- update_primary_configuration(new_configuration: dict)
Update data provided in new configuration with primary configuration
- Parameters:
new_configuration (dict) – json argument in dict format for updating primary configuration.
- update_task_status(**kwargs) None
Method to update task status with result code and exception message if any.
- Parameters:
kwargs –
Keyword arguments. Specifically:
result
status
exception/message
- validate_json_argument(input_argin: dict) Tuple[ska_tango_base.commands.ResultCode, str]
Validates the json argument
- Parameters:
input_argin (dict) – input json to be validated.
- Returns:
Resultcode and message.
- Return type:
Tuple[ResultCode, str]
dish_ln_command
This module provides base command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.dish_ln_command.DishLNCommand(*args: Any, **kwargs: Any)
Bases:
TmcLeafNodeCommandA base command class for DishLeafNode with the methods and parameters common across all the commands.
- init_adapter()
Creates adapter for underlying Dish device.
- init_adapter_mid()
- is_abort_flag_set() bool
Check if the abort flag is set.
- Returns:
True if the abort flag is set, False otherwise.
- Return type:
bool
- set_command_id(command_name: str)
Sets the command id for error propagation.
- Parameters:
command_name (str) – Name of the command
- set_wait_for_dishmode(dishmode: ska_tmc_common.DishMode) str
Waits for transition of DishMode to the correct state.
- Parameters:
dishmode (DishMode) – DishMode value to wait for.
- Returns:
ACHIEVED if the DishMode transitions to the correct state within the timeout period, NOT_ACHIEVED if it doest not transition within timeout or ABORTED if abort cammand is called while execution.
- Return type:
str
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_control_model.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
- wait_for_completion(state_getter: Optional[Callable[[], bool]] = None, desired_state: bool = True, device_length: int = 1, check_abort: bool = True) Tuple[ska_tango_base.commands.ResultCode, str]
Wait for command completion using CommandCompletionTracker :param state_getter: Function to get the :type state_getter: Callable[[], bool] :param current state: :param desired_state: Expected observation state after :type desired_state: ObsState :param command execution: :param device_length: Number of devices to wait for completion :type device_length: int :param (default is 1): :param check_abort: Whether to check for abort signal :type check_abort: bool
- Returns:
Final result code and corresponding message
- Return type:
Tuple[ResultCode, str]
- ska_tmc_dishleafnode.commands.dish_ln_command.task_callback_default(**kwargs) None
Default method if the taskcallback is not passed
- Parameters:
status – status of the task.
progress – progress of the task.
result – result of the task.
exception – an exception raised from the task.
endscan_command
EndScan command class for Dishleafnode.
- class ska_tmc_dishleafnode.commands.endscan_command.EndScan(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for Dishleafnode’s EndScan command. EndScan command is inherited from DishLNCommand.
This command sets scanID attribute of Dish Master to empty string.
- do()
Method to set scanID attribute of Dish Master to empty string.
- Returns:
(ResultCode, str)
- endscan(task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs) Tuple[ska_tango_base.commands.ResultCode, str]
This is a method for long running command EndScan command, it executes the do hook, to set scanID attribute of Dish Master to empty string.
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
off_command
On command class for Dishleafnode.
- class ska_tmc_dishleafnode.commands.off_command.Off(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for Dishleafnode’s Off command. Off command is inherited from DishLNCommand.
This command invokes off command on Dish Master
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Invokes StandbyFP and StandbyLP mode commands on dish master device after waiting for correct dish modes. First invokes and waits for completion of SetStandbyFPMode command, then invokes and waits for completion of SetStandbyLPMode command.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- invoke_off(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
A method to invoke the Off command. It sets the task_callback status according to command progress.
- Parameters:
argin (str) – Input JSON string
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state, defaults to None
task_abort_event (Event, optional) – Check for abort, defaults to None
- Returns:
None
- Return type:
None
scan_command
Scan command class for Dishleafnode.
- class ska_tmc_dishleafnode.commands.scan_command.Scan(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for Dishleafnode’s Scan command. Scan command is inherited from DishLNCommand.
This command invokes Scan command on Dish Master
- do(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Scan command on Dish Master.
- Parameters:
argin (str) – json string for Scan command.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- scan(argin: str, task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for Scan command, it executes the do hook, invoking Scan command on Dish Master
- Parameters:
argin (str) – Input JSON string
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
set_kvalue
SetKValue command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.set_kvalue.SetKValue(*args: Any, **kwargs: Any)
Bases:
DishLNCommand,FastCommandA class for DishLeafNode’s SetKValue() command. Command to set k value the Dish Master. k value specifies an offset in sample rate. The sample rate for each Band is calculated based on k value
- do(argin: int) Tuple[ska_tango_base.commands.ResultCode, str]
Invokes SetKValue command on the DishMaster.
- Parameters:
argin (int) – Accepts input k value that is in range [1-2222].
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Return type:
Tuple[ResultCode, str]
setstandbyfpmode
SetStandbyFPMode command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.setstandbyfpmode.SetStandbyFPMode(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishLeafNode’s SetStandbyFPMode() command.
Invokes SetStandbyFPMode (i.e. Full Power State) command on DishMaster.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke SetStandbyFPMode command on DishMaster.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- set_standby_fp_mode(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
A method to invoke the SetStandbyFPMode command. It sets the task_callback status according to command progress.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state, defaults to None
task_abort_event (Event, optional) – Check for abort, defaults to None
setstandbylpmode
SetStandbyLPMode command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.setstandbylpmode.SetStandbyLPMode(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishLeafNode’s SetStandbyLPMode() command.
Invokes SetStandbyLPMode (i.e. Low Power State) command on DishMaster.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke SetStandbyLPMode (Low power mode) command on DishMaster.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- set_standby_lp_mode(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None)
A method to invoke the SetStandbyLPMode command. It sets the task_callback status according to command progress.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state, defaults to None
task_abort_event (Event, optional) – Check for abort, defaults to None
setstowmode
SetStowMode command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.setstowmode.SetStowMode(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishleafNode’s SetStowMode() command.
SetStowMode command on DishLeafNode enables the telescope to perform further operations and observations. It Invokes SetStowMode command on Dish Leaf Node device.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke SetStowMode command on DishMaster.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- invoke_set_stow_mode(task_callback: ska_tango_base.base.TaskCallbackType = <function task_callback_default>, task_abort_event: ~typing.Optional[~threading.Event] = None)
A method to invoke the SetStowMode command. It sets the task_callback status according to command progress.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state, defaults to None
- stop_program_track_table() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke StopProgramTrackTable() when abort command is invoked.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_control_model.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
- class ska_tmc_dishleafnode.commands.setstowmode.StowCommand(*args: Any, **kwargs: Any)
Bases:
SlowCommandA class for stow command.
- do(*args, **kwargs) tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for Abort() command functionality.
- Parameters:
args – positional arguments to the command. This command does not take any, so this should be empty.
kwargs – keyword arguments to the command. This command does not take any, so this should be empty.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
track_command
Track command class for Dishleafnode.
- class ska_tmc_dishleafnode.commands.track_command.Track(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for Dishleafnode’s Track command. Track command is inherited from DishLNCommand.
This command invokes Track command on Dish Master
- do(argin: dict) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Track command on Dish Master.
- Parameters:
argin (dict) – Optional argument
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- track(argin: dict, task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for Track command, it executes the do hook, invoking Track command on Dish Master
- Parameters:
argin (dict) – Input JSON string
- Returns:
: (ResultCode, str)
- Return type:
Tuple
- validate_json_argument(input_argin: dict) tuple
Validates the json argument
- Parameters:
input_argin (dict) – input json to be validated.
- Returns:
Tuple of ResultCode and message.
- Return type:
tuple
track_load_static_off_command
TrackLoadStaticOff command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.track_load_static_off_command.TrackLoadStaticOff(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishLeafNode’s TrackLoadStaticOff() command.
This command is invoked as a part of the Configure sequence of a 5 point calibration scan. It is used to set the cross elevation and elevation offsets provided in the partial configurations on the Dish Master Device.
- do(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke TrackLoadStaticOff command on DishMaster.
- Parameters:
argin (str) – String containing cross elevation and elevation offsets.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- invoke_track_load_static_off(argin: str, task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs) Tuple[ska_tango_base.commands.ResultCode, str]
A method to invoke the do method of the TrackLoadStaticOff command class. This method also updates the task callback according to command status.
- Parameters:
argin (str) – Input argument containing the cross elevation and elevation offsets.
- Returns:
: (ResultCode, str)
- Return type:
Tuple
trackstop_command
TrackStop command class for Dishleafnode.
- class ska_tmc_dishleafnode.commands.trackstop_command.TrackStop(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for Dishleafnode’s TrackStop command. TrackStop command is inherited from DishLNCommand.
This command invokes TrackStop command on Dish Master
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke TrackStop command on Dish Master.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- trackstop(task_callback: Optional[Callable] = None, task_abort_event: Optional[object] = None, **kwargs) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for TrackStop command, it executes the do hook, invoking TrackStop command on Dish Master
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_control_model.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
apply_pointing_model_command
ApplyPointingModel command class for DishLeafNode.
This module contains the implementation of the ApplyPointingModel command for the DishLeafNode component. It provides functionality to apply a pointing model to the dish based on the provided TelModel URI.
- class ska_tmc_dishleafnode.commands.apply_pointing_model.ApplyPointingModel(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishLeafNode’s ApplyPointingModel() command. Its a dummy command at present. Will be renamed, once Dish ICD gets updated.
This command provides an interface to provide global pointing data to the dish. This command takes TelModel URI as an input, downloads the JSON file for the given version, does validations and passes the JSON to its respective dish.
- do(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke ApplyPointingModel command on DishMaster.
- Parameters:
argin (str) – Global pointing model data JSON
Example JSON for ApplyPointingModel{ "interface": "https://schema.skao.int/ska-mid-cbf-initsysparam/1.0", "tm_data_sources": ["car://gitlab.com/ska-telescope/ska-tmc/ska-tmc-simulators?1.9.7#tmdata"], "tm_data_filepath": "instrument/ska_mid1/global_pointing_model_data/gpm-ska001-Band_1.json" }
Note
Enter input json without spaces.
- Returns:
Tuple of ResultCode and message.
- Return type:
Tuple[ResultCode, str]
- extract_band_and_version(gpm_data: dict) Tuple[str, str]
Extract the band and version from the GPM metadata JSON.
- Parameters:
gpm_data (dict) – The parsed GPM metadata JSON.
path (Expected to contain keys for the file) –
interface (and the) –
- Returns:
- A tuple containing:
band (str): The band extracted from the file path.
version (str): The version extracted from the interface.
- Return type:
Tuple[str, str]
- get_global_pointing_data_json(tm_data_sources, tm_data_filepath) Tuple[dict, str]
Get global pointing data json from initial params with a timeout. This method downloads the JSON, from the given TelModel path.
- Parameters:
initial_param – contains tm data source URI and file path used to get the global pointing data.
- Returns:
dictionary in downloaded JSON and message string if any
- Return type:
Tuple[dict, str]
- invoke_apply_pointing_model(argin: str, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
A method to invoke the do method of the ApplyPointingModel command class. This method also updates the task callback according to command status.
- Parameters:
argin (str) – Input argument containing the TelModel JSON URI
logger (logging.Logger) – logger
task_callback (TaskCallbackType) – Update task state, defaults to None
- Returns:
None
- Return type:
None
- update_task_callback(result_code: ska_tango_base.commands.ResultCode, message: str, task_callback: ska_tango_base.base.TaskCallbackType) None
Updates task status and GPM version based on command result.
- Parameters:
result_code (ResultCode) – Command result status code
message (str) – Status description
task_callback (TaskCallbackType) – Callback for task status updates