Laser induced breakdown spectroscopy data analysis
Use pip to install the required libraries. The repository includes a
dependencies.txt file with the core packages:
pip install -r dependencies.txtThe peaky_demo_v1.ipynb notebook demonstrates the typical workflow for
finding and indexing spectral peaks.
-
Open the demo notebook
Launch Jupyter and open
peaky_demo_v1.ipynb. -
Import the analysis tools
from peaky_finder import PeakyFinder from peaky_indexer import PeakyIndexer
-
Create the Finder and Indexer
Provide the path to your raw spectrum data and initialize the classes:
data_dir = "path/to/raw/data" finder = PeakyFinder(data_dir) indexer = PeakyIndexer(finder)
-
Load data and fit spectra
finder.data.load_data() results = finder.fit_spectrum_data(sample_index, n_sigma=1)
-
Match peaks to database entries
matches = indexer.peak_match( results["sorted_parameter_array"], element_list=["Li", "Na", "Ca", "K", "Rb", "Cs", "Ba"], )
-
Visualize matched peaks (optional)
import numpy as np import matplotlib.pyplot as plt li_peaks = np.array(list(matches["Li"].ions[1.0].values())) plt.scatter(li_peaks[:, 0], li_peaks[:, 1])
These steps mirror the workflow in peaky_demo_v1.ipynb and provide a
starting point for analyzing laser-induced breakdown spectroscopy data.