Metadata-Version: 2.4
Name: lightcon
Version: 1.7.0
Summary: A set of APIs to Light Conversion devices
Home-page: https://bitbucket.org/harpiasoftware/light-conversion-apis.git
Author: Vytautas Butkus
Author-email: vytautas.butkus@lightcon.com
Project-URL: Documentation, https://lightconupdater.blob.core.windows.net/documentation/lightcon/index.html
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 1 - Planning
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: pyserial
Requires-Dist: numpy
Requires-Dist: typing_extensions
Requires-Dist: requests
Requires-Dist: pytest
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# lightcon

`lightcon` is a Python package of clients and wrappers for controlling
[Light Conversion](https://www.lightcon.com) hardware: OPAs, OPOs and
lasers, motion and DAQ hardware, spectrometers, power meters, and beam
diagnostics apps. Most modules talk to a device over its local HTTP REST
API, a few wrap a vendor DLL or a serial link, and a couple are
stand-alone helpers (unit conversion, plotting style).

Examples for most modules live in [examples/](examples/) and are linked
from the relevant module section below.

## Installation

### Pip

```bash
pip install lightcon
```

## Modules

### `lightcon.laser_clients`

REST API clients for PHAROS, CARBIDE lasers and FL1-generation FLINT oscillators.
Newer FL2- and FL3-generation FLINTs as well as CRONUS-3P and CRONUS-2P systems
have their own modules below.

Example: [examples/laser_client_example.py](examples/laser_client_example.py)

### `lightcon.flint3`

REST API client (`FL3Client`) for FLINT lasers running FLINT App v2 and
above. Older FLINT lasers are controlled through `lightcon.laser_clients`
instead.

Example: [examples/fl3_laser_test.py](examples/fl3_laser_test.py)

### `lightcon.cronus3p`

Thin REST API client (`C3PClient`) and a more complex control class (`C3PControl`)
for CRONUS-3P lasers, hosted by Light Composer. Supports both the current C3Pv2 hardware via RESTv1 API (attenuator control, multiple tunable channels) and the legacy C3Pv1 via RESTv0.

### `lightcon.cronus2pv3`

REST API client (`C2Pv3Client`) for CRONUS-2Pv3 OPOs running Cronus App v1
and above. Older CRONUS-2Pv1 lasers are controlled through
`lightcon.cronus2p` instead.

Example: [examples/c2pv3_laser_test.py](examples/c2pv3_laser_test.py)

### `lightcon.cronus2p`

REST API client (`C2PControl`) for CRONUS-2Pv1 optical parametric oscillators. The newer C2Pv3 OPOs are controlled via `lightcon.cronus2pv3` instead.

### `lightcon.wintopas`

REST API client (`WinTopas`) for Topas4-based optical parametric amplifiers,
served by Topas Server.

### `lightcon.harpia`

REST API client (`Harpia`) for the HARPIA spectroscopy systems hosted by HARPIA Service App, plus a CAN-over-REST provider (`HarpiaLepreCanProvider`) for reading/writing device registers directly.

Example: [examples/harpia_rest_can.py](examples/harpia_rest_can.py) — reading
device registers over the CAN extension.

### `lightcon.harpia_daq`

DLL wrapper (`HarpiaDaqWrapper`) for the universal six-channel DAQ
(PE04-005-04 or newer).

Example: [examples/harpia_daq_wrapper_example.py](examples/harpia_daq_wrapper_example.py)

### `lightcon.fast_daq`

DLL wrapper (`FastDaqWrapper`) for the fast single-channel DAQ
(E13-10023-02 or newer).

Example: [examples/fast_daq_wrapper_example.py](examples/fast_daq_wrapper_example.py)

### `lightcon.camera_app_client`

REST API client (`CameraApp`) for the Camera App beam-diagnostics
application.

Example, combined with `lightcon.harpia`'s delay line:
[examples/delay_line_beam_position_test.py](examples/delay_line_beam_position_test.py)

### `lightcon.beam_alignment`

REST API client (`BeamAlignmentSystem`) for the Beam Alignment App.

### `lightcon.power_meter`

REST API client (`PowerMeter`) for the PowerMeter power-measurement
application, with UDP auto-discovery of PowerMeter apps running on the local
network.

### `lightcon.spectrometers`

REST API client (`RemoteSpectrometer`) for Light Conversion spectraLight
devices.

### `lightcon.eth_motor_board`

API (`EthMotorBoard`) for the Ethernet motor controller board, plus a
CAN-over-REST provider (`EthMotorBoardLepreCanProvider`).

Examples:

- [examples/eth_motor_board_test_ls.py](examples/eth_motor_board_test_ls.py) — minimal connect-and-send example.
- [examples/eth_motor_board_stage.py](examples/eth_motor_board_stage.py) — board discovery via `UdpLocator` and full L6470 driver setup.
- [examples/eth_motor_board_with_PI_VT80.py](examples/eth_motor_board_with_PI_VT80.py) — L6470 driver setup for a PI VT-80 stage.

### `lightcon.timing_controller`

Serial API for the timing controller, with `TimingController` (v1) and
`TimingControllerV2` classes.

### `lightcon.calculate`

Helper functions for motor and stage configuration in `EthMotorBoard`.

### `lightcon.common`

Shared connectivity functions for REST clients (`HTTP_methods`), UDP discovery (`UdpLocator`), and logging (`init_logger`)

Example: [examples/logger.py](examples/logger.py)

### `lightcon.datasets`

Loader (`load_csv_data`, `load_json_data`) for datasets bundled with the
package.

### `lightcon.style`

Light Conversion plotting style for 1D matplotlib graphs, with watermarking.

Example: [examples/lcstyle_plot1d_example.py](examples/lcstyle_plot1d_example.py)

### `lightcon.utils`

Miscellaneous internal fixes/utilities.
