SpectrometerLab – Help (English)offline help

Offline user guide for spectral acquisition, calibration and analysis on Windows 10.

Overview

This application is a tool to acquire and analyze optical spectra using a camera looking at your spectrometer’s spectral strip. It displays a real‑time spectrum with a nanometer‑calibrated X axis, supports automatic calibration with a mercury lamp, smile correction, spectral line identification via a line database, spectrum comparison, and multiple export options.

Channels
LIVE (real time), REF (snapshot), CMP (comparison).
Markers
Flags (vertical markers) for peaks, known lines, calibration anchors, notes, etc.
ROI
Sensor window used to isolate the spectral band (StartX/EndX, StartY/SizeY).
Practical tip: for any calibration (Hg or smile) aim for a clean spectrum with good dynamic range and no clipping. If peaks are flat at the top, reduce exposure/gain.

Quick start

  1. In Video input, choose Device and Mode, then click Connect.
  2. Adjust the ROI (StartY/SizeY and StartX/EndX) so it contains only the useful spectral strip.
  3. (Optional) Use AUTO ROI to get an automatic suggestion for the horizontal ROI.
  4. With a mercury lamp: run AUTO CALIB (Hg) to calibrate wavelength.
  5. (Optional) Run AMP CAL (Hg) and enable Response correction to compensate the system response.
  6. Switch to unknown sources and use Line DB + flags to identify lines.

Video acquisition & ROI

“Video input” panel

  • Device: select the camera (UVC/DirectShow compatible).
  • Mode: resolution / pixel format / frame‑rate.
  • Connect / Disconnect: start/stop acquisition.
  • Pause: freezes the last frame and spectrum (handy for calibration and measurements).
  • Driver controls…: opens camera driver property pages (if available).

ROI and sampling

  • StartY and SizeY: define the vertical sensor band used to extract the strip.
  • StartX and EndX: horizontally limit the analyzed spectral region.
  • Flip H: horizontal flip of the spectrum (useful if the optical path mirrors the image).
If the spectrum looks weak/noisy, try increasing SizeY (average over more sensor rows) and/or enable filters.

Filtering & display

Filters

  • Spatial averaging: smoothing along X (higher = smoother, but less fine detail).
  • Rising / Falling: temporal response to increases/decreases (100 = fastest).
  • Average + N: average N frames before the temporal filter.

Log scale

  • Log scale: logarithmic display (visualization only; exports keep linear data).
  • Factor: controls log emphasis.

Strip preview

  • Preview shows the sampled strip; Enhance strip preview applies extra gain only to the preview.

Wavelength calibration (Hg)

Calibration maps sensor bins to wavelength (nm). With a mercury lamp (Hg) you can do a quick point‑based calibration or a fully automatic multi‑line calibration.

1) Point calibration: “CALIB (Hg peak)…”

  1. Illuminate the spectrometer with the Hg lamp and optimize exposure/ROI.
  2. Click CALIB (Hg peak)….
  3. Select one of the suggested prominent peaks.
  4. Enter the wavelength in nm for that peak (use known Hg lines).
  5. Repeat on multiple peaks to improve accuracy.
Calibration points are saved to the calibration file and can be edited in Edit….

2) Automatic calibration: “AUTO CALIB (Hg)”

  1. With the Hg lamp on, press AUTO CALIB (Hg).
  2. The software detects peaks, matches them to Hg lines, and builds the nm mapping.
  3. If Guided calibration is enabled, you may be asked to confirm the correct candidate when ambiguous.

Guided calibration (assisted refinement)

  • Off: fully automatic.
  • On demand: ask only when uncertain.
  • Always: confirm every selected anchor.

Spectral range (nm)

The Spectral range (nm) fields define the full calibrated X axis span (e.g. 340..1050 nm), even if the calibration source does not cover the whole instrument range (typical for Hg in the NIR).

Calibration file management

  • Edit…: manually edit points (Bin ↔ Nanometers).
  • Load… / Save…: load/save calibration files (Theremino‑compatible format).
  • Revert: undo the last auto‑calibration and restore the previous one.
If auto‑calibration fails, you typically have too little signal or too few usable peaks: increase exposure, reduce smoothing, tighten the ROI, or add points via CALIB (Hg peak)….

Amplitude / response calibration (Hg)

In addition to the nm axis, the application can apply a response correction to compensate the wavelength‑dependent sensitivity of the system (optics + sensor).

Workflow: “AMP CAL (Hg)” + “Response correction”

  1. Acquire a well‑exposed Hg spectrum (avoid saturation).
  2. Click AMP CAL (Hg) to estimate a relative correction curve.
  3. Toggle Response correction to enable/disable applying it.

Viewing and exporting the curve

  • View → Show Response Curve overlays the correction curve on the plot (diagnostic).
  • File → Export Response Curve… exports nm,factor to CSV.
