ska_tmc_subarraynode.commands.low package

Link to the TMC User documentation is here.

Submodules

assign_resources_command

Path: src/ska_tmc_subarraynode/commands/low/assign_resources_command.py

AssignResources Command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.assign_resources_command.AssignResourcesLow(*args, **kwargs)

Bases: AssignResources

A class for SubarrayNodeLow’s AssignResources() command.

Assigns resources to CSP, SDP and MCCS via respective subarray leaf nodes. It also sets AssignedResources attribute on SubarrayNode.

assign_csp_resources(argin)

This function accepts the CSP Resources as input and assigns CSP resources to CSP Subarray through CSP Subarray Leaf Node.

Parameters

argin (dict) – JSON string including CSP resources.

Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and message.

do(argin)

Method to invoke AssignResources command on subarraynode low.

Parameters

argin (str) – JSON for AssignResources on low.

Example JSON for Assign Resources low
{
  "interface": "https://schema.skao.int/ska-low-tmc-assignresources/4.0",
  "transaction_id": "txn-....-00001",
  "subarray_id": 1,
  "mccs": {
    "interface": "https://schema.skao.int/ska-low-mccs-controller-allocate/3.0",
    "subarray_beams": [
      {
        "subarray_beam_id": 1,
        "apertures": [
          {
            "station_id": 1,
            "aperture_id": "AP001.01"
            
          }
          
        ],
        "number_of_channels": 8
        
      }
      
    ]
    
  },
  "csp": {
    "pss": {
      "pss_beam_ids": [
        1,
        2,
        3
      ]
    },
    "pst": {
      "pst_beam_ids": [
        1
      ]
    }
    
  },
  "sdp": {
    "interface": "https://schema.skao.int/ska-sdp-assignres/0.4",
    "resources": {
      "receptors": [
        "SKA001",
        "SKA002",
        "SKA003",
        "SKA004"
      ],
      "receive_nodes": 1
      
    },
    "execution_block": {
      "eb_id": "eb-test-20220916-00000",
      "context": {
        
      },
      "max_length": 3600.0,
      "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"
            }
          }
          
        },
        {
          "scan_type_id": "calibration:b",
          "derive_from": ".default",
          "beams": {
            "vis0": {
              "field_id": "field_b"
            }
          }
          
        }
        
      ],
      "channels": [
        {
          "channels_id": "vis_channels",
          "spectral_windows": [
            {
              "spectral_window_id": "fsp_1_channels",
              "count": 4,
              "start": 0,
              "stride": 2,
              "freq_min": 350000000.0,
              "freq_max": 368000000.0,
              "link_map": [
                [
                  0,
                  0
                ],
                [
                  200,
                  1
                ],
                [
                  744,
                  2
                ],
                [
                  944,
                  3
                ]
              ]
              
            }
          ]
          
        }
      ],
      "polarisations": [
        {
          "polarisations_id": "all",
          "corr_type": [
            "XX",
            "XY",
            "YX",
            "YY"
          ]
          
        }
      ],
      "fields": [
        {
          "field_id": "field_a",
          "phase_dir": {
            "ra": [
              123.0
            ],
            "dec": [
              -60.0
            ],
            "reference_time": "...",
            "reference_frame": "ICRF3"
            
          },
          "pointing_fqdn": "..."
          
        },
        {
          "field_id": "field_b",
          "phase_dir": {
            "ra": [
              123.0
            ],
            "dec": [
              -60.0
            ],
            "reference_time": "...",
            "reference_frame": "ICRF3"
            
          },
          "pointing_fqdn": "..."
          
        }
        
      ]
      
    },
    "processing_blocks": [
      {
        "pb_id": "pb-test-20220916-00000",
        "script": {
          "kind": "realtime",
          "name": "test-receive-addresses",
          "version": "0.7.1"
          
        },
        "sbi_ids": [
          "sbi-mvp01-20210623-00000"
        ],
        "parameters": {
          
        }
        
      }
    ]
    
  }
  
}
Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and string.

Raises
  • KeyError – Raise KeyError if a required key is missing

  • in the input JSON.

get_csp_resources_low(argin)

Create the input JSON for AssignResources on CSP Subarray Leaf Node device.

argin (str):

Input JSON string containing CSP configuration

Returns

Returns the JSON for CSP Subarray Leaf Node device

Return type

dict

Raises

Exception – Raises exception if fetching CSP config fails.

update_instances(argin)

Method to update low input jsons for AssignResources command

Parameters

argin (json) – Input Json

Returns

Returns resultcode and message

configure_command

