ska_tmc_centralnode.commands package

Submodules

ska_tmc_centralnode.commands.abstract_command module

class ska_tmc_centralnode.commands.abstract_command.AbstractAssignReleaseResources(*args: Any, **kwargs: Any)

Bases: CentralNodeCommand

init_adapters_low() Tuple[ska_tango_base.commands.ResultCode, str]
init_adapters_mid() Tuple[ska_tango_base.commands.ResultCode, str]
class ska_tmc_centralnode.commands.abstract_command.AbstractTelescopeOnOff(*args: Any, **kwargs: Any)

Bases: CentralNodeCommand

init_adapters_low() Tuple[ska_tango_base.commands.ResultCode, str]
init_adapters_mid() Tuple[ska_tango_base.commands.ResultCode, str]
class ska_tmc_centralnode.commands.abstract_command.CentralNodeCommand(*args: Any, **kwargs: Any)

Bases: TMCCommand

adapter_error_message(dev_name: str, error) Tuple[ska_tango_base.commands.ResultCode, str]
do(argin=None)
init_adapters() Tuple[ska_tango_base.commands.ResultCode, str]
invoke_command(adapters: list, command_caller, err_msg: str, command_name: str)
reject_command(message)
send_command(adapters, description, command, argin=None)

ska_tmc_centralnode.commands.assign_resources_command module

AssignResources class for CentralNode.

class ska_tmc_centralnode.commands.assign_resources_command.AssignResources(*args: Any, **kwargs: Any)

Bases: AbstractAssignReleaseResources

A class for CentralNode’s AssignResources() command.

Assigns resources to given subarray. It accepts the subarray id, receptor id list and SDP block in JSON string format. Upon successful execution, the ‘receptor_ids’ attribute of the given subarray is populated with the given receptors.Also checking for duplicate allocation of resources is done. If already allocated it will throw error message regarding the prior existence of resource.

assign_resources(argin, logger, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None)

This is a long running method for TelescopeOn command, it executes do hook, invokes TelescopeOn command on lowe level devices.

Parameters:
  • logger (logging.Logger) – logger

  • task_callback (Callable, optional) – Update task state, defaults to None

  • task_abort_event (Event, optional) – Check for abort, defaults to None

do_low(argin=None)

Method to invoke AssignResources command on Subarray.

Parameters:

argin

The string in JSON format. The JSON contains following values: interface:

DevString. Mandatory. Version of schema to allocate assign resources.

subarray_id:

DevShort. Mandatory. Sub-Array to allocate resources to

mccs:
subarray_beam_ids:

DevArray. Mandatory logical ID of beam

station_ids:

DevArray. Mandatory list of stations contributing beams to the data set

channel_blocks:

DevArray. Mandatory list of channels used

