ska_pst.lmc.receive
This subpackage implements RECV component for PST.LMC.
- class ska_pst.lmc.receive.PstReceiveComponentManager(*args: Any, **kwargs: Any)[source]
Component manager for the RECV component for the PST.LMC subsystem.
- property data_host: str
Get the IP address of the NIC used for receiving data during a scan.
- Returns
the IP address of the NIC used for receiving data during a scan.
- Return type
str
- property data_mac: str
Get the MAC address corresponding to the data_host.
- Returns
the MAC address corresponding to the data_host.
- Return type
str
- deconfigure_beam() None
Deconfigure the RECV component’s beam configuration.
- Parameters
task_callback (Callback) – callback for background processing to update device status.
- property subband_beam_configuration: dict
Get the current subband beam configuration.
This is the current subband beam configuration that is calculated during the configure_beam.
- Returns
the current subband beam configuration.
- Return type
dict
- property subband_udp_ports: List[int]
Get the port numbers used by all the subbands for receiving data during a scan.
- Returns
the port numbers used by all the subbands for receiving data during a scan.
- Return type
List[int]
- validate_configure_scan(configuration: dict) None
Validate a ConfigureScan request sent from CSP.LMC to for the RECV sub-component.
If this command fails it will ensure then a call to either ConfigureBeam or ConfigureScan would have failed leaving the BEAM in an invalid state.
- Parameters
configuration (dict) – configuration that would be used when the configure_beam and configure_scan methods are called.
- class ska_pst.lmc.receive.PstReceiveGrpcApiStrategy[source]
Implementation of the GrpcApiStrategy for the RECV subcomponent.
- get_beam_configuration_msg(*, configuration: dict) ska_pst.grpc.lmc.ska_pst_lmc_pb2.BeamConfiguration[source]
Get the gRPC BeamConfiguration Protobuf message for RECV.
- Parameters
configuration (dict) – the PST beam configuration
- Returns
the gRPC BeamConfiguration Protobuf message for RECV.
- Return type
BeamConfiguration
- get_scan_configuration_msg(*, configuration: dict) ska_pst.grpc.lmc.ska_pst_lmc_pb2.ScanConfiguration[source]
Get the gRPC ScanConfiguration Protobuf message for RECV.
- Parameters
configuration (dict) – the PST scan configuration
- Returns
the gRPC ScanConfiguration Protobuf message for RECV.
- Return type
ScanConfiguration
- handle_monitor_response(*, data: ska_pst.grpc.lmc.ska_pst_lmc_pb2.MonitorData, callback: MonitorDataCallback) None[source]
Handle the gRPC monitoring data response.
- Parameters
data (MonitorData) – the gRPC/Protobuf monitoring data message from server
callback (MonitorDataCallback) – the callback used to update the LMC subcomponent model
- class ska_pst.lmc.receive.PstReceiveSimulator(*args: Any, **kwargs: Any)[source]
Simulator for the RECV process of the PST.LMC sub-system.
This is used to generate random data and simulate what happens during the RECV process. Current implementation has this internally with the TANGO device but future improvements will have this as a separate process and the TANGO will connect via an API.
- configure_scan(configuration: dict) None
Simulate configuring a scan.
- Parameters
configuration (dict) – the configuration to be configured
- get_data() ReceiveData[source]
Get current RECV data.
Updates the current simulated data and returns the latest data.
- Returns
current simulated RECV data.
- Return type
- get_env() dict
Get simulated environment values for RECV.CORE.
This returns the following:
data_host = ‘127.0.0.1’
data_mac = ‘01:23:45:ab:cd:ef’,
data_port = 32080
- class ska_pst.lmc.receive.ReceiveData(data_received: int = 0, data_receive_rate: float = 0.0, data_dropped: int = 0, data_drop_rate: float = 0.0, misordered_packets: int = 0, misordered_packet_rate: float = 0.0, malformed_packets: int = 0, malformed_packet_rate: float = 0.0, misdirected_packets: int = 0, misdirected_packet_rate: float = 0.0, checksum_failure_packets: int = 0, checksum_failure_packet_rate: float = 0.0, timestamp_sync_error_packets: int = 0, timestamp_sync_error_packet_rate: float = 0.0, seq_number_sync_error_packets: int = 0, seq_number_sync_error_packet_rate: float = 0.0, invalid_polarisation_correction_packets: int = 0, invalid_polarisation_correction_packet_rate: float = 0.0, invalid_station_beam_packets: int = 0, invalid_station_beam_packet_rate: float = 0.0, invalid_pst_beam_packets: int = 0, invalid_pst_beam_packet_rate: float = 0.0, percentage_data_received: float = 0.0, percentage_valid_station_beam: float = 0.0, percentage_valid_pst_beam: float = 0.0, percentage_valid_polarisation_correction: float = 0.0)[source]
A data class to represent RECV monitoring across all subbands.
This class is used to model the combined subband data RECV subcomponent.
- checksum_failure_packet_rate: float = 0.0
The current rate of packets with a checksum failure, in packets/s.
- checksum_failure_packets: int = 0
The total number of network interface with either a UDP, IP header or CRC checksum failure.
- data_drop_rate: float = 0.0
The rate of data dropped during current scan, in bytes/s.
- data_dropped: int = 0
The amount of data dropped during current scan, in bytes.
- data_receive_rate: float = 0.0
The rate of data received during current scan, in Gb/s.
- data_received: int = 0
The amount of data received during current scan, in bytes.
- invalid_polarisation_correction_packet_rate: float = 0.0
The current rate of packets with a sequence number sync error, in packets/s.
- invalid_polarisation_correction_packets: int = 0
The number of packets received where no valid Jones polarisation corrections have been applied.
- invalid_pst_beam_packet_rate: float = 0.0
The number of packets received per second where no valid PST beam delay polynomials have been applied, in packets/s.
- invalid_pst_beam_packets: int = 0
The number of packets received where no valid PST beam delay polynomials have been applied.
- invalid_station_beam_packet_rate: float = 0.0
The number of packets received per second where no valid Jones polarisation corrections have been applied, in packets/s.
- invalid_station_beam_packets: int = 0
The number of packets received where no valid station beam delay polynomials have been applied.
- malformed_packet_rate: float = 0.0
The current rate of malformed packets, in packets/s.
- malformed_packets: int = 0
The total number of malformed packets received during current scan.
- misdirected_packet_rate: float = 0.0
The current rate of misdirected packets, in packets/s.
- misdirected_packets: int = 0
The total of misdirected packets for current scan.
These are valid packets but not for the current beam, subband, and/or scan.
- misordered_packet_rate: float = 0.0
The current rate of misordered packets, in packets/s.
- misordered_packets: int = 0
The number of misordered packets received during current scan.
- percentage_data_received: float = 0.0
The current amount of CBF data received as a percentage of the total CBF data expected.
- percentage_valid_polarisation_correction: float = 0.0
The percentage of CBF data received that has validity flag set for Jones polarisation corrections.
- percentage_valid_pst_beam: float = 0.0
The percentage of CBF data received that has validity flag set for pst beam delay polynomials.
- percentage_valid_station_beam: float = 0.0
The percentage of CBF data received that has validity flag set for station beam delay polynomials.
- seq_number_sync_error_packet_rate: float = 0.0
The current rate of packets with a sequence number sync error, in packets/s.
- seq_number_sync_error_packets: int = 0
The total number of packets received where the packet sequence number has become desynchronised with the data rate and elapsed time.
- timestamp_sync_error_packet_rate: float = 0.0
The current rate of packets with timestamp sync error, in packets/s.
- timestamp_sync_error_packets: int = 0
The total number of packets received where the timestamp has become desynchronised with the packet sequence number * sampling interval.
- ska_pst.lmc.receive.calculate_receive_common_resources(centre_freq_mhz: float, bandwidth_mhz: float, cbf_pst_config: CbfPstConfig, receiver_id: str, receptors: list[str], receptor_weights: list[float], timing_beam_id: str, **kwargs: Any) dict[source]
Calculate the RECV common resources.
This method has been refactored out of calculate_receive_subband_resources as there are parameters that are calculated that can be reused in other areas.
- Parameters
centre_freq_mhz (float) – the centre frequency of the scan request, in MHz.
bandwidth_mhz (float) – the bandwidth of the scan request, in MHz.
cbf_pst_config (CbfPstConfig) – CBF/PST configuration.
receiver_id (str) – the id/name of the receiver used for the scan request.
receptors (list[str]) – the list of receptors the scan is for.
receptor_weights (list[float]) – the relative weights of the receptors.
timing_beam_id (str) – the id of the beam that is being configured
- Returns
a dictionary of the common RECV.CORE parameters.
- Return type
dict
- ska_pst.lmc.receive.calculate_receive_packet_resources(bandwidth_mhz: float, cbf_pst_config: CbfPstConfig, **kwargs: Any) dict[source]
Calculate RECV packet values.
This method has been refactored out of calculate_receive_common_resources the common did 2 things: a) calculate receive packet specific values, and b) overall scan configuration.
- Parameters
bandwidth_mhz (float) – the requested total (critical) bandwidth, in MHz.
cbf_pst_config (FrequencyBandConfig) – the frequency band configuration for the current request.
- Returns
a dictionary containing parameters that are used by RECV.CORE
- Return type
dict
- ska_pst.lmc.receive.calculate_receive_subband_resources(*, beam_id: int, bandwidth_mhz: float, centre_freq_mhz: float, data_host: str, data_mac: str, subband_udp_ports: list[int], cbf_pst_config: CbfPstConfig, **kwargs: Any) dict[source]
Calculate the RECV resources for all subbands from request.
This is a common method to map a CSP JSON request to the appropriate RECV.CORE parameters. It is also used to calculate the specific subband resources.
- Parameters
beam_id (int) – the id of the beam the request is for
bandwidth_mhz (float) – the total bandwidth for the scan, in MHz
centre_freq_mhz (float) – the centre frequency for the scan, in MHz
data_host (str) – the IP address at which data will be received.
data_mac (str) – the MAC address corresponding to the data_host.
subband_udp_ports (list[int]) – a list of UDP ports for each of the subbands. Max length is 4 given there is a maximum of 4 subbands.
cbf_pst_config (CbfPstConfig) – the CBF/PST configuration for the current request
- Returns
a dict of dicts, with “common” and “subbands” as the top level keys. The common values comes from the
calculate_receive_common_resources()function. The subbands is a dict of dicts with subband ids as the keys, while the second level is the specific parameters. An example would response is as follows:{ "common": { "nchan": nchan, "nsubband": 1, ... }, "subbands": { 1: { "data_key": "a000", "weights_key": "a010", ... } } }
- Return type
dict
- ska_pst.lmc.receive.generate_random_update() ReceiveData[source]
Generate a random update of ReceivedData.