Path: src/ska_tmc_subarraynode/commands/low/configure_command.py

Configure Command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.configure_command.ConfigureLow(*args, **kwargs)

Bases: Configure

A class for SubarrayNodeLow’s Configure() command.

Configures the resources assigned to the Subarray. The configuration data for SDP, CSP and MCCS for low telescope is extracted out of the input configuration string and relayed to the respective underlying devices (SDP Subarray Leaf Node, CSP Subarray Leaf Node and MCCS Leaf Node for low telescope ).

do(argin)

This method executes the Configure workflow of the Subarray Node Low. It will invoke Configure command on the CSP Subarray Leaf Node, SDP Subarray Leaf Node and MCCSLeaf Node for low.

This method also supports single subsystem configuration, which is currently supported only by MCCS subsystem. This scenario invokes configure only on MCCS subsystem.

Parameters

argin (str) – JSON for Configuration.

Example JSON for Configure low
{
  "interface": "https://schema.skao.int/ska-low-tmc-configure/4.2",
    "transaction_id": "txn-....-00001",
    "mccs": {
        "subarray_beams": [
            {
                "subarray_beam_id": 1,
                "update_rate": 0.0,
                "logical_bands": [
                    {"start_channel": 80, "number_of_channels": 16},
                    {"start_channel": 384, "number_of_channels": 16}
                ],
                "apertures": [
                    {
                        "aperture_id": "AP001.01",
                        "weighting_key_ref": "aperture2"
                    },
                    {
                        "aperture_id": "AP001.02",
                        "weighting_key_ref": "aperture3"
                    },
                    {
                        "aperture_id": "AP002.01",
                        "weighting_key_ref": "aperture2"
                    },
                    {
                        "aperture_id": "AP002.02",
                        "weighting_key_ref": "aperture3"
                    }
                ],
                "sky_coordinates": {
                    "reference_frame": "ICRS",
                    "c1": 180.0,
                    "c2": 45.0
                }
            }
        ]
    },
    "sdp": {
        "interface": "https://schema.skao.int/ska-sdp-configure/0.4",
        "scan_type": "target:a"
    },
    "csp": {
        "interface": "https://schema.skao.int/ska-low-csp-configure/3.2",
        "common": {
            "config_id": "sbi-mvp01-20200325-00001-science_A",
            "eb_id": "eb-test-20220916-00000"
        },
        "lowcbf": {
            "stations": {
                "stns": [[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1]],
                "stn_beams": [{"beam_id": 1, "freq_ids": [400]}]
            },
            "vis": {
                "fsp": {"firmware": "vis", "fsp_ids": [1]},
                "stn_beams": [
                    {
                        "stn_beam_id": 1,
                        "integration_ms": 849
                    }
                ]
            },
            "timing_beams": {
                "fsp": {"firmware": "pst", "fsp_ids": [2]},
                "beams": [
                    {
                        "pst_beam_id": 1,
                        "field": {
                            "target_name": "PSR J0024-7204R",
                            "reference_frame": "icrs",
                            "attrs": {
                                "c1": 6.023625,
                                "c2": -72.08128333,
                                "pm_c1": 4.8,
                                "pm_c2": -3.3
                            }
                        },
                        "stn_beam_id": 1,
                        "stn_weights": [0.9, 1.0, 1.0, 1.0, 0.9, 1.0]
                    }
                ]
            }
        },
        "pst": {
            "beams": [
                {
                    "beam_id": 1,
                    "scan": {
                        "activation_time": "2022-01-19T23:07:45Z",
                        "bits_per_sample": 32,
                        "num_of_polarizations": 2,
                        "udp_nsamp": 32,
                        "wt_nsamp": 32,
                        "udp_nchan": 24,
                        "num_frequency_channels": 432,
                        "centre_frequency": 200000000.0,
                        "total_bandwidth": 1562500.0,
                        "observation_mode": "VOLTAGE_RECORDER",
                        "observer_id": "jdoe",
                        "project_id": "project1",
                        "pointing_id": "pointing1",
                        "source": "J1921+2153",
                        "itrf": [5109360.133, 2006852.586, -3238948.127],
                        "receiver_id": "receiver3",
                        "feed_polarization": "LIN",
                        "feed_handedness": 1,
                        "feed_angle": 1.234,
                        "feed_tracking_mode": "FA",
                        "feed_position_angle": 10.0,
                        "oversampling_ratio": [8, 7],
                        "coordinates": {
                            "equinox": 2000.0,
                            "ra": "19:21:44.815",
                            "dec": "21:53:02.400"
                        },
                        "max_scan_length": 20000.0,
                        "subint_duration": 30.0,
                        "receptors": ["receptor1", "receptor2"],
                        "receptor_weights": [0.4, 0.6],
                        "num_channelization_stages": 2,
                        "channelization_stages": [
                            {
                                "num_filter_taps": 1,
                                "filter_coefficients": [1.0],
                                "num_frequency_channels": 1024,
                                "oversampling_ratio": [32, 27]
                            },
                            {
                                "num_filter_taps": 1,
                                "filter_coefficients": [1.0],
                                "num_frequency_channels": 256,
                                "oversampling_ratio": [4, 3]
                            }
                        ]
                    }
                }
            ]
        }
    },
    "tmc": {"scan_duration": 20.0}
}
Return type

