ska_pst.lmc.dsp
This subpackage implements DSP component for PST.LMC.
- class ska_pst.lmc.dsp.DspDiskMonitorData(disk_capacity: int = 9223372036854775807, available_disk_space: int = 9223372036854775807, data_recorded: int = 0, data_record_rate: float = 0.0, available_recording_time: float = 31536000.0, subband_data_recorded: ~typing.List[int] = <factory>, subband_data_record_rate: ~typing.List[float] = <factory>)[source]
A data class to represent the DSP monitoring across all subbands.
This class is used to model the combined subband data for the DSP Disk. Which includes the disk usage and monitoring as well as the current throughput of data.
- Variables
disk_capacity (int) – size, in bytes, for the disk for DSP processing for this beam.
available_disk_space (int) – currently available bytes of the disk.
data_recorded (int) – total amount of bytes written in current scan across all subbands of the beam.
data_record_rate (float) – total rate of writing to disk across all subbands, in bytes/second.
available_recording_time (float) – estimated available recording time left for current scan.
subband_data_recorded (List[int]) – a list of bytes written, one record per subband.
subband_data_record_rate (List[float]) – a list of current rate of writing per subband, in bytes/seconds.
- available_disk_space: int = 9223372036854775807
- available_recording_time: float = 31536000.0
- data_record_rate: float = 0.0
- data_recorded: int = 0
- disk_capacity: int = 9223372036854775807
- disk_used_bytes: int
- disk_used_percentage: float
- subband_data_record_rate: List[float]
- subband_data_recorded: List[int]
- class ska_pst.lmc.dsp.DspDiskMonitorDataStore[source]
Data store used to aggregate the subband data for DSP Disk.
- property monitor_data: DspDiskMonitorData
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
DspDiskMonitorData
object.
- update_disk_stats(disk_capacity: int, available_disk_space: Optional[int] = None, disk_available_bytes: Optional[int] = None, **kwargs: Any) None [source]
Update disk statistics.
The available_disk_space and disk_available_bytes parameters are the same property but both are provided to work around an issue that coming from DSP
- Parameters
disk_capacity (int) – the total disk capacity.
available_disk_space (Optional[int]) – the available amount of disk space.
disk_available_bytes (Optional[int]) – the available amount of disk space.
- class ska_pst.lmc.dsp.DspDiskSubbandMonitorData(disk_capacity: int, available_disk_space: int, data_recorded: int, data_record_rate: float)[source]
A data class to represent a subband monitoring data record.
This class is used to report on a subband specific monitoring data. Each subband will report on the disk capacity and availabile bytes to help with the calculation of available recording time left for the whole beam.
- Variables
disk_capacity (int) – total amount of bytes for the disk used for DSP processing for the beam.
available_disk_space (int) – total currently available bytes of the disk used.
data_recorded (int) – amount of bytes written by the subband in current scan.
data_record_rate (float) – current rate of writing of data to disk for subband.
- available_disk_space: int
- data_record_rate: float
- data_recorded: int
- disk_capacity: int
- class ska_pst.lmc.dsp.DspFlowThroughMonitorData[source]
A data class to represent the DSP.FT monitoring across all subbands.
This class is used to model the combined subband data for the DSP Flow Through.
The monitoring attributes will added in a future PI. For now this is an empty class.
- class ska_pst.lmc.dsp.DspFlowThroughMonitorDataStore[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: DspFlowThroughMonitorData
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
DspFlowThroughMonitorData
object.
- class ska_pst.lmc.dsp.DspFlowThroughSubbandMonitorData[source]
A data class to represent a subband monitoring data record.
This class is used to report on a subband specific monitoring data.
The monitoring attributes will added in a future PI. For now this is an empty class.
- class ska_pst.lmc.dsp.PstDspComponentManager(*args: Any, **kwargs: Any)[source]
A class to handle the orchestration of requests to various DSP sub-components.
This class ensures that given a configure beam request that all future requests will go to the appropriate DSP sub-component until such time that a deconfigure beam request is performed.
- abort() None
Abort current process.
The only long lived process for API based devices is that of SCANNING. However, if another system fails this can be used to put all the subsystems into an ABORTED state.
The CSP.LMC can call abort before the system is in a configured state, if there is not observation mode set then apply abort to all sub-components.
- configure_beam(configuration: dict, **kwargs: Any) None
Configure the beam specific configuration of the component.
- Parameters
configuration (dict) – configuration for beam
- configure_scan(configuration: dict, **kwargs: Any) None
Configure the component for a scan.
- Parameters
configuration (dict) – the configuration to be configured
- connect() None
Establish connection to API components.
- property current_dsp_subcomponent: PstProcessApiSubcomponentManager
Get the current DSP sub-component base on observation mode.
- Raises
AssertionError – if current observation mode is not set or not supported.
- Returns
the currently active DSP subcomponent
- Return type
- deconfigure_beam() None
Deconfigure the component’s beam configuration.
This will release all the resources associated with the component, including the SMRBs.
- deconfigure_scan() None
Deconfigure this component for current scan configuration.
- Parameters
task_callback (Callback) – callback for background processing to update device status.
- disconnect() None
Establish disconnect from API components.
- property dsp_disk_monitor_data: DspDiskMonitorData
Get monitoring data from DSP.DISK.
- property dsp_flow_through_monitor_data: DspFlowThroughMonitorData
Get monitoring data from DSP.FT.
- end_scan() None
Stop scanning.
- go_to_fault(fault_msg: str) None
Set the component into a FAULT state.
For BEAM this will make the sub-devices be put into a FAULT state. For API backed component managers it is expected that the service backing that API should be put into a FAULT state.
- obsreset() None
Reset service.
This is used to reset a service in ABORTED or FAULT states back to an EMPTY state. This will deconfigure a scan and beam.
- reset_monitoring() None
Stop monitoring and reset monitoring data.
- scan(scan_id: int, **kwargs: Any) None
Start scanning.
The kwargs of this method is scan request. By using the kwargs allow for forward compatability of accepting other parameters for the starting of the scan.
- Parameters
scan_id (int) – the scan ID
kwargs (dict) – scan request as a dict
- set_logging_level(log_level: ska_control_model.LoggingLevel) None
Set the LoggingLevel of the service.
- Parameters
log_level – The required TANGO LoggingLevel
- Returns
None.
- validate_configure_scan(configuration: dict, **kwargs: Any) None
Validate configure scan request with the specific configuration of the component.
This checks what the operational mode in the configuration is routes the request to the correct.
- Parameters
configuration (dict) – the configuration to validate.
- class ska_pst.lmc.dsp.PstDspDiskComponentManager(*args: Any, **kwargs: Any)[source]
Component manager for the DSP.DISK component for the PST.LMC subsystem.
- property available_disk_space: int
Get currently available bytes of the disk.
- property available_recording_time: float
Get estimated available recording time left for current scan.
- connect() None
Establish connection to API component.
- property data_record_rate: float
Get total rate of writing to disk across all subbands, in bytes/second.
- property data_recorded: int
Get total amount of bytes written in current scan across all subbands.
- disconnect() None
Disconnect from API component.
- property disk_capacity: int
Get size, in bytes, for the disk for DSP processing for this beam.
- property disk_used_bytes: int
Get amount of bytes used on the disk that DSP is writing to.
- property disk_used_percentage: float
Get the percentage of used disk space that DSP is writing to.
- property subband_data_record_rate: List[float]
Get a list of current rate of writing per subband, in bytes/seconds.
- property subband_data_recorded: List[int]
Get a list of bytes written, one record per subband.
- validate_configure_scan(configuration: dict, **kwargs: Any) None
Validate a ConfigureScan request sent from CSP.LMC to the DSP.DISK sub-component.
This asserts the request can be converted to DSP.DISK 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.
task_callback (Callback) – callback for background processing to update device status.
- class ska_pst.lmc.dsp.PstDspDiskProcessApi(*args: Any, **kwargs: Any)[source]
Abstract class for the API of the DSP process.
This extends from
PstProcessApi
but provides the specific method of getting the monitoring data.
- class ska_pst.lmc.dsp.PstDspDiskProcessApiGrpc(*args: Any, **kwargs: Any)[source]
This is an gRPC implementation of the PstDspDiskProcessApi API.
This uses an instance of a PstGrpcLmcClient to send requests through to the DSP.DISK application. Instances of this class should be per subband, rather than one for all of DSP.DISK as a whole.
- class ska_pst.lmc.dsp.PstDspDiskProcessApiSimulator(*args: Any, **kwargs: Any)[source]
A simulator implementation version of the API of PstDspDiskProcessApi.
- get_env() dict
Get simulated environment values for DSP.DISK.
- class ska_pst.lmc.dsp.PstDspDiskSimulator(*args: Any, **kwargs: Any)[source]
Simulator for the DSP Disk process of the PST.LMC sub-system.
This is used to generate random data and simulate what for the DSP Disk subsystem. This simulator is used for all the subbands. For the LMC state model most methods are no-op operations but when a scan is in process the
get_data()
method will randomly update the monitoring data.For DSP.DISK functionality the following properties can be set: * Total disk size * Availabe disk size * Subband write rates * Subband bytes written
To be able to simulate situation where the disk is near full, or is full, the method
simulate_disk_capacity()
should be called to override the current value.- property available_disk_space: int
Get simulated available bytes left of disk.
- configure_scan(configuration: dict) None
Simulate configuring a scan.
Only the “num_subbands” parameter is used by this simulator.
- Parameters
configuration (dict) – the configuration to be configured
- property disk_capacity: int
Get simulated disk capacity.
- get_data() DspDiskMonitorData [source]
Get current DSP Disk data.
Updates the current simulated data and returns the latest data.
- Returns
current simulated DSP Disk data.
- Return type
- class ska_pst.lmc.dsp.PstDspFlowThroughComponentManager(*args: Any, **kwargs: Any)[source]
Component manager for the DSP.FT component for the PST.LMC subsystem.
- validate_configure_scan(configuration: dict, **kwargs: Any) None
Validate a ConfigureScan request sent from CSP.LMC to the DSP.FT sub-component.
This asserts the request can be converted to DSP.FT 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.
task_callback (Callback) – callback for background processing to update device status.
- class ska_pst.lmc.dsp.PstDspFlowThroughProcessApi(*args: Any, **kwargs: Any)[source]
Abstract class for the API of the DSP process.
This extends from
PstProcessApi
but provides the specific method of getting the monitoring data.
- class ska_pst.lmc.dsp.PstDspFlowThroughProcessApiGrpc(*args: Any, **kwargs: Any)[source]
This is an gRPC implementation of the PstDspFlowThroughProcessApi API.
This uses an instance of a PstGrpcLmcClient to send requests through to the DSP.FT application. Instances of this class should be per subband, rather than one for all of DSP.FT as a whole.
- class ska_pst.lmc.dsp.PstDspFlowThroughProcessApiSimulator(*args: Any, **kwargs: Any)[source]
A simulator implementation version of the API of PstDspFlowThroughProcessApi.
- class ska_pst.lmc.dsp.PstDspFlowThroughSimulator(*args: Any, **kwargs: Any)[source]
Simulator for the DSP Flow Through process of the PST.LMC sub-system.
This is currently a stub to allow the DSP.FT functionality of the LMC to work. When the monitoring attributes are known and how to simulate them then this class will be update.
- configure_scan(configuration: dict) None
Simulate configuring a scan.
Only the “num_subbands” parameter is used by this simulator.
- Parameters
configuration (dict) – the configuration to be configured
- get_data() DspFlowThroughMonitorData [source]
Get current DSP Flow Through data.
Updates the current simulated data and returns the latest data.
- Returns
current simulated DSP Flow Through data.
- Return type
- 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.
request_params – a dictionary of request parameters that is used to configure PST, the specific parameters for DSP are extracted within this method.
- 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", } }