Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.dev1.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.dev1.tar.gz.

File metadata

  • Download URL: plesty_lightfield_spectrometer-0.2.0.dev1.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.dev1.tar.gz
Algorithm Hash digest
SHA256 6fbca48165671868a46bc8698e303a5df413da4b70f0892ff75ca674d9752767
MD5 32657cfab10beee4866b211b935a86fb
BLAKE2b-256 bc17076e6bf7059847a551988cc21bab399738eb545bd8827eed978a81f8fb85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plesty_lightfield_spectrometer-0.2.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 63.5 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.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0db3a11f357b0f1cd5313a12a6aff83c11b7433e9784a2af256db267438e7dd
MD5 e6d7c51c83f65dc2308611b4079ad37e
BLAKE2b-256 47653b7fe30313e534c9b25a83418565854f80d6d18cfb6c4b3fed02cc84e8ad

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

0.2.0

2 files

This release

0.2.0.dev1 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