trspectrometer.plugins.acquisition package

Module for management of data acquisition methods.

This acquisition plugin module is implemented as a Hardware plugin, even though the built-in acquisition methods only indirectly depend on other hardware plugins to be present. This results in the acquisition methods being displayed in the Hardware Status Panel, with their availability changing depending on the presence or absence of any required hardware devices.

The implementation of the actual data acquisition is abstracted from the software interface. The python pluginlib is used to find classes which implement and extend the Acquisition class and actually control the hardware, collect data, process it, and store into an appropriate data structure for display by the DataPanel.

Acquisition plugin classes which are built-in include:

  • TA_SteppedAcquisition, which performs a traditional transient absorption acquisition using a “change delay, acquire” loop. This mode is compatible with all delay types.

  • TA_SweptAcquisition, which is a rapid transient absorption acquisition mode that performs continuous data collection while sweeping the delay range. It requires a delay which can provide raw encoder (quadrature) signals to the interface hardware.

  • TA_DummySteppedAcquisition, which simulates a stepped transient absorption acquisition for demonstration and testing purposes. It does not require any additional hardware devices.

To load the acquisition plugin module, ensure "acquisition" is present in the Configuration File’s load=[...] list inside the Plugins section. To configure the module to use a specific driver class, ensure a [[hardware.acquisition]] section is present such as the default:

# Acquisition configuration
# Each entry specifies a acquisition device
#   name (string) : Friendly name for the acquisition method to use in the application
#   class (string) : Name of specific class to load to drive the acquisition
#   options (dict) : Dictionary of key=value pairs to pass to the class init() method
[[hardware.acquisition]]
name = "Dummy Stepped"
class = "TA_DummySteppedAcquisition"
options = {}

Multiple acquisition methods can be specified by including multiple [[hardware.acquisition]] sections. The double rectangular brackets around ([[hardware.acquisition]]) indicate that multiple sections are permitted. The same class type may be initialised multiple times with different values for its options.

class trspectrometer.plugins.acquisition.Acquisition(**kwargs)[source]

Bases: Plugin

Parent class of all acquisition class plugins.

Every acquisition driver class should derive from this parent, so that the automatic device class discovery can function.

close() None[source]

Close the connection to the device.

is_initialised() bool[source]

Test whether the acquisition hardware is present and initialised, and not in any error state.

start() None[source]

Begin acquisition of data.

It is up to the sub-classes implementing this method to determine what and how much data should be obtained in whatever manner is appropriate. For example, the data range and number of scans can be extracted from the DataPanel user interface.

During acquisition, the presence of new data points can be communicated to other components by emitting the raw_data_updated Signal. Parameters can be used to specify which points in the data set have changed to allow more efficient re-drawing for example.

Upon completion of the acquisition, the acquisition_stopped Signal should be emitted to notify other components. If an error occurred, an Exception instance can be passed to provide further information. For example:

from signalstorage import signals
from utils import AcquisitionError

if error:
    # Acquisition completed with some error
    signals.acquisition_stopped.emit(AcquisitionError("Something bad happened."))
else:
    # Acquisition completed OK
    signals.acquisition_stopped.emit(None)
stop() None[source]

Abort the acquisition of data.

description

Description of this acquisition device.

class trspectrometer.plugins.acquisition.AcquisitionStatusPanel(parent=None)[source]

Bases: QFrame

hideEvent(event)[source]

Handler for widget hide events.

refresh()[source]

Refresh the state of the hardware connection and update the panel’s display.

showEvent(event)[source]

Handler for widget show events.

devices_changed

Qt Signal to indicate the devices have changed in some way and the panel requires refreshing.

staticMetaObject = PySide6.QtCore.QMetaObject("AcquisitionStatusPanel" inherits "QFrame": Methods:   #34 type=Signal, signature=devices_changed() )
trspectrometer.plugins.acquisition.statuspanel

QWidget class type to use for displaying hardware status.

trspectrometer.plugins.acquisition.add_change_callback(callback_function)[source]

Register a function to be called when the devices are refreshed.

Parameters:

callback_function – Function to call when devices are refreshed.

trspectrometer.plugins.acquisition.close()[source]

Close any open acquisition devices.

trspectrometer.plugins.acquisition.init()[source]

Initialise the acquisition devices specified in the configuration file.

trspectrometer.plugins.acquisition.remove_change_callback(callback_function)[source]

Unregister a callback function added using add_change_callback().

Parameters:

callback_function – Function to unregister.

trspectrometer.plugins.acquisition.devices = [None]

List of instances of acquisition method classes. The number of entries in the list should correspond to the [[hardware.acquisition]] entries in the configuration file. If a device is missing or not initialised, a value of None should be used as a placeholder.

Submodules