Gamma Ray & Neutron Spectroscopy for Planetary Exploration
wara is a Python package for gamma-ray spectroscopy analysis and visualization. Some of its capabilities include:
- Spectrum smoothing, rebinning, plotting
- Peak searching given detector resolution and minimum SNR
- Spectrum decomposition into signal, noise, and background
- Peak fitting of multiple overlapping peaks with different background functions
- Extraction of Gaussian components of peaks
- Fully functional GUI
- Energy calibration
- Efficiency calibration
- FWHM vs. energy plots
- Time analysis from LYNX data
- Data visualization for PIXIE data in the context of Associated Particle Imaging (API)
- Gamma energy identification with built-in databases. Emphasis is placed on neutron induced gamma ray emission.
wara runs on Python 3.8 or higher. You can install it by downloading the package directly:
git clone https://github.com/NASA-Planetary-Science/wara.git
then run
pip install -e .
from the directory where pyproject.toml is located.
Try running the following (if the path is set correctly, the GUI can run from any directory;
otherwise, run from inside the wara folder):
wara -o
If running through the Spyder IDE, replace python with run.
The GUI window should appear. Then select File → Open → examples → data → test_data_cebr.csv. Click on Find peaks, select LaBr/CeBr, and hit Apply. You should see several lines identified in the spectrum. Drag the mouse over one or more lines to perform a Gaussian fit and feel free to play around. Info buttons are placed strategically to guide the user.
If you use the API data loading features, create a file called data-path.txt
in the repo root directory with one data folder path per line:
C:/Users/yourname/Documents/my-data
D:/external-drive/more-data
wara will search each path in order and use the first one that contains the requested run. This file is excluded from version control, so each user keeps their own local copy.
After installation, run the test suite with:
pip install pytest
pytest tests/
To run a specific test file:
pytest tests/test_spectrum.py
Full documentation is available at wara.readthedocs.io.
Code contributions are welcome!



