ska_pst.lmc.beam

This subpackage implements BEAM component for PST.LMC.

class ska_pst.lmc.beam.PstBeam(*args: Any, **kwargs: Any)[source]

A logical TANGO device representing a Beam Capability for PST.LMC.

Properties:

  • Device Property
    RecvProcessApiEndpoint
    • Type:’DevString’

    SmrbProcessApiEndpoint
    • Type:’DevString’

    DspProcessApiEndpoint
    • Type:’DevString’

    StatProcessApiEndpoint
    • Type:’DevString’

    ScanOutputDirPattern
    • Type:’DevString’

class ConfigureScanCommand(*args: Any, **kwargs: Any)[source]

A class for the ObsDevice ConfigureScan command.

This overrides the base validator to proxy the request to the BEAM component manager that will in turn validate the request against the CORE apps.

always_executed_hook() None[source]

Execute call before any TANGO command is executed.

availableDiskSpace() int

Available space on the disk that the PST.BEAM is writing to.

Returns

available space on the disk that PST.BEAM is writing to, in bytes.

Return type

int

availableRecordingTime() float

Get available time, in seconds, for writing available.

Returns

available time, in seconds, for writing available.

Return type

float

channelBlockConfiguration() str

Get the channel block configuration.

This is a JSON serialised string of the channel block configuration that is calculated during the ConfigureScan command. This configuration has the number of channel blocks and a list of channel blocks, within the channel block it has the following fields:

  • destination_host - the IPv4 destination address for the packets in the channel block

  • destination_port - destination port number for the packets in the channel block

  • destination_mac - destination MAC address for the packets in the channel block

  • start_pst_channel - The starting PST channel number

  • num_channels - The number of PST channels num_channels

  • start_pst_frequency - the centre frequency, in Hz, of the first PST channel

