Unattended, dark-bracketed time-resolved spectroscopy with Ocean Insight spectrometers on Windows.
LightKeeper records a raw spectrum on a fixed time grid, every second, from before dawn to after dusk. You don't need to watch it. Each run is bracketed by dark sets that cover every integration time the run may use, so no darks are needed in the field. Fast bursts store every scan at scheduled times. A background recorder survives a closed window, a crash, a USB fault or a Windows restart. It is the sibling of GammaKeeper, with the same rules and look, but for optical spectra (ultraviolet to near-infrared) instead of gamma-ray spectra. The trace behind the logo is real: daylight through a diffuser at a forest edge, with the vegetation red edge near 700 nm and both branches of the O₂ A-band at 760 nm, at the detector's full resolution.
- Raw data on a fixed grid. Each slot (default 1 s) stores the per-pixel mean and standard deviation of every scan in that slot, plus the exposure, saturation and timing. Files are HDF5 and rotate hourly. Nothing is dark-subtracted, smoothed or resampled.
- Fixed exposure by default. A run records at one integration time (500 ms) unless you choose automatic exposure, which moves along a ladder of integration times.
- Dark sets you can trust. Before and after the run, LightKeeper records darks at every integration time the run can use: the fixed time (or the whole ladder), the burst time, and a second long time for the dark-drift model. Each dark set also lists the detector's hot and cold pixels, which the display hides; the raw data keep them.
- Sun-event scheduling. Start and stop can be tied to astronomical, nautical or civil dawn and dusk, or to sunrise and sunset, each with an offset. The NOAA/Meeus solar position is used. Times are fixed when you press Start, and daylight-saving changes during a run are handled.
- Fast bursts. At scheduled times, every scan is stored at a short integration time. At the slot's own time the 1 s record goes on through the burst with no gap, and Save every frame keeps every spectrum of a run. Bursts that would be too dim to be useful are skipped and logged.
- Survives the real world.
- A supervisor restarts a crashed recorder and resumes the run as a new segment.
- A watchdog resumes the run if the recorder and supervisor die together.
- USB faults reopen the spectrometer by serial number.
- After a Windows restart, an open run resumes at logon.
- Closing the window never stops a run.
- Honest timing. All stored times are UTC nanoseconds. An SNTP clock check runs at Start, hourly and at Stop, and the offset is saved with the data.
- Wavelength calibration. Fit the axis from emission-line lamps (Hg-Ar, Ne, Ar, Kr, Xe, He, H, Cd, Zn and more) against bundled NIST ASD line lists. The device EEPROM is never changed.
- Temperature, where the hardware has it. Spectrometers with a readable detector thermistor log a temperature with every slot. The Maya2000 Pro has none, and the run says so.
- A summary of every run.
run_summary.jsonlists integration changes, bursts, dark agreement, usable light and clock offsets, and the Start dialog runs a pre-flight checklist. - Setup metadata. The fiber, diffuser, view azimuth and elevation, window state, site altitude and a setup photo are stored with each run.
LightKeeper finds Ocean spectrometers on USB through two backends. It tries Ocean Insight's OceanDirect SDK first. Then seabreeze adds the legacy models OceanDirect does not open, such as the USB650. It has been run on a Maya2000 Pro (OceanDirect) and a USB650 (seabreeze). Other models should work, but are untested; please open an issue with what you try. If more than one is attached, it opens the one used last; pick another in the Spectrometer list to switch.
-
seabreeze: if it is not installed, the window installs it once into
%LOCALAPPDATA%\LightKeeper\deps, leaving the Python environment unchanged. This needs internet access the first time. Saturation and exposure thresholds scale to each detector's range: 60,000 counts on 16-bit, 3,749 on the 12-bit USB650. -
OceanView: this is Ocean Insight's own acquisition software, and LightKeeper does not need it. Close OceanView before starting LightKeeper, because only one program can hold a USB spectrometer.
-
Not supported: network-attached devices and spectrometers from other makers.
-
Simulator: a built-in synthetic spectrometer lets you try the whole workflow without hardware.
You need:
- Windows 10 or 11;
- Python 3.12 with PySide6, NumPy, SciPy, Matplotlib and h5py;
- the OceanDirect SDK installed at its default location, or wherever
OCEANDIRECT_HOMEpoints (for OceanDirect models such as the Maya2000 Pro; a USB650 needs only the Windows USB driver OceanView installs, plus seabreeze, which LightKeeper installs itself).
- Launch. Double-click
Launch_LightKeeper.cmd. It usesLIGHTKEEPER_PYTHON, or else the firstpythonw.exeon PATH. For a Start menu or desktop shortcut,LightKeeper.icoin the same folder is the app's icon. Launching it again restores and brings forward the existing window, including any open question. Only one window opens per settings home (LIGHTKEEPER_HOME, or the default local app-data folder); background recording continues independently. - Live view. Connect, start the live view, aim the fiber and check the exposure.
- Plan. Fill in the run: label, site, start and stop, and the setup fields. Then check the Schedule tab.
- Start run… Cover the input for the pre-run dark set. Uncover it when asked, then press Continue. The run waits in STANDBY until the start time.
- After the stop time, cover the input again for the post-run dark set.
| Setting | Environment variable | Default |
|---|---|---|
| Run folder | LIGHTKEEPER_DATA_ROOT |
Documents\LightKeeper Runs |
| Site (lat, lon) | LIGHTKEEPER_SITE, for example 51.48,-0.0 |
0, 0. Set this before scheduling on sun events. |
| Time zone for names and schedules | LIGHTKEEPER_TZ, an IANA name |
America/New_York |
| Python | LIGHTKEEPER_PYTHON |
first pythonw.exe on PATH |
| Open the spectrometer on start | LIGHTKEEPER_AUTOCONNECT (0 = off) |
on |
The window remembers the last run folder and site you used.
| Document | Contents |
|---|---|
| Manual | window, run sequence, file format, calibration, sun scheduling, background recorder and resume |
| Changelog | release notes |
| Third-party notices | OceanDirect SDK, NIST ASD data |
python -X utf8 -m unittest discover -s tests -vThe tests run against the simulator:
- a full run;
- resume after a kill and after an interruption;
- burst skipping;
- the reconnect race that once stopped an armed run;
- calibration recovery;
- the clock check, with a mocked socket;
- the 2026 daylight-saving change.
The GUI checks (tests/gui_recorder_smoke.py, tests/gui_schedule_running.py, tests/gui_save_spectrum.py, tests/gui_time_range.py, tests/gui_preflight.py, tests/gui_watchdog.py) are scripts that run off-screen with
QT_QPA_PLATFORM=offscreen. python -X utf8 tools/make_social.py rebuilds the social preview, the icon and LightKeeper.ico.
LightKeeper is pre-1.0. It has recorded field runs on a Maya2000 Pro. Some parts are tested only with the simulator:
- hand-off of the device between the window and the recorder;
- reopening after a USB fault;
- resume after a Windows restart.
Licensed under the MIT License. LightKeeper is independent community software, not affiliated with or endorsed by Ocean Insight. The OceanDirect SDK is not included and is installed separately under Ocean Insight's terms.



