ska_pst.lmc.dsp

This subpackage implements DSP component for PST.LMC.

class ska_pst.lmc.dsp.DspMonitorData(*, disk_capacity: int = 9223372036854775807, available_disk_space: int = 9223372036854775807, data_recorded: int = 0, data_record_rate: float = 0.0, processing_time: float = 0.0, processing_time_percent: float = 0.0, data_time: float = 0.0, bytes_processed: int = 0, bytes_processing_rate: float = 0.0, overall_efficiency: float = 0.0, efficiency: float = 0.0)[source]

A data class to represent the DSPSR pipeline monitoring across all subbands.

This class is used to model the combined subband data for DSPSR pipelines.

available_disk_space: int = 9223372036854775807

Total currently available bytes of the disk used.

available_recording_time: float

Estimated available recording time left for current scan.

This is a calculated as available_disk_space / data_record_rate.

bytes_processed: int = 0

The number of input bytes processed by the pipeline.

bytes_processing_rate: float = 0.0

The data processing rate in bytes per second during the last reporting interval.

data_record_rate: float = 0.0

Current rate of writing of data to disk.

data_recorded: int = 0

Amount of bytes written by current scan.

data_time: float = 0.0

The number of seconds spanned by the data that the pipeline processed.

static default() DspMonitorData[source]

Get a default pipeline monitoring data value.

disk_capacity: int = 9223372036854775807

Total amount of bytes for the disk used for DSP processing for the beam.

disk_used_bytes: int

Total amount of disk spaced used, in bytes.

This is calculated as disk_capacity - available_disk_space

disk_used_percentage: float

The percentage of disk spaced used.

This is calculated as 100.0 * (disk_capacity - available_disk_space)/disk_capacity

efficiency: float = 0.0

The efficiency of the pipeline during the last reporting interval.

static init_fields() set[str][source]

Get the set of data class fields are in the __init__ method.

overall_efficiency: float = 0.0

The overall efficiency of the pipeline.

Efficiency is defined as data_time / processing_time. A value greater than 1.0 means that the pipeline processes data faster than it is received.

processing_time: float = 0.0

The number of seconds the pipeline used to perform signal processing.

processing_time_percent: float = 0.0

The percentage of time used to perform processing of the data during the last reporting interval.

class ska_pst.lmc.dsp.DspMonitorDataStore[source]

Data store used to aggregate the subband data for DSP Flow Through.

This class is a stub at the moment to allow until the monitoring attributes are determined in a future PI.

property monitor_data: DspMonitorData

Get current monitoring data for DSP.

This returns the latest monitoring data calculated from the current subband data. If no subband data is available then the response is a default DspMonitorData object.

update_disk_stats(disk_capacity: int, available_disk_space: int, **kwargs: Any) None[source]

Update disk statistics.

Parameters
  • disk_capacity (int) – the total disk capacity.

  • available_disk_space (int) – the available amount of disk space left.

class ska_pst.lmc.dsp.PstDspComponentManager(*args: Any, **kwargs: Any)[source]

Component manager for the DSP component for the PST.LMC subsystem.

validate_configure_scan(configuration: dict) None

Validate a ConfigureScan request sent from CSP.LMC to the DSP sub-component.

This asserts the request can be converted to DSP resources and then calls the process API to perform the validation.

Parameters

configuration (dict) – configuration that would be used when the configure_beam and configure_scan methods are called.

class ska_pst.lmc.dsp.PstDspGrpcApiStrategy[source]

Implementation of the GrpcApiStrategy for the DSP subcomponent.

get_beam_configuration_msg(*, configuration: dict) ska_pst.grpc.lmc.ska_pst_lmc_pb2.BeamConfiguration[source]

Get the gRPC BeamConfiguration Protobuf message for DSP.

Parameters

configuration (dict) – the PST beam configuration

Returns

the gRPC BeamConfiguration Protobuf message for DSP.

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 DSP.

Parameters

configuration (dict) – the PST scan configuration

Returns

the gRPC ScanConfiguration Protobuf message for DSP.

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.dsp.PstDspSimulator(*args: Any, **kwargs: Any)[source]

Simulator for the DSP process of the PST.LMC sub-system.

This is currently a stub to allow the DSP functionality of the LMC to work. When the monitoring attributes are known and how to simulate them then this class will be updated.

property available_disk_space: int

Get simulated available bytes left of disk.

configure_scan(configuration: dict) None

Simulate configuring a scan.

Parameters

configuration (dict) – the configuration to be configured

property disk_capacity: int

Get simulated disk capacity.

get_data() DspMonitorData[source]

Get current DSP data.

Updates the current simulated data and returns the latest data.

Returns

current simulated DSP data.

Return type

DspMonitorData

get_env() dict

Simulate the disk environment.

This gets the disk capacity and available disk space.

ska_pst.lmc.dsp.calculate_bytes_per_second(nchan_out: int, npol_out: int, nbit_out: int, ndim_out: int, tsamp: float, **kwargs: Any) float[source]

Calculate the expected bytes per second value given output parameters.

Parameters
  • nchan_out (int) – the number of output channels

  • npol_out (int) – the number of output polarisations

  • nbit_out (int) – the bits per value in the output data

  • ndim_out (int) – the number of dimensions of a value in the output data. This should be 1 or 2 depending on real or complex data.

  • tsamp (float) – the sampling interval, in microseconds, for each sample of data.

Returns

the expected bytes per second value given output parameters.

Return type

float

ska_pst.lmc.dsp.calculate_dsp_subband_resources(beam_id: int, **kwargs: Any) Dict[int, dict][source]

Calculate the digital signal processing (DSP) resources from request.

This is a common method to map a CSP JSON request to the appropriate DSP parameters. It is also used to calculate the specific subband resources.

This uses the SMRB generate_data_key(), generate_weights_key() functions to calculate the keys for the data and weight ring buffers that the DSP process will read from.

Parameters

beam_id – the numerical id of the beam that this DSP request is for.

Returns

a dict of dicts, with the top level key being the subband id, while the second level is the specific parameters. An example would response is as follows:

{
    1: {
        'data_key': "a000",
        'weights_key': "a010",
    }
}

ska_pst.lmc.dsp.generate_dsp_scan_request(eb_id: str, pst_processing_mode: ska_control_model.PstProcessingMode, **kwargs: Any) dict[source]

Generate a DSP scan request dictionary.

This method delegates to a specific implementation depending on the given pst_processing_mode.

This method currently supports voltage recorder, flow through and detected filterbank processing modes.

Parameters
  • eb_id (str) – the execution block id of the request.

  • pst_processing_mode (PstProcessingMode) – the requested PST processing mode.

Raises

AssertionError – raised for any unsupported PST processing modes.

Returns

a DSP scan request dictionary.

Return type

dict