Daq Receiver Device

This module implements the MccsDaqReceiver device.

class MccsDaqReceiver(*args, **kwargs)

An implementation of a MccsDaqReceiver Tango device.

Configure(argin)

Configure the DaqReceiver.

Applies the specified configuration to the DaqReceiver.

Parameters:

argin (str) – A JSON string containing the daq configuration to apply.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> daq = tango.DeviceProxy("low-mccs/daqreceiver/001")
>>> daq_config = {
    "receiver_ports": "4660",
    "receiver_interface": "eth0",
}
>>> daq.Configure(json.dumps(daq_config))
class ConfigureCommand(component_manager, logger=None)

Class for handling the Configure(argin) command.

__init__(component_manager, logger=None)

Initialise a new ConfigureCommand instance.

Parameters:
  • component_manager – the device to which this command belongs.

  • logger (Optional[Logger]) – a logger for this command to use.

do(argin)

Implement MccsDaqReceiver.ConfigureCommand command functionality.

Parameters:

argin (str) – A configuration dictionary.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

DaqStatus()

Provide status information for this MccsDaqReceiver.

This method returns status as a json string with entries for:
  • Daq Health: [HealthState.name: str, HealthState.value: int]

  • Running Consumers: [DaqMode.name: str, DaqMode.value: int]

  • Receiver Interface: “Interface Name”: str

  • Receiver Ports: [Port_List]: list[int]

  • Receiver IP: “IP_Address”: str

Return type:

str

Returns:

A json string containing the status of this DaqReceiver.

Example:
>>> daq = tango.DeviceProxy("low-mccs/daqreceiver/001")
>>> jstr = daq.DaqStatus()
>>> dict = json.loads(jstr)
class DaqStatusCommand(component_manager, logger=None)

A class for the MccsDaqReceiver’s DaqStatus() command.

__init__(component_manager, logger=None)

Initialise a new instance.

Parameters:
  • component_manager – the device to which this command belongs.

  • logger (Optional[Logger]) – a logger for this command to use.

do()

Stateless hook for device DaqStatus() command.

Return type:

str

Returns:

The status of this Daq device.

GetConfiguration()

Get the Configuration from DAQ.

Return type:

str

Returns:

A JSON-encoded dictionary of the configuration.

Example:
>>> daq = tango.DeviceProxy("low-mccs/daqreceiver/001")
>>> jstr = daq.GetConfiguration()
>>> dict = json.loads(jstr)
class GetConfigurationCommand(component_manager, logger=None)

Class for handling the GetConfiguration() command.

__init__(component_manager, logger=None)

Initialise a new GetConfigurationCommand instance.

Parameters:
  • component_manager – the device to which this command belongs.

  • logger (Optional[Logger]) – a logger for this command to use.

do()

Implement MccsDaqReceiver.GetConfiguration() command.

Return type:

str

Returns:

The configuration as received from pydaq

class InitCommand(*args, **kwargs)

Implements device initialisation for the MccsDaqReceiver device.

do(*args, **kwargs)

Initialise the attributes and properties.

Parameters:
  • args (Any) – Positional arg list.

  • kwargs (Any) – Keyword arg list.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SetConsumers(argin)

Set the default list of consumers to start.

Sets the default list of consumers to start when left unspecified in the start_daq command.

Parameters:

argin (str) – A string containing a comma separated list of DaqModes.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> daq = tango.DeviceProxy("low-mccs/daqreceiver/001")
# pylint: disable=line-too-long
>>> consumers = "DaqModes.INTEGRATED_BEAM_DATA,ANTENNA_BUFFER, BEAM_DATA," # noqa: E501
>>> daq.SetConsumers(consumers)
class SetConsumersCommand(component_manager, logger=None)

Class for handling the SetConsumersCommand(argin) command.

__init__(component_manager, logger=None)

Initialise a new SetConsumersCommand instance.

Parameters:
  • component_manager – the device to which this command belongs.

  • logger (Optional[Logger]) – a logger for this command to use.

