Tools for radiation spectral analysis.
Becquerel is a Python package for analyzing nuclear spectroscopic measurements. The core functionalities are reading and writing different spectrum file types, fitting spectral features, performing detector calibrations, and interpreting measurement results. It includes tools for plotting radiation spectra as well as convenient access to tabulated nuclear data, and it will include fits of different spectral features. It relies heavily on the standard scientific Python stack of numpy, scipy, matplotlib, and pandas. It is intended to be general-purpose enough that it can be useful to anyone from an undergraduate taking a laboratory course to the advanced researcher.
pip install becquerel
Features in development (contributions welcome!)
- Reading additional
Spectrumfile types (N42, CHN, CSV)
Spectrumobjects to various standard formats
- Fitting spectral features (e.g., gaussian lines with different background models)
If you are interested in contributing or are want to install the package from
source, please see the instructions in
When reporting issues with
becquerel, please provide a minimum working example to help identify the problem and tag the issue as a
For a feature request, please create an issue and label it as a
External dependencies are listed in
requirements.txt and will be installed
automatically with the standard
pip installation. They can also be installed
manually with the package manager of your choice (
html5lib are necessary for
Developers require additional requirements which are listed in
requirements-dev.txt. We use
pytest for unit testing and encourage
contributors to use
yapf for proper code formatting.
becquerel are welcome and encouraged, whether it is
reporting bugs, requesting features, or contributing code.
Please follow these guidelines when contributing to this project.
pip install -r requirements.txt pip install -r requirements-dev.txt python setup.py develop
(It is more convenient to use
develop so that the code is soft-linked
from the installation directory, and the installed package will always use
the current version of code.)
Running the tests
requirements-dev.txt to be installed)
To run the tests using
pytest, from the root directory of the repo:
python setup.py test is still supported also.)
By default, a code coverage report is printed to the terminal.
plottest are by default skipped for the sake of
speed. To run all tests, clear the pre-configured markers option:
pytest -m ""
To produce an HTML code coverage report in directory
with line-by-line highlighting:
pytest --cov-report html:htmlcov
Code Style Guide
Use google standards
flake8in your IDE
pylintfrom command line (as in style guide)
Checklist for code contributions:
- [ ] Branch off of
developand name the branch
- [ ] Develop the feature or fix
- [ ] Write tests to cover all use cases
- [ ] Ensure all tests pass (
python setup.py test)
- [ ] Ensure test coverage is >95%
- [ ] Ensure there are no linter issues:
flake8 becquerel tests
pydocstyle becquerel tests
pylint becquerel tests
- [ ] Spellcheck your code and docstrings
- [ ] Check style is consistent with Google Python style guide
- [ ] Push branch to GitHub and create a pull request
Becquerel v. 0.2.4, Copyright (c) 2017, The Regents of the University of California (UC), through Lawrence Berkeley National Laboratory, and the UC Berkeley campus (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Innovation & Partnerships Office at IPO@lbl.gov.
NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit other to do so.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size becquerel-0.2.4-py2.py3-none-any.whl (78.0 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View hashes|
|Filename, size becquerel-0.2.4.tar.gz (69.6 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for becquerel-0.2.4-py2.py3-none-any.whl