The block of channel numbers in the range of from start_pst_channel through to start_pst_channel + num_channels - 1, this can be thought of as a range in the form of inclusive of the lower number and exclusive of the higher number (e.g [1, 21) would be a range of 20 channels starting from 1 and ending at channel block 20 (inclusive).

Both the IPv4 and MAC address are provided so that the CBF doesn’t have to perform an Address Resolution Protocol (ARP) request.

{
    "num_channel_blocks": 2,
    "channel_blocks": [
        {
            "destination_host": "10.10.0.1",
            "destination_port": 20000,
            "destination_mac": "01:23:45:ab:cd:ef",
            "start_pst_channel": 0,
            "num_channels": 12,
            "start_pst_frequency": 49609375.0
        },
        {
            "destination_host": "10.10.0.1",
            "destination_port": 20001,
            "destination_mac": "01:23:45:ab:cd:ef",
            "start_pst_channel": 12,
            "num_pst_channels": 10,
            "start_pst_frequency": 49652778.0
    ]
}
Returns

the channel block configuration as a JSON string.

Return type

str

checksumFailurePacketRate() float

Get the current rate of packets with checksum failures.

Returns

the current rate of packets with checksum failures in packets/seconds.

Return type

float

checksumFailurePackets() int

Get the total number of packets with checksum failures for current scan.

Returns

the total number of packets with checksum failures for current scan.

Return type

int

create_component_manager() PstBeamComponentManager[source]

Create and return a component manager for this device.

Returns

a component manager for this device.

dataDropRate() float

Get the current rate of CBF ingest data being dropped or lost by the receiving process.

Returns

current rate of CBF ingest data being dropped or lost in Bytes/s.

Return type

float

dataDropped() int

Get the total number of bytes dropped in the current scan.

Returns

total number of bytes dropped in the current scan.

Return type

int

dataReceiveRate() 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

dataReceived() 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

dataRecordRate() float

Get current rate of writing to the disk.

Returns

use space on the disk that PST.BEAM is writing to, in bytes.

Return type

float

dataRecorded() int

Get number of bytes written during scan.

Returns

number of bytes written during scan.

Return type

int

delete_device() None[source]

Delete resources allocated in init_device.

This method allows for any memory or other resources allocated in the init_device method to be released. This method is called by the device destructor and by the device Init command.

diskCapacity() int

Total capacity of the disk that DSP is writing to.

Returns

total capacity of the disk that DSP is writing to, in bytes.

Return type

int

diskUsedBytes() int

Get used space on the disk that DSP is writing to.

This is diskCapacity - availableDiskSpace.

Returns

used space on the disk that DSP is writing to, in bytes.

Return type

int

diskUsedPercentage() float

Get used space on the disk that DSP is writing to.

This is 100.0 * (diskCapacity - availableDiskSpace)/diskCapacity.

Returns

used space on the disk that DSP is writing to as a percentage.

Return type

float

dspBytesProcessed() int

Get bytes_processed.

dspBytesProcessingRate() float

Get bytes_processing_rate.

dspDataTime() float

Get data_time.

dspEfficiency() float

Get efficiency.

dspHealthState() ska_control_model.HealthState

Get the current health state for the DSP subcomponent.

Returns

the current health state for the DSP subcomponent.

Return type

HealthState

dspObsState() ska_control_model.ObsState

Get the current observing state for the DSP subcomponent.

Returns

the current observing state for the DSP subcomponent.

Return type

ObsState

dspOverallEfficiency() float

Get overall_efficiency.

dspProcessingTime() float

Get processing_time.

dspProcessingTimePercent() float

Get processing_time_percent.

property dsp_process_api_endpoint: str

Get the gRPC process API endpoint for DSP.

expectedDataRecordRate() float

Get the expected rate of data to be received by PST Beam component.

Returns

the expected rate of data to be received by PST Beam component.

Return type

float

handle_attribute_value_update(attribute_name: str, value: Any) None[source]

Handle update of a device attribute value.

Parameters
  • attribute_name (str) – the name of the attribute to update.

  • value (Any) – the new value of the attribute to update to.

healthCheckInterval(health_check_interval: int) None

Update the health check polling interval.

If this value is different to the currently configured health check interval, the current health check background tasks will be stopped and restarted with the new interval.

Parameters

health_check_interval (int) – the new health check interval to use for background health check of core applications, in milliseconds.

property health_check_interval: int

Get the health check interval, in milliseconds.

This is a pure Python property to allow the BEAM component manager to get it from the TANGO device via the PstBeamDeviceInterface interface class.

imagPolAMeanFreqAvg() float

Get the mean of the imaginary data for pol A, averaged over all channels.

imagPolAMeanFreqAvgRfiExcised() float

Get the mean of the imaginary data for pol A, averaged over channels not flagged for RFI.

imagPolANumClippedSamples() int

Get the num of clipped samples of the imaginary data for pol A.

imagPolANumClippedSamplesRfiExcised() int

Get the num of clipped samples of the imaginary data for pol A in channels not flagged for RFI.

imagPolAVarianceFreqAvg() float

Get the variance of the imaginary data for pol A, averaged over all channels.

imagPolAVarianceFreqAvgRfiExcised() float

Get the variance of the imaginary data for pol A, averaged over channels not flagged for RFI.

imagPolBMeanFreqAvg() float

Get the mean of the imaginary data for pol B, averaged over all channels.

imagPolBMeanFreqAvgRfiExcised() float

Get the mean of the imaginary data for pol B, averaged over channels not flagged for RFI.

imagPolBNumClippedSamples() int

Get the num of clipped samples of the imaginary data for pol B.

imagPolBNumClippedSamplesRfiExcised() int

Get the num of clipped samples of the imaginary data for pol B in channels not flagged for RFI.

imagPolBVarianceFreqAvg() float

Get the variance of the imaginary data for pol B, averaged over all channels.

imagPolBVarianceFreqAvgRfiExcised() float

Get the variance of the imaginary data for pol B, averaged over channels not flagged for RFI.

init_device() None[source]

Initialise the attributes and properties of the PstBeam.

This overrides the SKABaseDevice.

invalidPolarisationCorrectionPacketRate() float

Get rate of packets where no valid Jones polarisation corrections have been applied in packets/sec.

Returns

rate of packets where no valid Jones polarisation corrections have been applied in packets/sec.

Return type

float

invalidPolarisationCorrectionPackets() int

Get the number of packets received where no valid Jones polarisation corrections have been applied.

Returns

the number of packets received where no valid Jones polarisation corrections have been applied.

Return type

int

invalidPstBeamPacketRate() float

Get current rate of packets where no valid PST beam delay polynomials have been applied in packets/sec.

Returns

current rate of packets where no valid PST beam delay polynomials have been applied in packets/sec.

Return type

float

invalidPstBeamPackets() float

Get the number of packets received where no valid PST beam delay polynomials have been applied.

Returns

the number of packets received where no valid PST beam delay polynomials have been applied.

Return type

int

invalidStationBeamPacketRate() float

Get current rate of packets where no valid station beam delay polynomials have been applied in packets/sec.

Returns

current rate of packets where no valid station beam delay polynomials have been applied in packets/sec.

Return type

float

invalidStationBeamPackets() int

Get the number of packets received where no valid station beam delay polynomials have been applied.

Returns

the number of packets received where no valid station beam delay polynomials have been applied.

Return type

int

malformedPacketRate() float

Get current rate of malformed packets.

Returns

current rate of malformed packets in packets/seconds.

Return type

float

malformedPackets() int

Get the total number of packets marked as malformed for current scan.

Returns

the total number of packets marked as malformed for current scan.

Return type

int

misdirectedPacketRate() float

Get the current rate of misdirected packets.

Returns

the current rate of misdirected packets in packets/seconds.

Return type

float

misdirectedPackets() int

Get the total number of packets as marked as misdirected for current scan.

Returns

the total number of packets as marked as misdirected for current scan.

Return type

int

misorderedPacketRate() float

Get the current rate of misordered packets.

Returns

the current rate of misordered packets in packets/seconds.

Return type

float

misorderedPackets() 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

monitoringPollingRate(monitoring_polling_rate_ms: int) None

Update the monitoring polling rate.

property monitoring_polling_rate_ms: int

Get the monitoring polling rate.

percentageDataReceived() int

Get current amount of CBF data received as a percentage of the total CBF data expected.

Returns

percentage of data received.

Return type

float

percentageValidPolarisationCorrection() int

Get current percentage of CBF data received with valid polarisation correction flags.

Returns

percentage of data with valid polarisation correction flags.

Return type

float

percentageValidPstBeam() int

Get current percentage of CBF data received with valid pst beam flags.

Returns

percentage of data with valid pst beam flags.

Return type

float

percentageValidStationBeam() int

Get current percentage of CBF data received with valid station beam flags.

Returns

percentage of data with valid station beam flags.

Return type

float

processingMode() str

Get the current processing mode that PST is configured for.

This method is deprecated, use pstProcessingMode instead. If the BEAM is not in a scan configured state, this will return “IDLE”.

pstProcessingMode() str

Get the current processing mode that PST is configured for.

If the BEAM is not in a scan configured state, this will return “IDLE”.

realPolAMeanFreqAvg() float

Get the mean of the real data for pol A, averaged over all channels.

realPolAMeanFreqAvgRfiExcised() float

Get the mean of the real data for pol A, averaged over channels not flagged for RFI.

realPolANumClippedSamples() int

Get the num of clipped samples of the real data for pol A.

realPolANumClippedSamplesRfiExcised() int

Get the num of clipped samples of the real data for pol A in channels not flagged for RFI.

realPolAVarianceFreqAvg() float

Get the variance of the real data for pol A, averaged over all channels.

realPolAVarianceFreqAvgRfiExcised() float

Get the variance of the real data for pol A, averaged over channels not flagged for RFI.

realPolBMeanFreqAvg() float

Get the mean of the real data for pol B, averaged over all channels.

realPolBMeanFreqAvgRfiExcised() float

Get the mean of the real data for pol B, averaged over channels not flagged for RFI.

realPolBNumClippedSamples() int

Get the num of clipped samples of the real data for pol B.

realPolBNumClippedSamplesRfiExcised() int

Get the num of clipped samples of the real data for pol B in channels not flagged for RFI.

realPolBVarianceFreqAvg() float

Get the variance of the real data for pol B, averaged over all channels.

realPolBVarianceFreqAvgRfiExcised() float

Get the variance of the real data for pol B, averaged over channels not flagged for RFI.

recvHealthState() ska_control_model.HealthState

Get the current health state for the RECV subcomponent.

Returns

the current health state for the RECV subcomponent.

Return type

HealthState

recvObsState() ska_control_model.ObsState

Get the current observing state for the RECV subcomponent.

Returns

the current observing state for the RECV subcomponent.

Return type

ObsState

property recv_process_api_endpoint: str

Get the gRPC process API endpoint for RECV.CORE.

ringBufferUtilisation() float

Get the percentage of the ring buffer elements that are full of data.

Returns

the percentage of the ring buffer elements that are full of data.

Return type

float

property scan_output_dir_pattern: str

Get the pattern for directory used for scan output files.

seqNumberSyncErrorPacketRate() float

Get the current rate of packets with a sequence number sync error.

Returns

the current rate of packets with a sequence number sync error in packets/seconds.

Return type

float

seqNumberSyncErrorPackets() int

Get the total number of packets with a seq num sync error in current scan.

Returns

the total number of packets with a seq num sync error in current scan.

Return type

int

smrbHealthState() ska_control_model.HealthState

Get the current health state for the SMRB subcomponent.

Returns

the current health state for the SMRB subcomponent.

Return type

HealthState

smrbObsState() ska_control_model.ObsState

Get the current observing state for the SMRB subcomponent.

Returns

the current observing state for the SMRB subcomponent.

Return type

ObsState

property smrb_process_api_endpoint: str

Get the gRPC process API endpoint for SMRB.CORE.

statHealthState() ska_control_model.HealthState

Get the current health state for the STAT subcomponent.

Returns

the current health state for the STAT subcomponent.

Return type

HealthState

statObsState() ska_control_model.ObsState

Get the current observing state for the STAT subcomponent.

Returns

the current observing state for the STAT subcomponent.

Return type

ObsState

property stat_process_api_endpoint: str

Get the gRPC process API endpoint for STAT.CORE.

timestampSyncErrorPacketRate() float

Get the current rate of packets with a timestamp sync error.

Returns

the current rate of packets with a timestamp sync error in packets/seconds.

Return type

float

timestampSyncErrorPackets() int

Get the total number of packets with a timestamp sync error for current scan.

Returns

the total number of packets with a timestamp sync error for current scan.

Return type

int

update_obs_mode(obs_mode: ska_control_model.ObsMode) None[source]

Update the observation mode of the device.

When the device has been configured for a scan it should be put into PULSAR_TIMING.

When the device is in an IDLE state the observation mode should be set to IDLE too.

When PST supports VLBI and the beam has been configured for VLBI then the observation mode should be set to VLBI not PULSAR_TIMING

Parameters

obs_mode (ObsMode) – the observation mode enum value.

class ska_pst.lmc.beam.PstBeamComponentManager(*args: Any, **kwargs: Any)[source]

Component manager for the BEAM component in PST.LMC.

Since the BEAM component is a logical device, this component manager is used to orchestrate the process devices, such as BEAM, RECV.

Commands that are executed on this component manager are sent to instances of PstDeviceProxy for each device that the BEAM device manages.

This component manager only takes the fully-qualified device name (FQDN) for the remote devices, but uses the DeviceProxyFactory to retrieve instances of the device proxies that commands should be sent to.

abort(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Tell the component to abort whatever it was doing.

Parameters

task_callback – callback to be called when the status of the command changes

property channel_block_configuration: dict

Get current channel block configuration.

configure_scan(task_callback: Optional[Callable[[...], Any]] = None, **kwargs: Any) Tuple[ska_tango_base.executor.TaskStatus, str]

Configure scan for the component.

The kwargs of this method is scan configuration. The super class method has the same signature.

Parameters
  • task_callback – callback to be called when the status of the command changes

  • kwargs – the scan configuration to use.

deconfigure_scan(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Deconfigure scan for this component.

Parameters

task_callback – callback to be called when the status of the command changes

property dsp_health_state: ska_control_model.HealthState

Get the current health state for the DSP subcomponent.

Returns

the current health state for the DSP subcomponent.

Return type

HealthState

property dsp_obs_state: ska_control_model.ObsState

Get the current observing state for the DSP subcomponent.

Returns

the current observing state for the DSP subcomponent.

Return type

ObsState

end_scan(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Stop scanning.

Parameters

task_callback – callback to be called when the status of the command changes

property expected_data_record_rate: float

Get the expected data rate for DSP output for current scan configuration.

go_to_fault(fault_msg: str, task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Put all the sub-devices into a FAULT state.

Parameters

task_callback – callback to be called when the status of the command changes

handle_health_state_change() None[source]

Handle a change in one of the subcomponent’s health state.

This method will aggregate the overall health state of the PST BEAM based on the states of the subcomponents based on the following rules:

  • if all subcomponents have a state of HealthState.OK, then the beam’s state is HealthState.OK

  • if one subcomponent has a state of HealthState.DEGRADED, then the beam’s state

    is HealthState.DEGRADED

  • if multiple subcomponents have a state of HealthState.DEGRADED, then the beam’s state is

    set to HealthState.FAILED

  • if any subcomponent has a state of HealthState.FAILED, then the beam’s state is set

    to HealthState.FAILED

  • finally, if any subcomponent has a state of HealthState.UNKNOWN then overall state is

    still HealthState.UNKNOWN

property health_check_interval: int

Get the current health check interval, in milliseconds.

Returns

the current health check interval, in milliseconds.

Return type

int

property is_idle: bool

Get whether PST is in an idle state or not.

This is based off the PstProcessingMode. If PST has been configured for a scan then the processing mode is not IDLE but if PST hasn’t been configured then the processing mode is IDLE.

Returns

whether PST is in an idle state or not.

Return type

bool

property monitoring_polling_rate_ms: int

Get the current monitoring polling rate, in milliseconds.

obsreset(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Reset the component and put it into an IDLE state.

The subcomponents have all the resources released and as such are moved back to the EMPTY state.

Parameters

task_callback – callback to be called when the status of the command changes

property processing_mode: ska_control_model.PstProcessingMode

Get the current processing mode.

If the PST BEAM has been configured for a scan then this will return the processing mode from the configuration JSON. If the BEAM is in an IDLE state then this will return IDLE.

Returns

the current processing mode if there has been a configuration, otherwise IDLE.

Return type

PstProcessingMode

property recv_health_state: ska_control_model.HealthState

Get the current health state for the RECV subcomponent.

Returns

the current health state for the RECV subcomponent.

Return type

HealthState

property recv_obs_state: ska_control_model.ObsState

Get the current observing state for the RECV subcomponent.

Returns

the current observing state for the RECV subcomponent.

Return type

ObsState

reset(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Reset the component and put it into an IDLE state.

The subcomponents have all the resources released and as such are moved back to the IDLE state.

Parameters

task_callback – callback to be called when the status of the command changes

scan(task_callback: Optional[Callable[[...], Any]] = None, **kwargs: Any) Tuple[ska_tango_base.executor.TaskStatus, str]

Start scanning.

The kwargs of this method is scan request, including the scan_id. The super class method has the same signature. By using the kwargs allow for forward compatibility of accepting other parameters for the starting of the scan.

Parameters
  • task_callback (Callback) – callback for background processing to update device status.

  • kwargs (dict) – scan request as a dict

set_logging_level(log_level: ska_control_model.LoggingLevel) None

Set LoggingLevel of all the sub-devices.

Parameters

log_level – The required TANGO LoggingLevel

Returns

None.

property smrb_health_state: ska_control_model.HealthState

Get the current health state for the SMRB subcomponent.

Returns

the current health state for the SMRB subcomponent.

Return type

HealthState

property smrb_obs_state: ska_control_model.ObsState

Get the current observing state for the SMRB subcomponent.

Returns

the current observing state for the SMRB subcomponent.

Return type

ObsState

property stat_health_state: ska_control_model.HealthState

Get the current health state for the STAT subcomponent.

Returns

the current health state for the STAT subcomponent.

Return type

HealthState

property stat_obs_state: ska_control_model.ObsState

Get the current observing state for the STAT subcomponent.

Returns

the current observing state for the STAT subcomponent.

Return type

ObsState

property telescope_config: TelescopeConfig

Get the current telescope configuration.

This property returns a TelescopeConfig based on which telescope the PST BEAM is configured for.

This is a utility property to avoid having to duplicate calling get_telescope_config within this class.

Returns

the current telescope configuration.

Return type

TelescopeConfig

validate_configure_scan(configuration: dict) None[source]

Validate the configure scan request.

class ska_pst.lmc.beam.PstBeamDeviceInterface[source]

A purely abstract class that that represents a BEAM.MGMT Device.

This is implemented by PstBeam and used by the PstBeamComponentManager which needs a limited view of the TANGO device but without having full access to it.

property dsp_process_api_endpoint: str

Get the gRPC process API endpoint for DSP.

property recv_process_api_endpoint: str

Get the gRPC process API endpoint for SMRB.CORE.

property scan_output_dir_pattern: str

Get the pattern for directory used for scan output files.

property smrb_process_api_endpoint: str

Get the gRPC process API endpoint for SMRB.CORE.

property stat_process_api_endpoint: str

Get the gRPC process API endpoint for STAT.CORE.

update_obs_mode(obs_mode: ska_control_model.ObsMode) None[source]

Update the observation mode of the device.

When the device has been configured for a scan it should be put into PULSAR_TIMING.

When the device is in an IDLE state the observation mode should be set to IDLE too.

When PST supports VLBI and the beam has been configured for VLBI then the observation mode should be set to VLBI not PULSAR_TIMING

Parameters

obs_mode (ObsMode) – the observation mode enum value.