Example:
{"interface":"https://schema.skao.int/ska-low-tmc-assignresources/3.0","transaction_id":"txn-....-00001","subarray_id":1,
"mccs":{"subarray_beam_ids":[1],"station_ids":[[1,2]],"channel_blocks":[3]},
"sdp":{"interface":"https://schema.skao.int/ska-sdp-assignres/0.4","execution_block":{"eb_id":"eb-mvp01-20200325-00001",
"max_length":100,"context":{},"beams":[{"beam_id":"vis0","function":"visibilities"},
{"beam_id":"pss1","search_beam_id":1,"function":"pulsar search"},{"beam_id":"pss2","search_beam_id":2,"function":"pulsar search"},
{"beam_id":"pst1","timing_beam_id":1,"function":"pulsar timing"},{"beam_id":"pst2","timing_beam_id":2,"function":"pulsar timing"},
{"beam_id":"vlbi1","vlbi_beam_id":1,"function":"vlbi"}],
"scan_types":[{"scan_type_id":".default","beams":{"vis0":{"channels_id":"vis_channels","polarisations_id":"all"},
"pss1":{"field_id":"pss_field_0","channels_id":"pulsar_channels","polarisations_id":"all"},
"pss2":{"field_id":"pss_field_1","channels_id":"pulsar_channels","polarisations_id":"all"},
"pst1":{"field_id":"pst_field_0","channels_id":"pulsar_channels","polarisations_id":"all"},
"pst2":{"field_id":"pst_field_1","channels_id":"pulsar_channels","polarisations_id":"all"},
"vlbi":{"field_id":"vlbi_field","channels_id":"vlbi_channels","polarisations_id":"all"}}},
{"scan_type_id":"target:a","derive_from":".default","beams":{"vis0":{"field_id":"field_a"}}}],
"channels":[{"channels_id":"vis_channels",
"spectral_windows":[{"spectral_window_id":
"fsp_1_channels","count":744,"start":0,"stride":2,"freq_min":350000000,"freq_max":368000000,
"link_map":[[0,0],[200,1],[744,2],[944,3]]},{"spectral_window_id":"fsp_2_channels",
"count":744,"start":2000,"stride":1,"freq_min":360000000,"freq_max":368000000,"link_map":[[2000,4],[2200,5]]},
{"spectral_window_id":"zoom_window_1","count":744,"start":4000,"stride":1,"freq_min":360000000,"freq_max":361000000,"link_map":[[4000,6],[4200,7]]}]},
{"channels_id":"pulsar_channels","spectral_windows":[{"spectral_window_id":"pulsar_fsp_channels","count":744,"start":0,"freq_min":350000000,"freq_max":368000000}]}],
"polarisations":[{"polarisations_id":"all","corr_type":["XX","XY","YY","YX"]}],"fields":[{"field_id":"field_a",
"phase_dir":{"ra":[123,0.1],"dec":[123,0.1],"reference_time":"...","reference_frame":"ICRF3"},"pointing_fqdn":"low-tmc/telstate/0/pointing"}]},
"processing_blocks":[{"pb_id":"pb-mvp01-20200325-00001","sbi_ids":["sbi-mvp01-20200325-00001"],"script":{},"parameters":{},
"dependencies":{}},{"pb_id":"pb-mvp01-20200325-00002","sbi_ids":["sbi-mvp01-20200325-00002"],"script":{},"parameters":{},
"dependencies":{}},{"pb_id":"pb-mvp01-20200325-00003","sbi_ids":["sbi-mvp01-20200325-00001","sbi-mvp01-20200325-00002"],"script":{},
"parameters":{},"dependencies":{}}],"resources":{"csp_links":[1,2,3,4],"receptors":["FS4","FS8"],"receive_nodes":10}}}

Note: From Jive, enter above input string without any space.

Returns:

None

Raises:
  • KeyError if input argument json string contains invalid key

  • ValueError if input argument json string contains invalid value

  • AssertionError if Mccs On command is not completed.

do_mid(argin) Tuple[ska_tango_base.commands.ResultCode, str]

Method to invoke AssignResources command on Subarray.

param argin:

The string in JSON format. The JSON contains following values: subarray_id:

DevShort. Mandatory.

dish:

Mandatory JSON object consisting of

receptor_ids:

DevVarStringArray The individual string should contain dish numbers in string format with preceding zeroes upto 3 digits. E.g. SKA001, SKA002.

sdp:

Mandatory JSON object consisting of

eb_id:

DevString The SBI id.

max_length:

DevDouble Maximum length of the SBI in seconds.

scan_types:

array of the blocks each consisting following parameters scan_type_id:

DevString The scan id.

coordinate_system:

DevString

ra:

DevString

Dec:

DevString

processing_blocks:

array of the blocks each consisting following parameters

eb_id:

DevString The Processing Block id.

workflow:
kind:

DevString

name:

DevString

version:

DevString

parameters:

{}

