Python drivers for Coherent lasers.
Repository is organized by laser model. Each laser model has its own directory containing the driver code.
coherent_lasers/
├── src/
│ ├── app/
│ │ ├── frontend/build/(build files from webgui)
│ │ ├── messaging/
│ │ ├── cli.py
│ │ ├── server.py
│ ├── genesis_mx/
│ │ ├── commands.py
│ │ ├── mock.py
│ │ └── driver.py
│ │ ├── hops/
│ │ │ ├── CohrFTCI2C.h
│ │ │ ├── CohrHOPS.h
│ │ │ ├── (DLL files for each .h file)
│ │ │ ├── lib.py
├── setup.py
└── webgui (web frontend for controlling the laser)
- Genesis MX
The
GenesisMX
class provides a comprehensive API for controlling the laser. Supports connection via USB using the HOPS SDK provided by Coherent.
: Note: Installing the package from a wheel file will ensure that the necessary dll files are included. If you install the package from source, you will need to download the dll files and add them to the
src/coherent_lasers/src/hops
directory.
Download the latest release from the releases page.
pip install <path_to_downloaded_wheel>
Alternatively you can install the coherent_lasers
package directly from a GitHub release using pip
.
coherent_version=0.2.0
pip install https://github.com/AllenNeuralDynamics/coherent_lasers/releases/download/v${coherent_version}/coherent_lasers-${coherent_version}-py3-none-any.whl
To launch a web GUI for controlling the laser, run the following command:
genesis-mx
git clone git@github.com:AllenNeuralDynamics/coherent-lasers.git
cd coherent_lasers
uv sync
cd webgui && pnpm i && pnpm run build && cd ..
genesis-mx
alternatively, you can run the server using fastapi cli:
cd src/coherent_lasers/app
```bash
uv run fastapi dev server.py
cd webgui
Note: You can also use
npm
oryarn
in place ofpnpm
below, to install the dependencies and build the project.
pnpm i
pnpm run build
cd ../src/coherent_lasers/app
uv run fastapi dev server.py