Plesty Lightfield Spectrometer Device
A Plesty device for the Princeton Instruments LightField spectrometer. It
drives LightField through its .NET automation API via pythonnet, so the
server runs on the Windows PC the camera is attached to.
Full documentation: docs/index.md.
Setup the server
On the Windows PC where LightField is installed (camera via USB — PIXIS — or
GigE — PyLoN-IR), close all LightField apps: LightField.exe,
AddInProcess.exe and the LightField Firmware Assistant. Then in a
Terminal/PowerShell:
git clone https://gitlab.com/plesty/hub/devices/princeton_instruments/lightfield_spectrometer.git
cd lightfield_spectrometer
uv sync
copy .env.example .env
:: edit .env — at least DEVICE_DATA_PATH (where frames go, steerable by clients)
uv run python -m plesty.lightfield_spectrometer --tcp-port 5555
Run the server from a normal (non-elevated) desktop shell — not over SSH: Windows OpenSSH gives administrator accounts an elevated token, and LightField's automation IPC refuses mismatched privilege levels. The preflight warns when it detects this.
A GigE camera needs no configuration: the preflight finds the link-local
neighbour on the camera NIC, verifies it with a ping, and pins it to .env
as CAMERA_HOST.
Starting unattended
Under a supervisor or the bench app there is nobody to answer the
confirmation before an open LightField session is closed, so it refuses and
the server does not start. Pass --close-lightfield (or set
DEVICE_CLOSE_LIGHTFIELD=1) to close it and discard whatever it has not
saved. The same flag allows ending the LightField Firmware Assistant, which
holds the camera and usually ignores a polite close — check no firmware write
is in progress first, since interrupting one can leave the camera unusable.
Long runs
LightField's AddInProcess keeps a share of every acquisition and never
releases it: about 0.21 MB per acquisition plus 0.037 MB per second of
acquiring, measured on the bench. Idling is free and so are API calls — only
acquiring costs — but overnight that is gigabytes, and no exposure setting
avoids it.
Nothing in this process can free another process's heap, so the server
restarts the LightField session instead, between acquisitions, once the host
passes DEVICE_RECYCLE_CEILING_MB (default 1024 MB, 0 to disable). A
restart costs about 22 s and the experiment's settings survive it. See
Long runs and the automation host in docs/index.md.
Tests
uv run pytest # hardware-free; what CI runs
uv run python tests/field_test.py # the instrument, in-process
uv run python tests/field_test_client.py # the instrument over ZMQ
The field tests need hardware and are run by hand — the host tier on the LightField PC, the client tier from a machine on the instrument network, against a running server. Run the host tier first; the client tier reads its report to know what to exercise.
Regenerate the manuals
uv run plesty manual generate . --with-pdf
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plesty_lightfield_spectrometer-0.2.1.tar.gz.
File metadata
- Download URL: plesty_lightfield_spectrometer-0.2.1.tar.gz
- Upload date:
- Size: 223.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12a0bbef106a116a64c9023e73c905cf9e633f4d452116160cf67fa2077372d7
|
|
| MD5 |
20cf9b9b7810dcc651b7d9c123a809aa
|
|
| BLAKE2b-256 |
eb2ea806041ae05e964ec72fe8a6fac33c169d9b576f861fdd3dae05a3bec8e2
|
File details
Details for the file plesty_lightfield_spectrometer-0.2.1-py3-none-any.whl.
File metadata
- Download URL: plesty_lightfield_spectrometer-0.2.1-py3-none-any.whl
- Upload date:
- Size: 63.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
344446a4213f997994b05a4d7da8031b487b6163feff376af6925c1dde78d726
|
|
| MD5 |
6a058e94bfed1fe01e20d93d9d99bb88
|
|
| BLAKE2b-256 |
083aec67503736d7b5f4c732922715b02edd16800821f6013073782d8c8841b1
|