Experimental setup for Laser, I-V, and Transfer Curve measurements. This project utilizes PyMeasure under the hood and extends it with a YAML-based configuration system (via OmegaConf and Hydra) for flexible instrument and procedure management. It is strongly recommended to read the PyMeasure documentation to understand the underlying structure and classes.
This project allows for the communication between the computer and the instruments used in the experimental setup, as well as the control of the instruments. The following instruments are supported:
- Keithley 2450 SourceMeter (Reference Manual) (Requires NI-VISA installed)
- Keithley 6517B Electrometer (Reference Manual (Also requires NI-VISA))
- TENMA Power Supply
- Thorlabs PM100D Power Meter (Reference Manual)
- Bentham TLS120Xe Light Source (Reference Manual)
As well as all instruments available in the PyMeasure library.
- Optional installation via uv for handling Python dependencies.
- YAML configs laser_setup/assets/templates/ that leverage Hydra instantiation to dynamically load modules and objects.
- A robust main GUI window (see laser_setup.display.main_window.py) that displays available procedures and scripts.
- An experiment window (laser_setup.display.experiment_window.py) for running PyMeasure-based procedures with plots, logs, and parameter inputs.
- Sequences: run multiple procedures in series using the SequenceWindow.
- InstrumentManager (laser_setup.instruments.manager.py) for centralized instrument setup and teardown.
If you have procedures defined in a Python script and in the YAML (see procedures.yaml for examples), you can invoke them directly:
laser_setup <procedure_name>This will load the relevant procedure class from the OmegaConf-based configs, then open an ExperimentWindow.
If you prefer to run procedures directly from Python, you can import the relevant Procedure classes and call them directly.
Scripts can be run similarly by name:
laser_setup <script_name>Clone the repository:
git clone https://github.com/nanolab-fcfm/laser_setup.git
cd laser_setupCreate a virtual environment:
python -m venv <venv_name>
source <venv_name>/bin/activate # Linux/MacOS
<venv_name>/Scripts/activate # Windows
pip install --upgrade pipAnd install the dependencies:
pip install .Or, for direct installation instead of cloning the repository:
pip install git+https://github.com/nanolab-fcfm/laser_setup.gitOptionally install using uv:
uv venv
uv pip install https://github.com/nanolab-fcfm/laser_setupIf installed, the laser_setup entry point for the program will be created.
Once installed, run either of the following commands to start the main window:
laser_setupor
python -m laser_setupThis launches the window defined in MainWindow.
Most configuration is handled in YAML files and can be loaded or overridden at runtime. OmegaConf merges these with defaults, enabling dynamic instantiation of procedures, sequences, instruments and parameters. The YAML templates are stored in laser_setup/assets/templates.
You can edit YAML settings to define:
- Main window parameters (e.g., README file, window size, icon, etc.).
- Procedures, Scripts, and Sequences.
- Instrument settings, pointing to classes that the InstrumentManager will initialize.
To maximize functionality, all user-written procedures should be subclasses of BaseProcedure, which is a subclass of Procedure from PyMeasure. These procedures inherit the following:
- The following parameters (
pymeasure.experiment.Parametertype):procedure_version(version of the procedure)show_more(boolean to show more parameters in the GUI)info(information about the procedure)skip_startup(boolean to skip the startup method)skip_shutdown(boolean to skip the shutdown method)start_time(start time of the procedure, set withtime.time())
- Their corresponding INPUTS (Inputs to display in the GUI)
- Base
startupandshutdownmethods instruments, anInstrumentManagerobject that handles the instruments used in the procedure
Develop custom procedures by:
- Subclassing
BaseProcedure. - Defining your
INPUTSandDATA_COLUMNS. - Setting up your parameters.
- Setting up your instruments.
- Overriding
startup,execute, andshutdownas needed.
Use the SequenceWindow to group multiple procedures in series. This allows chaining them together without manually rerunning each experiment. Edit or create new sequence entries in YAML to define the flow of procedures.
- Code contributions should follow typical pull-request workflow on GitHub.
- Documentation is currently WIP.