Example:
{"interface":"https://schema.skao.int/ska-tmc-assignresources/2.1",
"transaction_id":"txn-....-00001","subarray_id":1,"dish":{"receptor_ids":
["SKA001"]},"sdp":{"interface":"https://schema.skao.int/ska-sdp-assignres/0.4",
"execution_block":{"eb_id":"eb-mvp01-20200325-00001","max_length": 100,"context":
{},"beams":[{"beam_id":"vis0","function":"visibilities"}],"scan_types":[{
"scan_type_id":".default","beams":{"vis0":{"channels_id":"vis_channels",
"polarisations_id":"all"}}},{"scan_type_id":"target:a","derive_from":
".default","beams":{"vis0":{"field_id": "field_a"}}}],"channels":[{
"channels_id":"vis_channels","spectral_windows":[{"spectral_window_id":
"fsp_1_channels","count": 744,"start": 0,"stride": 2,"freq_min": 350000000,
"freq_max": 368000000,"link_map":[[0,0],[200,1],[744,2],[944,3]]},
{"spectral_window_id":"fsp_2_channels","count":744,"start":2000,"stride":1,
"freq_min": 360000000,"freq_max": 368000000,"link_map":[[2000,4],[2200,5]]},
{"spectral_window_id":"zoom_window_1","count": 744,"start":4000,"stride": 1,
"freq_min":360000000,"freq_max":361000000,"link_map":[[4000,6],[4200,7]]}]}],
"polarisations":[{"polarisations_id":"all","corr_type":["XX","XY","YY","YX"]}],
"fields":[{"field_id":"field_a","phase_dir":{"ra":[123,0.1],"dec":[123,0.1],
"reference_time": "...","reference_frame":"ICRF3"},"pointing_fqdn":"low-tmc/telstate/0/pointing"}]},
"processing_blocks": [{"pb_id":"pb-mvp01-20200325-00003","sbi_ids":["sbi-mvp01-20200325-00001", "sbi-mvp01-20200325-00002" ],
"script":{},"parameters":{},"dependencies":{}}],"resources":{"csp_links":[1,2,3,4],"receptors":
["FS4","FS8"],"receive_nodes":10}}}

Note: From Jive, enter above input string without any space.

return: A tuple containing a return code and a string msg. For Example:

(ResultCode.OK, “”)

get_subarray_adapter(subarray_id)
update_resource_config_file(json_argument, id)

This method utilizes SKUID service to generate unique sb_id / eb_id and pb_id

update_task_status(result: ska_tango_base.commands.ResultCode, message: str = '')

Updates the task status for command

ska_tmc_centralnode.commands.release_resources_command module

ReleaseResources class for CentralNode.

class ska_tmc_centralnode.commands.release_resources_command.ReleaseResources(*args: Any, **kwargs: Any)

Bases: AbstractAssignReleaseResources

A class for CentralNode’s ReleaseResources() command.

Release all the resources assigned to the given Subarray. It accepts the subarray id, releaseALL flag and receptorIDList in JSON string format. When the releaseALL flag is True, ReleaseAllResources command is invoked on the respective SubarrayNode. In this case, the receptorIDList tag is empty as all the resources of the Subarray are to be released. When releaseALL is False, ReleaseResources will be invoked on the SubarrayNode and the resources provided in receptorIDList tag, are to be released from the Subarray. The selective release of the resources when releaseALL Flag is False is not yet supported.

do_low(argin)

Method to invoke ReleaseResources command on Subarray Node.

Parameters:

argin

The string in JSON format. The JSON contains following values:

subarray_id:

DevShort. Mandatory.

release_all:

Boolean(True or False). Mandatory. True when all the resources to be released from Subarray.

Example:

