ska_tmc_dishleafnode.commands
Submodules
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.
- param argin:
None
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- rtype:
(ResultCode, str)
- stop_program_track_table() Tuple[ska_tango_base.commands.ResultCode, str]
- Method to invoke StopProgramTrackTable() when abort command is
invoked.
- rtype:
(ResultCode, str)
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_tango_base.executor.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
- do(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke ConfigureBand command on Dish Master.
param argin: str
- Returns:
(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 –
A String in a JSON format that includes pointing parameters of Dish- Azimuth and Elevation Angle.
Example: {“pointing”:{“target”:{“refrence_frame”:”ICRS”, “target_name”:”Polaris Australis”, “ra”:”21:08:47.92”, “dec”:”-88:57:22.9”}}, “dish”:{“receiver_band”:”1”}}
- Returns:
Resulcode and message
- Return type:
tuple
- Raises:
DevFailed If error occurs while invoking ConfigureBand<> command –
on DishMaster or –
if the json string contains invalid data. –
- ensure_dish_in_right_dish_mode(json_argument: dict)
This method set dish to Operate Mode
return: None
- 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 :param config_json: Configuration json :type config_json: dict :param reset_offset: Bool value :type reset_offset: bool :return: Offset list
- invoke_configure_band_on_dish(json_argument)
Invoke Configure band on Dish :param json_argument: Input json :type json_argument: dict
- invoke_generate_program_track_table(target_data: str)
Invoke Generate program track table on dish pointing device
- invoke_setopermode_command(json_argument: dict)
Invoke Set Operate mode command
- invoke_track_command(json_argument)
Invoke Track command on dish
- Returns:
None
- invoke_track_command_on_dish(json_argument)
Invoke Track command on dish
- invoke_trackloadstaticoff(input_json: dict, collimation_offsets: list) Tuple[ska_tango_base.commands.ResultCode, str]
Extracts the offsets from input json and invokes the TrackLoadStaticOff command on DishMaster device.
- Parameters:
input_json (dict) – Input json for Configure command
- Returns:
Tuple[ResultCode, str]
- is_tracktable_provided(json_argument)
Returns enum ACHIEVED if programTrackTable is provided to dish.
- set_failure_for_configure(message)
Set failure for configure
- start_dish_tracking(json_argument)
Invoke Track after waiting for DishMode to Operate
Args: None
return: None
- update_primary_configuration(new_configuration)
Update data provided in new configuration with primary configuration
- update_task_status(**kwargs) None
Method to update task status with result code and exception message if any.
- validate_json_argument(input_argin: dict) Tuple[ska_tango_base.commands.ResultCode, str]
Validates the json argument
- Returns:
Resulcode and message
- Return type:
tuple
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()
- 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.
- Returns:
True if the DishMode transitions to the correct state within the timeout period,False otherwise.
- Return type:
boolean
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_tango_base.executor.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
- 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)
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_tango_base.executor.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
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.
- param argin:
None
- Returns:
(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)
Method to invoke Scan command on Dish Master.
- param argin:
str
- Returns:
(ResultCode, str)
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_tango_base.executor.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
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 – Accepts input k value that is in range [1-2222]
- Dtype:
int
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- rtype:
(ResultCode, str)
setoperatemode
SetOperateMode command class for DishLeafNode.
- class ska_tmc_dishleafnode.commands.setoperatemode.SetOperateMode(*args: Any, **kwargs: Any)
Bases:
DishLNCommandA class for DishLeafNode’s SetOperateMode() command.
SetOperateMode invokes SetOperateMode command on Dish Master device.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke SetOperateMode command on DishMaster.
- param argin:
None
- Returns:
(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.
- param argin:
None
- Returns:
(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
- Returns:
: None
- Return type:
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.
- param argin:
None
- Returns:
(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
- Returns:
: None
- Return type:
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.
- param argin:
None
- Returns:
(ResultCode, str)
- set_stow_mode(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[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
task_abort_event (Event, optional) – Check for abort, defaults to None
- Returns:
: None
- Return type:
None
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.
param argin: dict
- Returns:
(ResultCode, str)
- validate_json_argument(input_argin: dict) tuple
Validates the json argument
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.
param argin: String containing cross elevation and elevation offsets
- Returns:
(ResultCode, str)
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_tango_base.executor.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
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: (ResultCode, str)
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_tango_base.executor.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. Example JSON: { “interface”: “https://schema.skao.int/ska-mid-cbf-initsysparam/1.0”, “tm_data_sources”: [“car://gitlab.com/ska-telescope/ska-tmc/ ska-tmc-simulators?main#tmdata”], “tm_data_filepath”: “instrument/ska_mid1/global_pointing_model_data/ global_pointing_model.json” }
param argin: Global pointing model data JSON
return:(ResultCode, str)
- get_global_pointing_data_json(initial_params: dict) 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, logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Event) 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
task_abort_event (Event, optional) – Check for abort, defaults to None
- Returns:
None
- Return type:
None