Low-Energy Ion Scattering (LEIS) is a surface analysis technique that involves bombarding a sample with low-energy ions (typically 0.5-10 keV) and analyzing the energy spectrum of the scattered ions at specific angles. This technique is particularly sensitive to the outermost atomic layers of the sample.
The SpecRec package is designed for comprehensive analysis of low-energy ion scattering spectroscopy data. It specifically addresses two main challenges: accounting for the transmission function of electrostatic analyzers and providing automated elemental analysis with surface concentration assessment for both simulated and experimental spectra. The package consists of two independent modules:
spectraConvDeconv_tools: Reconstructs the true energy distributions of ions that have been distorted by the electrostatic spectrometerLEIS_tools: Calculates elastic peak positions and sensitivity factors, while providing automated spectra analysis capabilities
The spectraConvDeconv_tools module was developed as part of research published in Elsevier's journal:
Current development focuses on enhancing the LEIS_tools module for quantitative surface characterization using LEIS spectra. A scientific paper detailing these developments is in preparation.
For detailed information about using LEIS tools, please refer to our comprehensive tutorial file. This tutorial covers basic theory, practical examples, and implementation details.
The energy spectra module provides sophisticated tools for handling analyzer transmission effects. SpecRec offers advanced post-processing capabilities for experimental spectra measured by electrostatic or magnetic particle separators. Key features include:
- Spectrum smoothing and noise addition
- Convolution and deconvolution operations with multiple kernel shapes:
- Gaussian
- Triangle
- Rectangle
- Custom arbitrary shapes
- Support for both constant and broadening full width at half maximum (FWHM)
These capabilities make SpecRec particularly valuable for mass analysis and ion scattering spectroscopy applications.
The theoretical foundation and detailed methodology are thoroughly documented in our recent publication. SpecRec implements both analytical and numerical approaches to spectrum reconstruction:
-
Analytical methods developed by:
-
Modern numerical methods, including:
These methods specifically address the Fredholm Integral Equation of the first kind, offering advantages over traditional convolution integral equations. As demonstrated by Yu. K. Golikov et al., this approach is essential for accurate analysis of electrostatic and magnetic spectrometer data.
This program is entirely Python-based and requires Python to be installed on your system. If you don't have Python installed, you can download it from the official Python website. The program requires the following Python libraries:
- numpy - for numerical computations
- scipy - for scientific calculations
- inteq - for solving integral equations
- plotly - for interactive visualizations
- matplotlib - for static plotting
- brokenaxes - for complex axis manipulations
You can install all dependencies using:
pip install -r requirements.txtIf you experience issues with pip, please refer to the official Python packaging guide. Alternatively, you can use the uv package manager by running uv run in the working directory.
The recommended entry point is our comprehensive tutorial notebook, which contains fundamental theory and practical examples of using this package.
While the program doesn't provide a graphical user interface, we recommend using Visual Studio Code, a free, cross-platform, and open-source IDE with excellent Python support. However, you can also run the scripts directly from the command line without an IDE.
The project consists of several key components:
-
spectraConvDeconv_tools.py- Core library containing all functions and global variables for spectral analysis. This module serves as a foundation for other components. -
LEIS_tools.py- Specialized module for analyzing ion energy losses, scattering angle deviations, cross-sections, and intensity correction factors. -
general_plots.py- Visualization tool for generating charts based on spectrometer transmission functions. Supports various kernel types ("gauss", "triangle", "rectangle", "LMM") and handles both simulated and experimental data.
-
/tools- Contains module sources -
/examples- Contains representative LEIS case studies demonstrating spectrometer resolution effects and error analysis. -
/raw_data- Houses raw simulation and experimental data, as referenced in our published paper. -
/out- Contains all generated outputs, including figures and processed spectral data. -
/out/gifs- Stores animated visualizations of convolution processes with broadening kernels, generated viageneral_plots.py. -
/docs- Contain pictures for tutorials and some docs
- Please note that execution of example scripts may require significant processing time, especially for complex calculations.
- For optimal performance, ensure your system meets the minimum requirements listed in the dependencies section.
- When working with large datasets, consider using smaller test samples first.
If you have questions about this program or encounter any execution problems, please reach out through:
- Telegram: Contact mauveferret
- Email: NEEfimov@mephi.ru
- GitHub Issues: Open an issue in the project repository
This project is licensed under the GNU General Public License. For complete terms and conditions, please see the LICENSE file in the repository.
We extend our gratitude to:
- The Inteq project team for their Python library dedicated to solving Fredholm and Volterra equations using the TwoMey method, which has been instrumental in LEIS energy spectra reconstruction.
- Ivan Nikitin for developing LEIS_calculator, from which the Cross-section submodule of SpecRec was adapted.
- The scientific community for their valuable feedback and contributions.