do(argin)

Implement MccsDaqReceiver.SetConsumersCommand functionality.

Parameters:

argin (str) – A string containing a comma separated list of DaqModes.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Start(argin='')

Start the DaqConsumers.

The MccsDaqReceiver will begin watching the interface specified in the

configuration and will start the configured consumers.

Parameters:

argin (str) – A json dictionary with optional keywords. ‘{“modes_to_start”}’.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> daq = tango.DeviceProxy("low-mccs/daqreceiver/001")
>>> argin = '{"modes_to_start": "INTEGRATED_CHANNEL_DATA,
RAW_DATA"}'
>>> daq.Start(argin) # use specified consumers
>>> daq.Start("") # Uses default consumers.
StartBandpassMonitor(argin)

Start monitoring antenna bandpasses.

The MccsDaqReceiver will begin monitoring antenna bandpasses

and producing plots of the spectra.

Parameters:

argin (str) – A json dictionary with keywords. - plot_directory Directory in which to store bandpass plots. - monitor_rms Whether or not to additionally produce RMS plots. Default: False. - auto_handle_daq Whether DAQ should be automatically reconfigured, started and stopped without user action if necessary. This set to False means we expect DAQ to already be properly configured and listening for traffic and DAQ will not be stopped when StopBandpassMonitor is called. Default: False. - cadence The time in seconds over which to average bandpass data. Default: 0 returns snapshots.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Stop()

Stop the DaqReceiver.

The DAQ receiver will cease watching the specified interface and will stop all running consumers.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Example:
>>> daq = tango.DeviceProxy("low-mccs/daqreceiver/001")
>>> daq.Stop()
StopBandpassMonitor()

Stop monitoring antenna bandpasses.

The MccsDaqReceiver will cease monitoring antenna bandpasses

and producing plots of the spectra.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

class StopBandpassMonitorCommand(component_manager, logger=None)

Class for handling the StopBandpassMonitorCommand() command.

__init__(component_manager, logger=None)

Initialise a new StopBandpassMonitorCommand instance.

Parameters:
  • component_manager – the device to which this command belongs.

  • logger (Optional[Logger]) – a logger for this command to use.

do()

Implement MccsDaqReceiver.SetConsumersCommand functionality.

Stop monitoring antenna bandpasses.

The MccsDaqReceiver will cease monitoring antenna bandpasses

and producing plots of the spectra.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

class StopCommand(component_manager, logger=None)

Class for handling the Stop() command.

__init__(component_manager, logger=None)

Initialise a new StopCommand instance.

Parameters:
  • component_manager – the device to which this command belongs.

  • logger (Optional[Logger]) – a logger for this command to use.

do()

Implement MccsDaqReceiver.StopCommand command functionality.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

__init__(*args, **kwargs)

Initialise this device object.

Parameters:
  • args (Any) – positional args to the init

  • kwargs (Any) – keyword args to the init

create_component_manager()

Create and return a component manager for this device.

Return type:

DaqComponentManager

Returns:

a component manager for this device.

dataReceivedResult()

Read the result of the receiving of data.

Return type:

tuple[str, str]

Returns:

A tuple containing the data mode of transmission and a json string with any additional data about the data such as the file name.

init_command_objects()

Initialise the command handlers for commands supported by this device.

Return type:

None

init_device()

Initialise the device.

This is overridden here to change the Tango serialisation model.

Return type:

None

rmsPlot()

Read the last rms plot filepath.

Return type:

ndarray

Returns:

The last block of rms data.

xPolBandpass()

Read the last bandpass plot data for the x-polarisation.

Return type:

ndarray

Returns:

The last block of x-polarised bandpass data.

yPolBandpass()

Read the last bandpass plot data for the y-polarisation.

Return type:

ndarray

Returns:

The last block of y-polarised bandpass data.

main(*args, **kwargs)

Entry point for module.

Parameters:
  • args (str) – positional arguments

  • kwargs (str) – named arguments

Return type:

int

Returns:

exit code