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 checksum_failure_packet_rate: float
Get the current rate of packets with a checksum failure in packets/sec.
- Returns
the current rate of packets with a checksum failure in packets/seconds.
- Return type
float
- property checksum_failure_packets: int
Get the total number of packets with a checksum failure in current scan.
Total number of packets with a UDP, IP header or CRC checksum failure.
- Returns
the total number of packets with a checksum failure in current scan.
- Return type
int
- property data_drop_rate: float
Get the current rate of CBF ingest data being dropped or lost by the receiving proces.
- Returns
current rate of CBF ingest data being dropped or lost in MB/s.
- Return type
float
- property data_dropped: int
Get the total number of bytes dropped in the current scan.
- Returns
total number of bytes dropped in the current scan in Bytes.
- Return type
int
- property data_host: str
Get data host used for receiving data during a scan.
- Returns
the data host used for receiving data during a scan.
- Return type
str
- property data_receive_rate: float
Get the current data receive rate from the CBF interface.
- Returns
current data receive rate from the CBF interface in Gb/s.
- Return type
float
- property data_received: int
Get the total amount of data received from CBF interface for current scan.
- Returns
total amount of data received from CBF interface for current scan in Bytes
- Return type
int
- deconfigure_beam() None
Deconfigure the RECV component’s beam configuration.
- Parameters
task_callback (Callback) – callback for background processing to update device status.
- property malformed_packet_rate: float
Get the current rate of malformed packets in packets/sec.
- Returns
the current rate of malformed packets in packets/seconds.
- Return type
float
- property malformed_packets: int
Get the total number of packets marked as malformed for the current scan.
Malformed packets are valid UDP packets, but where contents of the UDP payload does not conform to the specification in the CBF/PST ICD. Examples of malformation include: bad magic-word field, invalid meta-data, incorrect packet size.
- Returns
total number of packets marked as malformed for the current scan.
- Return type
int
- property misdirected_packet_rate: float
Get the current rate of misdirected packets in packets/sec.
- Returns
the current rate of misdirected packets in packets/seconds.
- Return type
float
- property misdirected_packets: int
Get the total of misdirected packets received during current scan.
Total number of (valid) UDP packets that were unexpectedly received. Misdirection could be due to wrong ScanID, Beam ID, Network Interface or UDP port. Receiving misdirected packets is a sign that there is something wrong with the upstream configuration for the scan.
- Returns
the total of misdirected packets received during current scan.
- Return type
int
- property misordered_packet_rate: float
Get the rate of packets that are received out of order in packets/sec.
- Returns
the rate of packets that are received out of order in packets/sec.
- Return type
float
- property misordered_packets: int
Get the total number of packets received out of order in the current scan.
- Returns
total number of packets received out of order in the current scan.
- Return type
int
- property seq_number_sync_error_packet_rate: float
Get current rate of packets marked as having a sequence number sync error in packets/sec.
- Returns
current rate of packets marked as having a sequence number sync error in packets/seconds.
- Return type
float
- property seq_number_sync_error_packets: int
Get total number of packets with a sequence number sync error for current scan.
The number of packets received where the packet sequence number has become desynchronised with the data rate and elapsed time.
- Returns
total number of packets with a sequence number sync error for current scan.
- Return type
int
- 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 data ports used by all the subbands for receiving data during a scan.
- Returns
the data host used for receiving data during a scan.
- Return type
str
- property timestamp_sync_error_packet_rate: float
Get the current rate of packets marked as having a timestamp sync error in packets/sec.
- Returns
the current rate of packets marked as having a timestamp sync error in packets/seconds.
- Return type
float
- property timestamp_sync_error_packets: int
Get the total number of packets with a timestamp sync error for current scan.
The number of packets received where the timestamp has become desynchronised with the packet sequence number * sampling interval
- Returns
the total number of packets with a timestamp sync error for current scan.
- Return type
int
- validate_configure_scan(configuration: dict, **kwargs: Any) 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.
task_callback (Callback) – callback for background processing to update device status.
- class ska_pst.lmc.receive.PstReceiveProcessApi(*args: Any, **kwargs: Any)[source]
Abstract class for the API of the RECV process.
This extends from
PstProcessApi
but provides the specific method of getting the monitoring data.
- class ska_pst.lmc.receive.PstReceiveProcessApiGrpc(*args: Any, **kwargs: Any)[source]
This is an gRPC implementation of the PstReceiveProcessApi.
This uses an instance of a PstGrpcLmcClient to send requests through to the RECV.CORE application. Instances of this class should be per subband, rather than one for all of RECV as a whole.
- class ska_pst.lmc.receive.PstReceiveProcessApiSimulator(*args: Any, **kwargs: Any)[source]
A simulator implementation version of the API of PstReceiveProcessApi.
- get_env() dict
Get simulated environment values for RECV.CORE.
This returns the following:
data_host = ‘127.0.0.1’
data_port = 32080
- 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.
Only the “nchan” parameter is used by this simulator.
- 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
- 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)[source]
A data class to transfer current RECV data between the process and the component manager.
- Variables
data_received (int) – amount of data received during current scan, in bytes.
data_receive_rate (float) – the rate of data received during current scan, in Gb/s.
data_dropped (int) – amount of data dropped during current scan, in bytes.
data_drop_rate (float) – the rate of data dropped during current scan, in Bytes/s.
misordered_packets (int) – the number of misordered packets received during current scan.
malformed_packets (int) – the total number of malformed packets during current scan.
malformed_packet_rate (float) – the current rate of malformed packets.
misdirected_packets (int) – the total of misdirected packets for current scan. These are valid packets but not for the current beam, subband, and/or scan.
misdirected_packet_rate (float) – the current rate of misdirected packets.
checksum_failure_packets (int) – the total number of network interface with either a UDP, IP header or CRC checksum failure.
checksum_failure_packet_rate (float) – the current rate of packets with a checksum failure.
timestamp_sync_error_packets (int) – the total number of packets received where the timestamp has become desynchronised with the packet sequence number * sampling interval.
timestamp_sync_error_packet_rate (float) – the current rate of packets with timestamp sync error.
seq_number_sync_error_packets (int) – the total number of packets received where the packet sequence number has become desynchronised with the data rate and elapsed time.
seq_number_sync_error_packet_rate (float) – the current rate of packets with a sequence number sync error.
- checksum_failure_packet_rate: float = 0.0
- checksum_failure_packets: int = 0
- data_drop_rate: float = 0.0
- data_dropped: int = 0
- data_receive_rate: float = 0.0
- data_received: int = 0
- malformed_packet_rate: float = 0.0
- malformed_packets: int = 0
- misdirected_packet_rate: float = 0.0
- misdirected_packets: int = 0
- misordered_packet_rate: float = 0.0
- misordered_packets: int = 0
- seq_number_sync_error_packet_rate: float = 0.0
- seq_number_sync_error_packets: int = 0
- timestamp_sync_error_packet_rate: float = 0.0
- timestamp_sync_error_packets: int = 0
- ska_pst.lmc.receive.calculate_receive_common_resources(beam_id: int, request_params: dict) 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 such as the bytes_per_second used in DSP.
- Parameters
request_params – a dictionary of request parameters that is used to configure PST, the specific parameters for RECV are extracted within this method.
- ska_pst.lmc.receive.calculate_receive_packet_resources(request_params: dict) 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. The ska_pst_lmc.dsp subpackage needs the bytes_per_second which is a receive packet specific value but doesn’t need the rest of common params. Adding the beam_id now requires the default beam_id to be passed in which causes issues in DSP component code.
- Parameters
request_params – a dictionary of request parameters that is used to configure PST RECV.
- ska_pst.lmc.receive.calculate_receive_subband_resources(beam_id: int, request_params: dict, data_host: str, subband_udp_ports: List[int], **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
request_params – a dictionary of request parameters that is used to configure PST, the specific parameters for RECV are extracted within this method.
data_host (str) – the data host IP in which the data will be received on.
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.
- 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", ... } } }
- ska_pst.lmc.receive.generate_random_update() ReceiveData [source]
Generate a random update of ReceivedData.