ska_tmc_centralnode.commands package

Submodules

ska_tmc_centralnode.commands.abstract_command module

class ska_tmc_centralnode.commands.central_node_command.AssignReleaseResources(*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.central_node_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)
class ska_tmc_centralnode.commands.central_node_command.LoadDishCfgCommand(*args: Any, **kwargs: Any)

Bases: CentralNodeCommand

This command class for LoadDishConfig command which load dishid-vcc map json from CAR and pass it to CSP Master

init_adapters_mid() Tuple[ska_tango_base.commands.ResultCode, str]
class ska_tmc_centralnode.commands.central_node_command.TelescopeOnOff(*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]

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: AssignReleaseResources

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 AssignResources command, it executes do hook, invokes AssignResources 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

create_mccs_cmd_data(json_argument: dict) dict

Method to prepare the input json_argument required while invoking AssignResources() command on MCCS Master Leaf Node. :param json_argument: The string in JSON format.

Returns:

The string in JSON format.

do_low(argin=None)

Method to invoke AssignResources command on Subarray.

Parameters:

argin – DevString

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}}}
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:

DevString

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-20210623-00000","max_length": 100.0,
"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.0,"freq_max": 368000000.0,"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.0,"freq_max": 368000000.0,
"link_map": [[2000, 4],[2200, 5]]}, {"spectral_window_id": "zoom_window_1",
"count": 744,"start": 4000,"stride": 1,"freq_min": 360000000.0,"freq_max": 361000000.0,
"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.0,"freq_max": 368000000.0}]}],
"polarisations": [{"polarisations_id": "all","corr_type": ["XX", "XY", "YY", "YX"]}],
"fields": [{"field_id": "field_a","phase_dir": {"ra": [123, 0.1],"dec": [80, 0.1],
"reference_time": "...","reference_frame": "ICRF3"},"pointing_fqdn":
"low-tmc/telstate/0/pointing"}]},"processing_blocks": [{"pb_id": "pb-mvp01-20210623-00000",
"sbi_ids": ["sbi-mvp01-20200325-00001"],"script": {"kind": "realtime",
"name": "vis_receive","version": "0.1.0"},"parameters": {}}, {
"pb_id": "pb-mvp01-20210623-00001","sbi_ids": ["sbi-mvp01-20200325-00001"],
"script": {"kind": "realtime","name": "test_realtime","version": "0.1.0"},
"parameters": {}}, {"pb_id": "pb-mvp01-20210623-00002","sbi_ids": ["sbi-mvp01-20200325-00002"],
"script": {"kind": "batch","name": "ical","version": "0.1.0"},"parameters": {},
"dependencies": [{"pb_id": "pb-mvp01-20210623-00000","kind": ["visibilities"]}]
}, {"pb_id": "pb-mvp01-20210623-00003","sbi_ids": ["sbi-mvp01-20200325-00001",
"sbi-mvp01-20200325-00002"],"script": {"kind": "batch","name": "dpreb","version": "0.1.0"},
"parameters": {},"dependencies": [{"pb_id": "pb-mvp01-20210623-00002",
"kind": ["calibration"]}]}],"resources": {"csp_links": [1, 2, 3, 4],
"receptors": ["FS4", "FS8", "FS16", "FS17", "FS22", "FS23", "FS30", "FS31", "FS32",
"FS33", "FS36", "FS52", "FS56", "FS57", "FS59", "FS62", "FS66", "FS69", "FS70", "FS72",
"FS73", "FS78", "FS80", "FS88", "FS89", "FS90", "FS91", "FS98", "FS108", "FS111", "FS132",
"FS144", "FS146", "FS158", "FS165", "FS167", "FS176", "FS183", "FS193", "FS200", "FS345",
"FS346", "FS347", "FS348", "FS349", "FS350", "FS351", "FS352", "FS353", "FS354", "FS355",
"FS356", "FS429", "FS430", "FS431", "FS432", "FS433", "FS434", "FS465", "FS466", "FS467",
"FS468", "FS469", "FS470"],"receive_nodes": 10}}}

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: AssignReleaseResources

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

DevString

Example:

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

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

DevString

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

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: TelescopeOnOff

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_mccs()
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: TelescopeOnOff

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_mccs()
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: TelescopeOnOff

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_mccs()
turn_standby_sdp()
turn_standby_subarrays()

ska_tmc_centralnode.commands.load_dish_config_command module

class ska_tmc_centralnode.commands.load_dish_config_command.LoadDishCfg(*args: Any, **kwargs: Any)

Bases: LoadDishCfgCommand

A class for CentralNode’s LoadDishConfig command. Load DishId-VCC map from CAR URI and provide it to Csp Master Leaf Node After Validation

do(dish_cfg_params: str) Tuple[ska_tango_base.commands.ResultCode, str]

This command does following 1. Load content of DishId-VCC mapping file from CAR URI 2. Validate Json 3. Invoke command on csp master leaf node 4. Invoke SetKValue command on Dish Leaf Node for each dish id provided in dishid_vcc map :param dish_cfg_params: dishid vcc map params

get_dishid_vcc_map_json(initial_params: dict) Tuple[dict, str]

Get DishId-VCC map json from initial params :param initial_param: this param containg tm data source uri and file path which is used for extracting vcc_map json file

load_dish_cfg(dish_cfg_params: str, logger=None, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None) None
Parameters:
  • logger (logging.Logger) – logger

  • dish_cfg_params – dishid vcc map params

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

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

Module contents