sEQE module

V.1.0 Created from September 2018 onwards @author: jungbluth

V.2.0 Created from August 2022 onwards @author: jungbluth, hanauske

sEQE Control Code Script

This script allows the user to use the self-built sEQE setup of the AFMD group. It opens a PyQT5 GUI window which offers the user an interface to run the sEQE measurement. It is assumed that the user has read the online documentation at https://afmd.github.io/sEQE-Control-Software/.

This tool needs no input to open the GUI.

This script requires that several packages to be installed within the Python environment you are running this script in. To find out which read the requirements files in the github repository of the AFMD group.

This file is not intended to be imported as a module.

class sEQE.MainWindow[source]

Bases: QMainWindow

sEQE control software main window.

Parameters:
  • QtWidgets.QMainWindow – The Qt5 GUI Interface

  • Attributes

  • -----------

HandleMeasurement(scan_list, start, stop, step, amp, number)[source]

Function to prepare sample measurement.

Parameters:
  • scan_list (list of ints, required) – List of wavelength values to scan

  • start (float, required) – Wavelength start value

  • stop (float, required) – Wavelength stop value

  • step (float, required) – Wavelength step value

  • amp (float, required) – Pre-amplifier amplification value

  • number (int, required) – Specifier to decide if power value is calculated (1) or not (0)

Return type:

None

HandleStopCompleteScanButton()[source]

Function to stop multi-filter measurement.

Return type:

None

LockinHandleParameterButton()[source]

Function to read Lockin amplification value from GUI.

Return type:

None

LockinUpdateParameters(amplification)[source]

Function to update Lockin parameters.

Parameters:
  • int (amplification) – amplification value of the LockIn signal

  • required – amplification value of the LockIn signal

Return type:

None

Raises:

LoggerError – Raises error if Lockin not connected or Exception handling

MonoHandleCompleteScanButton()[source]

Function to measure samples with different filters.

Return type:

None

MonoHandleFilterButton()[source]

Function to read filter position from GUI.

Return type:

None

MonoHandleFilterInitButton()[source]

Function to read filter initialization position from GUI.

Return type:

None

MonoHandleGratingButtons()[source]

Function to read grating number from monochromator.

Return type:

None

MonoHandleSpeedButton()[source]

Function to read monochromator speed from GUI.

Return type:

None

MonoHandleWavelengthButton()[source]

Function to read wavelength value from GUI.

Return type:

None

calculatePower(ref_df, cal_df)[source]

Function to calculate power.

Parameters:
  • ref_df (DataFrame, required) – DataFrame of reference measurements

  • cal_df (DataFrame, required) – DataFrame of reference calibration measurements

Returns:

DataFrame of reference diode measurements incl. power

Return type:

DataFrame

connectToEquipment()[source]

Function to establish connection to monochromator, Lockin & filter wheel.

Return type:

None

connectToFilter()[source]

Function to establish connection to filter wheel.

Return type:

None

connectToLockin()[source]

Function to establish connection to Lockin.

Returns:

Zurich Instruments localhost name and device details

Return type:

list

connectToMono()[source]

Function to establish connection to monochromator.

Return type:

None

createScanJob(start, stop, step)[source]

Function to compile scan parameters.

Parameters:
  • start (float, required) – Wavelength start value

  • stop (float, required) – Wavelength stop value

  • step (float, required) – Wavelength step value

Returns:

List of integer wavelength values

Return type:

List

get_logger()[source]

Function to set up logger.

Return type:

logger

interpolate(num, x, y)[source]
load_mono_parameter()[source]

Function to load monochromator measurement parameters from file.

Parameters:

None

Return type:

None

Notes

Selects a file via tkinter dialog, reads the values and sets measurement parameters

load_naming()[source]

Function to load naming from directory path

Parameters:

None

Return type:

None

measure(scan_list, number)[source]

Function to perform sample measurement.

Parameters:
  • scan_list (list of ints, required) – List of wavelength values to scan

  • number (int, required) – Specifier to decide if power value is calculated (1) or not (0)

Return type:

None

monoCheckFilter(wavelength)[source]

Function to update position of first filter wheel from GUI defaults.

Parameters:

wavelength (float, required) – Current wavelength position of monochromator

Return type:

None

Raises:

LoggerError – Raises error if filter wheel commands are invalid or monochromator not connected

monoCheckGrating(wavelength)[source]

Function to update monochromator grating position from GUI defaults.

Parameters:

wavelength (float, required) – Current wavelength position of monochromator

Return type:

None

Raises:

LoggerError – Raises error if grating commands are invalid or monochromator not connected

naming(file_name, path_name, num)[source]

Function to compile filename.

Parameters:
  • file_name (str, required) – File name

  • path_name (str, required) – Path name

  • num (str, required) – Filter number

Return type:

None

pause(interval)[source]

Function to pause matplotlib without plt.show()

Parameters:

interval (int, required) – Pause time

Return type:

None

Notes

This is a reimplementation of the matplotlib pause function, removing the final show() call. It prevents the matplotlib plot window to pop up after each measurement.

The matplotlib 3.6 docstring says:

“Run the GUI event loop for interval seconds. If there is an active figure, it will be updated and displayed before the pause, and the GUI event loop (if any) will run during the pause. This can be used for crude animation. For more complex animation use matplotlib.animation. If there is no active figure, sleep for interval seconds instead.

See also

matplotlib.animation

Proper animations

show

Show all figures and optional block until all figures are closed.”

save_mono_parameter()[source]

Function to save monochromator measurement parameters to file

Parameters:

None

Return type:

None

Raises:

LoggerWarning – Raises warning if tkinter saving dialog was closed without entering filename

Notes

Reads the spinbox values and saves them into a file selected via tkinter dialog

set_up_plot()[source]

Function to set up plot.

Return type:

None

thorChangeFilter(pos)[source]

Function to update position of second filter wheel.

Parameters:

pos (int, required) – Target filter position, between 1-6

Returns:

True if connection to second filter wheel is successful, False otherwise

Return type:

bool

Raises:

LoggerError – Raises error if second filter wheel not connected

sEQE.main()[source]