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
GenesisMXclass 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/hopsdirectory.
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.whlTo launch a web GUI for controlling the laser, run the following command:
genesis-mxgit clone [email protected]:AllenNeuralDynamics/coherent-lasers.gitcd coherent_lasersuv synccd webgui && pnpm i && pnpm run build && cd ..genesis-mxalternatively, you can run the server using fastapi cli:
cd src/coherent_lasers/app
```bash
uv run fastapi dev server.pycd webguiNote: You can also use
npmoryarnin place ofpnpmbelow, to install the dependencies and build the project.
pnpm ipnpm run buildcd ../src/coherent_lasers/appuv run fastapi dev server.py