Tuple[ResultCode, str]

Returns

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

invoke_command(method, configuration)

This method helps to invoke command

Parameters
  • method (Callable[[dict],Tuple]) – method to invoke

  • configuration (dict) – configuration data

Raises

Exception – Raises exception if result code is not OK.

set_single_subsystem_configuration(is_single_subsystem_configuration, subsystems_to_config)

This method is used to set the single subsystem configuration in component manager.

Parameters
  • is_single_subsystem_configuration (bool) – True if only one subsystem to configure.

  • subsystems_to_config (set) – Set with subsystem to configure.

validating_subsystems(subsystems_to_config, is_single_subsystem_configuration)

_summary_

Parameters
  • subsystems_to_config (set) – Set with subsystem to configure.

  • is_single_subsystem_configuration (bool) – True if only one subsystem to configure.

Raises

Exception – Raises exception if single subsystem is not as expected.

end_command

Path: src/ska_tmc_subarraynode/commands/low/end_command.py

A class for End command for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.end_command.EndLow(*args, **kwargs)

Bases: End

A class for SubarrayNodeLow’s End() command .

do(argin=None)

Method to invoke End command on SDP, CSP and MCCS Subarray Leaf Node.

This method also supports single subsystem End command, which is currently supported only by MCCS subsystem.

Parameters

argin (Optional[str]) – Optional argument

Return type

Tuple[ResultCode, str]

Returns

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

end_mccs()

End command on Mccs Subarray Leaf Node.

Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and message.

end_single_subsystem()

Method to invoke End command in single subsystem workflow

Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and message.

end_scan_command

Path: src/ska_tmc_subarraynode/commands/low/end_scan_command.py

EndScan Command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.end_scan_command.EndScanLow(*args, **kwargs)

Bases: EndScan

A class for SubarrayNodeLow’s EndScan() command .

do(argin=None)

This method executes the End Scan workflow of the Subarray Node Low. It will invoke End Scan command on the CSP Subarray Leaf Node, SDP Subarray Leaf Node and MCCS Leaf Node.

This method also supports single subsystem EndScan command, which is currently supported only by MCCS subsystem.

Parameters

argin (Optional[str]) – Optional argument

Return type

Tuple[ResultCode, str]

Returns

Tuple of ResultCode and message

end_scan_low()

Setting up device for low csp, sdp and mccs

Return type

Tuple[ResultCode, str]

Returns

Tuple of Resultcode and message.

end_scan_mccs()

Ends the scanning process on the Mccs Subarray Leaf Node.

This method sends the EndScan command to the Mccs Subarray Leaf Node, indicating the completion of the scanning process.

Return type

Tuple[ResultCode, str]

Returns

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

end_scan_single_subsystem()

Method to invoke EndScan command in single subsystem workflow

Return type

None

release_all_resources_command

Path: src/ska_tmc_subarraynode/commands/low/release_all_resources_command.py

ReleaseAllResources Command class for SubarrayNodeLow.

class ska_tmc_subarraynode.commands.low.release_all_resources_command.ReleaseAllResourcesLow(*args, **kwargs)

Bases: ReleaseAllResources

A class for the SubarrayNodeLow’s ReleaseAllResources() command.

clean_up_resources()

Clears the assignedResources attribute.

Cleans dictionaries of the resources across the subarraynode.

Note

Currently there are only receptors allocated so only the receptor ids details are stored.

Return type

Tuple[ResultCode, str]

Returns

Tuple of Resultcode and message

do(argin=None)

Method to invoke ReleaseAllResources command.

Parameters

argin (Optional[str]) – optional argument

Return type

Tuple[ResultCode, str]

Returns

A tuple containing a return code STARTED on successful release all resources and message.

restart_command

Path: src/ska_tmc_subarraynode/commands/low/restart_command.py

Restart Command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.restart_command.RestartLow(*args, **kwargs)