{“interface”:”https://schema.skao.int/ska-low-tmc-releaseresources/2.0”,”transaction_id”:”txn-….-00001”,”subarray_id”:1,”release_all”:true}

Note: From Jive, enter input as:

{“interface”:”https://schema.skao.int/ska-low-tmc-releaseresources/2.0”,”transaction_id”:”txn-….-00001”,”subarray_id”:1,”release_all”:true} without any space.

Returns:

None

Raises:
  • ValueError if input argument json string contains invalid value

  • KeyError if input argument json string contains invalid key

  • DevFailed if the command execution or command invocation on SubarrayNode is not successful

do_mid(argin) Tuple[ska_tango_base.commands.ResultCode, str]

Method to invoke ReleaseResources command on Subarray.

Parameters:

argin

The string in JSON format. The JSON contains following values:

subarray_id:

DevShort. Mandatory.

release_all:

Boolean(True or False). Mandatory. True when all the resources to be released from Subarray.

receptor_ids:

DevVarStringArray. Empty when release_all tag is True.

Example:
{

“interface”: “https://schema.skao.int/ska-tmc-releaseresources/2.0”, “transaction_id”: “txn-….-00001”, “subarray_id”: 1, “release_all”: true, “receptor_ids”: [ ]

}

Returns:

None

release_all_resources(adapter)
release_resources(argin, logger, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None)

This is a long running method for ReleaseResources command, it executes do hook, invokes ReleaseResources command on lower level devices.

Parameters:
  • logger (logging.Logger) – logger

  • task_callback (Callable, optional) – Update task state, defaults to None

  • task_abort_event (Event, optional) – Check for abort, defaults to None

release_resources_mccs(arg)
update_task_status(result: ska_tango_base.commands.ResultCode, message: str = '')

Updates the task status for command

ska_tmc_centralnode.commands.stow_antennas_command module

class ska_tmc_centralnode.commands.stow_antennas_command.StowAntennas(*args: Any, **kwargs: Any)

Bases: CentralNodeCommand

A class for CentralNode’s StowAntennas() command.

Invokes the command SetStowMode on the specified receptors.

check_allowed()

Checks whether this command is allowed It checks that the device is in a state to perform this command and that all the component needed for the operation are not faulty

Returns:

True if this command is allowed

Return type:

boolean

do(argin)

Method to invoke StowAntennas command.

param argin:

List of Receptors to be stowed.

init_adapters()
set_stow_mode_dishes(adapters)

ska_tmc_centralnode.commands.telescope_off_command module

class ska_tmc_centralnode.commands.telescope_off_command.TelescopeOff(*args: Any, **kwargs: Any)

Bases: AbstractTelescopeOnOff

A class for CentralNode’s TelescopeOff() command. Sets the CentralNode into telescopestate to OFF.

do_low(argin=None)

Method to invoke Off command on Lower level devices. param: None

Returns:

A tuple containing a return code and a string message indicating status.

rtype:

(ResultCode, str)

do_mid(argin=None)

Method to invoke Off command on Lower level devices. param: None

Returns:

A tuple containing a return code and a string message indicating status.

rtype:

(ResultCode, str)

telescope_off(logger, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None)

This is a long running method

Parameters:
  • logger (logging.Logger) – logger

  • task_callback (Callable, optional) – Update task state, defaults to None

  • task_abort_event (Event, optional) – Check for abort, defaults to None

turn_off_csp()
turn_off_dishes()
turn_off_sdp()
turn_off_subarrays()

ska_tmc_centralnode.commands.telescope_on_command module

class ska_tmc_centralnode.commands.telescope_on_command.TelescopeOn(*args: Any, **kwargs: Any)

Bases: AbstractTelescopeOnOff

A class for CentralNode’s TelescopeOn() command.

TelescopeOn command on Central node enables the telescope to perform further operations and observations. It Invokes On command on lower level devices.

do_low(argin=None)

Method to invoke On command on Lower level devices.

param argin:

None.

do_mid(argin=None)

Method to invoke On command on Lower level devices.

param argin:

None.

set_standby_fp_mode_dishes()
telescope_on(logger, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None)

This is a long running method for TelescopeOn command, it executes do hook, invokes TelescopeOn command on lowe level devices.

Parameters:
  • logger (logging.Logger) – logger

  • task_callback (Callable, optional) – Update task state, defaults to None

  • task_abort_event (Event, optional) – Check for abort, defaults to None

turn_on_csp()
turn_on_sdp()
turn_on_subarrays()

ska_tmc_centralnode.commands.telescope_standby_command module

class ska_tmc_centralnode.commands.telescope_standby_command.TelescopeStandby(*args: Any, **kwargs: Any)

Bases: AbstractTelescopeOnOff

A class for CentralNode’s TelescopeStandby() command.

do_low(argin=None)

Method to invoke Standby command on SubarrayNode and MCCS Master Leaf Node.

param:

None

Returns:

A tuple containing a return code and a message

do_mid(argin=None)

Method to invoke TelescopeStandby command on SubarrayNode, CSP and SDP Master Leaf Nodes. Also to invoke StandbyFP and then StandbyLP commands on Dish Leaf Nodes.

param:

None

Returns:

A tuple containing a return code and a message

telescope_standby(logger, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None)

This is a long running method for TelescopeStandby command, it executes do hook, invokes TelescopeStandby command on lower level devices.

Parameters:
  • logger (logging.Logger) – logger

  • task_callback (Callable, optional) – Update task state, defaults to None

  • task_abort_event (Event, optional) – Check for abort, defaults to None

turn_off_dishes()
turn_standby_csp()
turn_standby_sdp()
turn_standby_subarrays()

Module contents