This correction is designed for relative equalization and comparison. Absolute radiometric calibration requires dedicated standards and procedures.

Smile correction

“Smile” is the curvature of spectral lines across the strip height (lines are not perfectly vertical). The software can learn a correction from the current frame and apply it during spectrum extraction.

How to use

  1. Use a source with sharp lines (Hg is ideal) and focus the optics.
  2. Menu Process → Learn Smile Correction….
  3. Enable Process → Smile Correction to apply it.
  4. Optional: enable Show Smile Preview (raw + corrected) to see a diagnostic strip (RAW on top, corrected below).
Smile correction is especially helpful when using a large SizeY: without correction, curved lines can smear and reduce spectral resolution.

Line identification & database

To identify emission/absorption lines you can load a CSV line database and browse it in a dedicated panel, run a peak detector, and/or place manual markers.

Loading a Line DB

  • File → Load Line DB… loads a spectral line CSV database.
  • Typical columns include: element, spectrum/series, wavelength_nm, intensity_rel, blend group (~1 nm), comment.
  • View → Line DB Viewer opens the viewer and its filters.

Line DB Viewer

  • Select an Element (e.g., Hg, Ne, Ar…).
  • Use Min I to filter out weak lines.
  • Only instrument range limits to the instrument wavelength span (default 340..1050 nm or user‑set).
  • Only current plot range limits to the currently zoomed plot region.
  • Select table rows to toggle corresponding flags on the spectrum plot.
  • Clear Line‑DB flags removes flags created from the database.

Peak detection

  • Process → Peak Detector… finds peaks and adds “Peak” flags.
  • Process → Export Peaks CSV… exports the detected peak list.

Manual flags

  • Left‑click inside the plot: adds a manual flag at that wavelength.
  • Shift‑click (or middle click): pins the cursor only (no flag).

Spectrum comparison (LIVE/REF/CMP)

A reference channel helps you compare spectra over time or across different conditions.

LIVE and REF

  • LIVE: continuously updated spectrum.
  • REF: snapshot buffer. Press →REF to copy current LIVE into REF.

CMP (compare)

  • CMP: overlays LIVE vs REF and highlights their difference.
  • Normalize: normalizes LIVE and REF to their own peaks before comparing (useful when brightness changes).
  • Δ exaggeration: visually boosts the difference area (display only).

Synthetic reference: Blackbody

Process → Load Blackbody into REF… generates a blackbody (Planck) spectrum at a chosen temperature (Kelvin) and stores it into REF, so you can use CMP to compare LIVE against an ideal reference.

Export & saving

  • File → Export Spectral Data…: export the current spectrum (all points) to CSV.
  • File → Export Response Curve…: export the response correction curve (if available) to CSV.
  • Process → Export Peaks CSV…: export the peak list.
  • File → Save pixmap…: save the plot as an image (PNG/JPG).
  • File → Load Flags… / Save Flags…: load/save flags (markers) to XML.
  • Process → Clear Flags: remove all flags (shortcut Ctrl+Shift+L).
  • Process → Clear Output: clear the “Process output” log panel.

Context menus & interaction

Mouse on the plot

  • Mouse wheel: zoom around the pointer position.
  • Double‑click: reset zoom (full range).
  • Left‑click: add a manual flag.
  • Shift+click (or middle click): pin cursor without a flag.
  • Hover over a flag: tooltip shows nm, value, bin and type.

Context menu (right‑click)

  • Add manual flag here: create a manual flag at the clicked wavelength.
  • Pin cursor here (no flag): pin the cursor.
  • Remove selected flag: remove the selected flag.
  • Cleanup actions: Clear all flags or by type (Peak / Manual / Calib / Line‑DB).

Keyboard

  • Delete/Backspace: delete the selected flag.
  • Esc: clear selection.

Remote control via local socket

The application exposes a local control interface (same PC) for integration with external tools. A client can connect to a stable service name and request the LIVE spectrum or subscribe to receive continuous updates.

Service name
SpectrometerLab.Spectrum
Capabilities
Ping, request LIVE spectrum, subscribe for periodic spectrum events.

Available commands

  • PING: checks whether the service is reachable.
  • GET_LIVE_SPECTRUM: returns the LIVE spectrum (calibrated: nm + amplitude).
  • SUBSCRIBE_LIVE: enable/disable periodic spectrum events.
Useful for: automated logging, external dashboards, continuous recording, laboratory automation.

Tips & troubleshooting

  • “No peaks found”: increase exposure or reduce smoothing; tighten ROI around the bright band.
  • Saturated peaks: reduce exposure/gain; clipping makes calibration/response unstable.
  • Spectrum reversed: enable Flip H.
  • Visible smile (arched lines in the preview): run Learn Smile Correction and enable Smile Correction.
  • Consistent comparisons: use →REF to capture a reference, then CMP with Normalize if brightness changes.
  • Line identification: load an appropriate Line DB and use Min I to avoid overly dense lists.