Daq Simulator
This module implements a simple DAQ receiver.
It exists to allow MccsDaqReceiver to be unit tested.
- class DaqSimulator(**extra_config)[source]
An implementation of a DaqSimulator device.
- create_plotting_directory(parent, station_name)[source]
Create plotting directory structure for this station.
This method will always return True unless parent==”invalid_directory”
- get_data_rate()[source]
Return the current data rate in Gb/s, or None if not being monitored.
- Return type:
- Returns:
the current data rate in Gb/s, or None if not being monitored.
- get_status()[source]
Provide status information for this MccsDaqReceiver.
- This method returns status as a json string with entries for:
Running Consumers: [DaqMode.name: str, DaqMode.value: int]
Receiver Interface: “Interface Name”: str
Receiver Ports: [Port_List]: list[int]
Receiver IP: “IP_Address”: str
- initialise_daq(libaavsdaq_filepath='')[source]
Initialise a new DaqReceiver instance.
- Parameters:
libaavsdaq_filepath (
str) – Filepath to a specific version of libaavsdaq.so- Return type:
- Returns:
a resultcode, message tuple
- initialise_station_beam(filepath=None)[source]
Initialise the station beam.
- property initialised: bool
Return whether the simulated DAQ is initialised.
- Returns:
whether the simulated DAQ is initialised.
- start_bandpass_monitor(argin)[source]
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.- Yields:
a task status and response message. Optionally also bandpass data for both polarisations and rms data.
- Return type:
Iterator[tuple[TaskStatus,str,str|None,str|None,str|None]]
- start_daq(modes_to_start, callbacks, diagnostic_callback)[source]
Start data acquisition with the current configuration.
- start_measuring_data_rate(interval=1.0)[source]
Start the data rate monitor on the receiver interface.
- Parameters:
interval (
float) – the interval over which to measure the data rate.- Return type:
- Returns:
a ResultCode and response message
- stop_bandpass_monitor()[source]
Stop monitoring antenna bandpasses.
- Return type:
- Returns:
a resultcode, message tuple