Skip to main content

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

plesty_lightfield_spectrometer-0.2.0.tar.gz (222.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file plesty_lightfield_spectrometer-0.2.0.tar.gz.

File metadata

  • Download URL: plesty_lightfield_spectrometer-0.2.0.tar.gz
  • Upload date:
  • Size: 222.3 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

Hashes for plesty_lightfield_spectrometer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a7d52985dc302950261ba90d6d0f6c8b60248f60f3c97ec7fc1fd51e04fecee0
MD5 782df1e5ed58a21b362a3eb3520c5294
BLAKE2b-256 69ed86317f2c28a634b7ec53e095fe5dc6c5a98dbde46bc3fb075e8ec59b30f2

See more details on using hashes here.

File details

Details for the file plesty_lightfield_spectrometer-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: plesty_lightfield_spectrometer-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 63.4 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

Hashes for plesty_lightfield_spectrometer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89199b5dd1feae8b3c174152385689e2c031dc1c6fcb7cfad1ff111ec39d98a3
MD5 39148dea95eb76304af5d9debd9dd68b
BLAKE2b-256 6862fb6be84a791c68e863094865368b4e60daeeda427ae0678e2e5afed998ba

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page