Bases: Restart

A class representing the Restart command for SubarrayNodeLow.

This command restarts various leaf nodes of the Subarray, including CSP Subarray Leaf Node, SDP Subarray Leaf Node, and Mccs Subarray Leaf Node to reset ongoing activities and configurations.

do(argin=None)

Invokes the Restart command on CSP Subarray Leaf Node, SDP Subarray Leaf Node, and Mccs Subarray Leaf Node to restarts the respective devices.

Parameters

argin (Optional[str]) – Optional argument. Default is None.

Return type

Tuple[ResultCode, str]

Returns

A tuple containing the result code and a message indicating the execution status.

restart_mccs()

Restarts the MCCS devices by invoking the Restart command on the MccsSubarrayLeafNode.

Return type

Tuple[ResultCode, str]

Returns

A tuple containing the result code and an empty string.

  • ResultCode.OK: If the Restart command is executed successfully.

  • ResultCode.FAILED: If there is an error.

scan_command

Path: src/ska_tmc_subarraynode/commands/low/scan_command.py

Scan Command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.scan_command.ScanLow(*args, **kwargs)

Bases: Scan

A class for SubarrayNodeLow’s Scan() command .

do(argin)

Method to invoke Scan command on the CSP Subarray Leaf Node, SDP Subarray Leaf Node and MCCS Leaf Node.

This method also supports single subsystem Scan command, which is currently supported only by MCCS subsystem.

Parameters

argin (str) – JSON string containing id.

Example JSON for Scan low
{
  "interface": "https://schema.skao.int/ska-low-tmc-scan/4.0",
  "transaction_id": "txn-....-00001",
  "scan_id": 1
}
Return type

Tuple[ResultCode, str]

Returns

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

scan_csp(argin)

Method to invoke Scan command on CSP Subarray Leaf Node.

Parameters

argin (str) – Additional argument

Return type

Tuple[ResultCode, str]

Returns

(ResultCode, message)

scan_mccs(argin)

Initiates a scanning process on the MCCS Subarray Leaf Node with the specified configuration.

This method sends the Scan command to the MCCS Subarray Leaf Node, initiating the scanning process with the provided configuration.

Parameters

argin (dict) – A dictionary containing configuration parameters for the scanning process. The format and content of this dictionary should comply with the requirements of the MCCS Subarray Leaf Node.

Return type

Tuple[ResultCode, str]

Returns

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

scan_single_subsystem(json_argument)

Method to invoke Scan command in single subsystem workflow

Parameters

json_argument (str) – Json argument for scan

Return type

Tuple[ResultCode, str]

Returns

(ResultCode, message)

update_mccs_json(input_scan)

This Scan command input string is updated to send to MCCS Subarray Leaf Node.

Parameters

input_scan (dict) – Input to be sent to MCCS Subarray Leaf node

Returns

Tweaked mccs json

Return type

dict

off_command

Path: src/ska_tmc_subarraynode/commands/low/off_command.py

Off command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.off_command.OffLow(*args, **kwargs)

Bases: Off

A class for SubarrayNodeLow’s Off() command.

do(argin=None)

Method to invoke off command on the SDP Subarray Leaf Node.

Parameters

argin (str) – Input json for Command, defaults to None

Return type

Tuple[ResultCode, str]

Returns

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

on_command

Path: src/ska_tmc_subarraynode/commands/low/on_command.py

On Command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.on_command.OnLow(*args, **kwargs)

Bases: On

A class for the SubarrayNodeLow’s On() command.

do(argin=None)

Method to invoke On command on SDP Subarray Leaf Node.

Parameters

argin – Input json for Command, defaults to None

Return type

Tuple[ResultCode, str]

Returns

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

abort_command

Path: src/ska_tmc_subarraynode/commands/low/abort_command.py

Abort Command class for SubarrayNode Low.

class ska_tmc_subarraynode.commands.low.abort_command.AbortLow(*args, **kwargs)

Bases: Abort

A class for SubarrayNodeLow’s Abort() command .

abort_mccs()

Executes the ‘Abort’ command on the TMC MCCS Subarray Leaf Node.

Returns

A tuple containing a ResultCode indicating the status of the command execution and a string describing any error that occurred during execution. For successful execution, the ResultCode is OK, and the error string is empty.

Return type

tuple

do(argin=None)

Method to invoke Abort command on Csp SubarrayLeaf Node and Sdp SubarrayLeaf Node and MCCS SubarrayLeaf Node.

Parameters

argin (Optional[str]) – Optional argument

Return type

Tuple[ResultCode, str]

Returns

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

Module contents