Element Emission¶
This guide simulates visible emission lines for copper, sodium, and potassium. It demonstrates denoising, baseline correction, line peak picking, and matching against a small element-line table. Use safe sources and appropriate eye/fire safety for real emission experiments.
python -m lux.experiments element-emission-vis --json
from lux.peaks import detect_peaks
from lux.preprocess import asymmetric_least_squares_baseline, savitzky_golay
smoothed = savitzky_golay(counts, window=5, degree=2)
corrected = smoothed - asymmetric_least_squares_baseline(smoothed)
peaks = detect_peaks(wavelengths_nm, corrected, baseline_correct=False)