ska_tmc_dishleafnode.manager

Submodules

component_manager

This module provides an implementation of the Dish Leaf Node ComponentManager.

class ska_tmc_dishleafnode.manager.component_manager.DishLNComponentManager(*args: Any, **kwargs: Any)

Bases: TmcLeafNodeComponentManager

A component manager for The Dish Leaf Node component.

property actual_pointing: list

Returns the actualPointing of the dish device.

check_device_responsive() None

Checks if dish master device is responsive.

property command_in_progress: str

Method to get value of current command in progress

return: command in progress variable data rtype: str

configure(argin: str, task_callback: ska_tango_base.base.TaskCallbackType) tuple

Submit the Configure command in queue.

Returns:

a result code and message

Return type:

Tuple

convert_timestamp(timestamp_milliseconds: float) str

Converts the floating point timestamp in milliseconds to a utc timestamp with format -> %Y-%m-%d %H:%M:%S

Parameters:

timestamp_milliseconds (float) – Input timestamp with time in milliseconds

Returns:

Timestamp in string with format “%Y-%m-%d %H:%M:%S”.

Return type:

string

property dishConfiguredBand: str

Returns the dishConfiguredBand of dish device

property dishMode: ska_tmc_common.DishMode

Returns the dishMode of dish master device

async download_iers_data() None

Downloads and initialises the IERS file. Incase of error with main link, tries downloading using Mirror link.

Returns:

None

Return type:

None

property elevation_limit: bool

Returns the True if dish is within its mechanical limit.

Returns:

True if the dish is within its mechanical elevation limit, False otherwise.

Return type:

boolean

