Getting Started¶
Repository Setup¶
git clone https://github.com/su3-labs/lux.git
cd lux
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,serial]"
python -m pytest -q
python examples/analyze_demo.py
Package Names¶
The Python distribution/import package name is luxspec. The import surface is:
import luxspec # stable user SDK
import lux # lower-level algorithm package
Use luxspec in notebooks, apps, and scripts. Use lux when working directly
on preprocessing, peak detection, matching, and module internals.
Device Connection Options¶
V0 supports a serial JSON-line protocol. Later firmware can expose the same frame schema over Wi-Fi, Bluetooth bridges, or Lux Cloud.
from luxspec import SerialLuxNode
with SerialLuxNode("/dev/tty.usbmodem1101") as node:
dark = node.capture("dark")
white = node.capture("white")
raw = node.capture("raw")
Core Measurement Cycle¶
- Warm the spectrometer and illumination path.
- Capture dark with illumination off and the optical path closed.
- Capture a white/reference or blank spectrum.
- Capture sample spectra.
- Store the raw frame, dark frame, reference frame, telemetry, and algorithm versions together.
- Check
analysis.processed.quality.okbefore using module metrics.
The one-command prototype path performs the same cycle and writes the complete bundle:
luxspec measure --port /dev/tty.usbmodem1101 --mode reflectance --module plants --out runs/leaf-first-light.json