trspectrometer.plugins.delay package

Module for management of delay stages used to create pump–probe delays or similar.

A typical delay will use a linear translation stage with a retroreflecting mirror attached, which creates delay by changing the laser propagation path length. However, a delay could also be constructed using other technologies, such as electronic synchronisation, translating glass wedge pairs, or rotating optical flats.

The implementation of the actual control of the hardware is abstracted from the software interface. The python pluginlib is used to find classes which implement and extend the Delay class and actually communicate with the delay device.

Delay plugin classes which are built-in include:

  • Thorlabs_BBD201_DDS600, a Thorlabs BBD201 controller paired with a DDS600 linear translation stage. This combination is able to provide raw quadrature encoder and triggering signals to the TRSI interface hardware and thus is compatible with the TA_SweptAcquisition acquisition method.

  • DummyDelay, which simulates the presence of a delay device for demonstration or testing purposes.

To load the delay plugin module, ensure "delay" 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.delay]] section is present such as the default:

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

Multiple delay devices can be specified by including multiple [[hardware.delay]] sections. The double rectangular brackets around [[hardware.delay]] indicate that multiple sections are permitted. The same class type may be initialised multiple times with different values for its options. Acquisition methods may then select which delay entry to use.

class trspectrometer.plugins.delay.Delay(**kwargs)[source]

Bases: Plugin

Parent class of all delay module plugins.

Every delay 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.

delay_to_encoder(delay_time: float) int[source]

Convert from delay time to the raw device encoder counts.

If this functionality is not available, None will be returned.

Parameters:

delay_time – Delay time, in seconds.

Returns:

Encoder counts.

encoder_to_delay(counts: int) float[source]

Convert from the raw device encoder counts to delay time.

If this functionality is not available, None will be returned.

Parameters:

counts – Encoder counts.

Returns:

Delay time, in seconds.

get_acceleration()[source]

Get the delay stage movement acceleration, in delay/s/s.

The units represent (delay seconds) per (wall clock seconds squared).

Returns:

Delay stage movement acceleration, in delay/s/s.

get_delay() float[source]

Get the current delay time provided by this unit, in seconds.

The current delay corresponds to the (best estimate) of the current delay time, which may be updated during the device’s movement and therefore may not immediately correspond to the time which was requested. The get_target() method instead provides the target delay time.

Returns:

Current delay time, in seconds.

get_encoder_count() int[source]

Retrieve the current position of the delay in raw encoder counts.

If this functionality is not available, None will be returned.

Returns:

Position as raw encoder counts.

get_target() float[source]

Target delay time requested from this unit, in seconds.

The requested and current delay times may differ due to the time the device needs to physically move in order to create the delay.

Returns:

Requested delay time, in seconds.

get_velocity()[source]

Get the movement velocity of the delay stage, in delay/s.

The value is technically unitless, but represents (delay seconds) per (wall clock seconds).

Note that this is the velocity at which the delay stage is programmed to move at, not the current velocity.

Returns:

Maximum delay stage movement velocity, in delay/s.

home() None[source]

Reset the delay and perform a homing operation.

increment_delay(delay_increment: float) None[source]

Set the delay to a value relative to its current target delay time, in seconds.

Negative values for the delay increment are allowed.

Parameters:

delay_increment – Relative delay time to set, in seconds.

is_initialised() bool[source]

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

is_moving() bool[source]

Test whether the delay is currently moving into position.

The default method for determining whether the delay is moving is to check if the current delay does not match the requested target delay, within the tolerances of the minimum possible delay time increment given by min_increment().

Returns:

Boolean indicating whether the delay is currently moving.

max_delay() float[source]

Get the maximum available delay time provided by this unit, in seconds.

Returns:

Maximum available delay time, in seconds.

min_delay() float[source]

Get the minimum available delay time provided by this unit, in seconds.

Returns:

Minimum available delay time, in seconds.

min_increment() float[source]

Get the minimum possible delay time increment for this unit, in seconds.

Returns:

Minimum possible delay time increment, in seconds.

set_acceleration(acceleration) None[source]

Set the delay movement acceleration, in delay/s/s.

The units represent (delay seconds) per (wall clock seconds squared).

Parameters:

acceleration – New delay stage movement acceleration, in delay/s/s.

set_delay(delay_time: float) None[source]

Set the delay time to an absolute value, in seconds.

Parameters:

delay_time – Absolute delay time to set, in seconds.

set_velocity(velocity) None[source]

Set the delay stage movement speed, in delay/s.

The value is technically unitless, but represents (delay seconds) per (wall clock seconds).

Parameters:

velocity – New delay stage movement velocity, in delay/s.

stop() None[source]

Stop any current delay movement operation.

description

Description of this delay device.

status

Dictionary containing current status information about the device.

class trspectrometer.plugins.delay.DelayStatusPanel(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("DelayStatusPanel" inherits "QFrame": Methods:   #34 type=Signal, signature=devices_changed() )
trspectrometer.plugins.delay.statuspanel

QWidget class type to use for displaying hardware status.

trspectrometer.plugins.delay.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.delay.close()[source]

Close any open delay devices.

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

Initialise the delay devices specified in the configuration file.

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

Unregister a callback function added using add_change_callback().

Parameters:

callback_function – Function to unregister.

trspectrometer.plugins.delay.devices = [None]

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

Submodules