endscan(task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the EndScan command for execution.

Parameters:

task_callback – Callback function to handle task status.

Type:

TaskCallbackType

Return type:

Tuple

get_device() ska_tmc_common.DishDeviceInfo

Return the device info of the monitoring loop with name dev_name

Returns:

a device info

Return type:

DishDeviceInfo

is_abortcommands_allowed() bool

Checks whether this command is allowed It checks that the device is in the right state to execute this command and that all the component needed for the operation are not unresponsive

Returns:

True if this command is allowed

Return type:

boolean

is_configure_allowed() bool

Checks if the given command is allowed in current operational state.

Returns:

True if the command is allowed in the current operational state, False otherwise.

Return type:

boolean

is_endscan_allowed() Union[bool, ska_tmc_common.CommandNotAllowed, ska_tmc_common.DeviceUnresponsive]

Checks if the given command is allowed in current operational state.

Returns:

True if this command is allowed to be run in current dish mode, raises CommandNotAllowed in case is is not allowed and DeviceUnresponsive in case Device is not responsive.

Return type:

Union[bool, CommandNotAllowed, DeviceUnresponsive]

is_off_allowed() bool

Checks if the given command is allowed in current operational state.

Returns:

True if the command is allowed in the current operational state, False otherwise.

Return type:

boolean

is_scan_allowed() Union[bool, ska_tmc_common.CommandNotAllowed, ska_tmc_common.DeviceUnresponsive]

Checks if the given command is allowed in current operational state.

Returns:

True if this command is allowed to be run in current dish mode, raises CommandNotAllowed in case is is not allowed and DeviceUnresponsive in case Device is not responsive.

Return type:

Union[bool, CommandNotAllowed, DeviceUnresponsive]

is_set_kvalue_allowed() bool

Checks whether this command is allowed It checks that the device is responsive before invoking command.

Returns:

True if this command is allowed

Return type:

boolean

is_setoperatemode_allowed() bool

Checks if the given command is allowed in current operational state.

Returns:

True if the command is allowed in the current operational state, False otherwise.

Return type:

boolean

is_setstandbyfpmode_allowed() bool

Checks if the given command is allowed in current operational state.

Return type:

boolean

is_setstandbylpmode_allowed() bool

Checks if the given command is allowed in current operational state.

Return type:

boolean

is_setstowmode_allowed() bool

Checks if the given command is allowed in current operational state.

Returns:

True if the command is allowed in the current operational state, False otherwise.

Return type:

boolean

is_track_allowed() bool

Checks if the given command is allowed in current operational state.

Returns:

True if the command is allowed in the current operational state, False otherwise.

Return type:

boolean

is_trackloadstaticoff_allowed() bool

Checks if the command TrackLoadStaticOff is allowed.

Returns:

True if the command ‘TrackLoadStaticOff’ is allowed, False otherwise.

Return type:

boolean

is_trackstop_allowed() bool

Checks if the given command is allowed in current operational state.

Returns:

True if the command is allowed in the current operational state, False otherwise.

Return type:

boolean

property kValue: int

Returns the k-value

property kValueValidationResult: int

Returns the k-value validation result

Returns:

The k-value validation result

Return type:

int

off(task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the Off command for execution.

Return type:

Tuple

perform_reverse_transform(value_list)

Performs the reverse transform and publishes it on the actualPointing attribute.

Parameters:

value_list ((List[float])) – A list containing timestamp in milliseconds,azimuth, and elevation.

Returns:

None

Return type:

None

property pointingState: ska_tmc_common.PointingState

Returns the pointingState of dish master device

process_actual_pointing() None

Process the achieved pointing data to calculate actual pointing.

Returns:

None

Return type:

None

program_track_table_calculator(ra_value: str, dec_value: str, azel_converter) None

This method calculates one set on timestamp, Az and El.

Parameters:
  • (str) (dec_value) – RA value in hours:minutes:sec

  • (str) – Dec Value in degree:arc_minutes:arc_sec

Returns:

None

async run_init_threads() None

Await for the completion of beolw tasks

scan(argin: str, task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the Scan command for execution.

Parameters:
  • argin – JSON string containing offsets in the form of param.

  • task_callback – Callback function to handle task status.

Type:

str

Type:

TaskCallbackType

Returns:

A tuple containing TaskStatus and a message string.

Return type:

Tuple

set_dish_id(dish_master_fqdn: str) None

Find out dish number from DishMasterFQDN property e.g. ska001/elt/master

setoperatemode(task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the SetOperateMode command for execution.

Parameters:

task_callback – Callback function to handle task status.

Type:

TaskCallbackType

Returns:

A tuple containing TaskStatus and a message string.

Return type:

Tuple

setstandbyfpmode(task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Initializes the attributes and properties of the DishLeafNode.

Returns:

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

setstandbylpmode(task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the SetStandbyLPMode command for execution.

Parameters:

task_callback – Callback function to handle task status.

Type:

TaskCallbackType

Returns:

A tuple containing TaskStatus and a message string.

Return type:

Tuple

setstowmode(task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the SetStowMode command for execution.

Parameters:

task_callback – Callback function to handle task status.

Type:

TaskCallbackType

Returns:

A tuple containing TaskStatus and a message string.

Return type:

Tuple

start_init_operations() None

This method assures proper execution of kvalue validation and iers data download.

stop_event_receiver() None

Stops the Event Receiver

Returns:

None

stop_executors_and_cleanup_memory() None

Method to clean up the code, stop running threads/sub-processes

Returns:

None

Return type:

None

track(argin: str, task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the Track command for execution.

Parameters:
  • argin – JSON string containing offsets in the form of param.

  • task_callback – Callback function to handle task status.

Type:

str

Type:

TaskCallbackType

Returns:

A tuple containing TaskStatus and a message string.

Return type:

Tuple

track_load_static_off(argin: str, task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the TrackLoadStaticOff command for execution

Parameters:

argin – JSON string containing offsets in the form of param.

Type:

str

Task_callback:

Callback function to handle task status.

Type:

TaskCallbackType

Returns:

A tuple containing TaskStatus and a message string.

Return type:

Tuple

track_thread(ra_value: str, dec_value: str, command_obj: ska_tmc_dishleafnode.commands.configure_command.Configure | ska_tmc_dishleafnode.commands.track_command.Track) None

This method manages calculation and writing of programTrackTable attribute on DishMaster at the rate of 20 Hz.

Parameters:
  • (str) (dec_value) – RA value in hours:minutes:sec

  • (str) – Dec Value in degree:arc_minutes:arc_sec

  • command_obj – Command Object which is used to set desired_pointing

Returns:

None

trackstop(task_callback: ska_tango_base.base.TaskCallbackType) Tuple[ska_tango_base.executor.TaskStatus, str]

Submits the TrackStop command for execution.

Parameters:

task_callback – Callback function to handle task status.

Type:

TaskCallbackType

Returns:

A tuple containing TaskStatus and a message string.

Return type:

Tuple

update_device_configured_band(configured_band: ska_tmc_common.Band) None

Update the configured band of the given dish and call the relative callbacks if available.

Parameters:

configured_band (Band) – Configured band of the dish device

update_device_dish_mode(dish_mode: ska_tmc_common.DishMode) None

Update the dish mode of the given dish and call the relative callbacks if available.

Parameters:

dishMode (DishMode) – Dish mode of the device

update_device_long_running_command_status(lrc_status: Tuple[List[str], List[str]]) None

Method to update task callback based on long running command status event data.

Parameters:

lrc_status – longRunningCommandStatus attribute event data

Type:

(Tuple[List[str], List[str]])

update_device_ping_failure(device_info: ska_tmc_common.DeviceInfo, exception: str) None

Set a device to failed and call the relative callback if available

Parameters:
  • device_info (DeviceInfo) – a device info

  • exception – an exception

Type:

Exception

Return type:

None

update_device_pointing_state(pointingState: ska_tmc_common.PointingState) None

Update the pointing state of the given dish and call the relative callbacks if available.

Parameters:

pointingState (PointingState) – Pointing state of the dish device

Returns:

None

Return type:

None

async update_kvalue_validation_result() None

This method informs the k-value validation result to central node after DLN start/restart.

Returns:

None

Return type:

None

update_ping_info(ping: int, device_name: str) None

Update a device with the correct ping information.

Parameters:
  • dev_name (str) – name of the device

  • ping (int) – device response time

Return type:

None

update_program_track_table() None

Write the programTrackTable attribute on dish master device.

dish_kvalue_validation_manager

Class for managing dish kvalue validation during initialization/restart of device

class ska_tmc_dishleafnode.manager.dish_kvalue_validation_manager.DishkValueValidationManager(component_manager, logger)

Bases: object

Class for dish kValue validation during dish leaf node initialization/restart

get_dish_ln_memorized_kvalue() int

Return memorized kvalue dish leaf node :return: int

get_dish_manager_kvalue() int

Get kValue attribute value of dish manager :return: int

is_dish_manager_ready() bool

Wait and check if dish manager is ready :return: bool

validate_dish_kvalue() None

Validate kvalue of dish leaf node and dish manager :return: None

event_receiver

Event Receiver for Dish Leaf Node

class ska_tmc_dishleafnode.manager.event_receiver.DishLNEventReceiver(*args: Any, **kwargs: Any)

Bases: EventReceiver

The DishLNEventReceiver class has the responsibility to receive events from the dish master managed by the Dish Leaf Node.

The ComponentManager uses to handle events methods for the attribute of interest. For each of them a callback is defined.

handle_achieved_pointing_event(event_flag: tango.EventData) None

Method to handle and update the latest value of achievedPointing attribute.

Parameters:
  • event_flag (tango.EventData) – to flag the

  • event. (change in) –

return: None rtype: None

handle_configured_band_event(event_flag: tango.EventData) None

Method to handle and update the latest value of configuredBand attribute.

Parameters:
  • event_flag (tango.EventData) – to flag the

  • event. (change in) –

return: None rtype: None

handle_dish_mode_event(event_flag: tango.EventData) None

Method to handle and update the latest value of dishMode attribute.

Parameters:
  • event_flag (tango.EventType.CHANGE_EVENT) – to flag the

  • event. (change in) –

return: None rtype: None

handle_long_running_command_status(event_data: tango.EventData) None

Method to handle and update the latest value of longRunningCommandStatus attribute.

Parameters:
  • event_data (tango.EventType.CHANGE_EVENT) – to flag the

  • event. (change in) –

Returns:

None

Return type:

None

handle_pointing_state_event(event_flag: tango.EventData) None

Method to handle and update the latest value of pointingState attribute.

Parameters:
  • event_flag (tango.EventData) – to flag the

  • event. (change in) –

return: None rtype: None

run() None
subscribe_events(dev_info: ska_tmc_common.DishDeviceInfo, attribute_dictionary=None) None