Simple Nuclear Spectra Analysis (SNSA) Tools. This repository containing basic tools to analyze nuclear spectra (mainly spe files of a specific format from Maestro)
- Clone the repository
- Setup a python virtual env
python -m venv <your_env_name>
source <your_env_name>/bin/activate
- Run the following to install all dependencies
pip install .
Use this to install in development mode
pip install -e .
- Pull latest docker image
docker pull ghcr.io/rxu17/snsa-tools:main
- Run docker image in interactive mode
docker run -it ghcr.io/rxu17/snsa-tools:latest /bin/bash
Here is a sample workflow to run the simple spectra analysis which reads in your input SPE file and generates a PNG image of the plot of counts vs channel number from the data retrieved from your SPE files.
python3 run_spe_analysis.py
-input <input_filepath>
-title <title_of_plot>
-output <output_filepath>
Otherwise, you can import specific functions from spe_analysis_functions for use in your own analysis and create your own SPEData objects from spe_core.
The format that the read method in the SPEData class expects is something like the following:
$SPEC_ID:
No sample description was entered.
$SPEC_REM:
DET# 1
DETDESC# DESKTOP-XXXXXX Easy-MCA-XXX SN 12471827
AP# Maestro Version 7.01
$DATE_MEA:
04/05/2023 20:07:54
$MEAS_TIM:
360 361
$DATA:
0 8191
0
0
0
0
0
0
0
0
0
0
0
0
$ROI:
3
1196 1200
2797 2825
3179 3207
$PRESETS:
Live Time
360
0
$ENER_FIT:
0.000000 1.00000
$MCA_CAL:
3
0.000000E+000 1.000000E+000 0.000000E+000 keV
$SHAPE_CAL:
3
0.000001E+000 0.000000E+000 0.000000E+000
Plots will be outputted like the following of Channel vs Counts:
These contain helpful functions for analysis
- Install pytest (an optional dependency) in your local python env
pip install ".[pytest]"
- Run tests
python3 -m pytest tests
