β-NMR and β-NQR Data Analysis
bfit is a Python application aimed to aid in the analysis of β-detected nuclear magnetic/quadrupole resonance (β-NMR and β-NQR) data taken at TRIUMF. These techniques are similar to muon spin rotation (μSR) and "conventional" nuclear magnetic resonance (NMR), but use radioactive nuclei as their NMR probe in place of the muon or a stable isotope. The instruments and research program are governed through TRIUMF's CMMS, with more information given at https://bnmr.triumf.ca. An overview of instrumentation details and scientific applications of the β-NMR/β-NQR techniques can be found in several recent journal articles:
- W. A. MacFarlane. Implanted-ion βNMR: a new probe for nanoscience. Solid State Nucl. Magn. Reson. 68-69, 1-12 (2015).
- G. D. Morris. β-NMR. Hyperfine Interact. 225, 173-182 (2014).
The intended user of bfit is anyone performing experiments with or analyzing data taken from TRIUMF's β-NMR or β-NQR spectrometers - independent of whether they are a new student, visiting scientist, or someone with decades of experience. (e.g., someone from the "local" TRIUMF/CMMS/UBC group). A key goal of the project is to alleviate much of the technical tedium that is often encountered during any analysis. More generally, bfit has been written to fulfill the following needs:
- Provide the means for quick on-line analyses during beam time.
- Provide a useful and flexible API for refined analyses in Python, to be used in conjunction with bdata and the SciPy ecosystem.
- Provide an intuitive, user-friendly interface for non-programmers.
- Be easily maintainable and distributable.
- D. Fujimoto. Digging into MUD with Python: mudpy, bdata, and bfit. arXiv:2004.10395 [physics.data-an].
- Reporting issues and/or seeking support:
Installation and Use
The following packages/applications are needed prior to bfit installation:
- Python 3.6 or higher: a dynamically typed programming language. [install]
- Tkinter : Python's de-factor standard GUI package. [install]
- Cython : C-language extensions for Python. [install]
- NumPy : array programming library for Python. [install]
- argparse : a parser for command-line options, arguments and sub-commands.
- bdata : data structures and algorithms for retrieving/processing TRIUMF β-NMR/β-NQR data.
- iminuit : a Jupyter-friendly Python interface for the MINUIT2 library.
- Matplotlib : comprehensive library for creating static, animated, and interactive visualizations in Python.
- pandas : a fast, powerful, flexible and easy to use data analysis/manipulation tool.
- PyYAML : a next generation YAML parser and emitter for Python.
- requests : an elegant and simple HTTP library for Python, built for human beings.
- SciPy : fundamental algorithms for scientific computing in Python.
- tqdm : a fast, extensible progress bar for Python.
|From the PyPI as user (recommended)||
|From the PyPI as root||
pip should point to a (version 3) Python executable
If the above does not work, try using
python3 -m pip instead.
you may want to tell bfit where the data is stored on your machine.
This is done by defining two environment variables:
This can be done, for example, in your
Both variables expect the data to be stored in directories with a particular
/path/ bnmr/ bnqr/ 2017/ 2018/ 045123.msr
Here, the folders
/path/bnqr/ both contain runs
.msr files) organized into subdirectories by year of aquasition.
In this case, you would set (in your
export BNMR_ARCHIVE=/path/bnmr/ export BNQR_ARCHIVE=/path/bnqr/
To launch the GUI from a terminal simply call
bfit, if this fails, one can also use the alternative syntax
python3 -m bfit, where
python3 may be replaced with any (version 3) Python executable.
Testing your installation of bfit is accomplished by running
pytest within the installation folder. Note that some tests, particularly those involving drawing, fail when run as group in this environment, but they should pass on a second attempt:
pytest --lf. Further testing information can be found here.
Release history Release notifications | RSS feed
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 bfit-4.9.1.tar.gz (281.8 kB)||File type Source||Python version None||Upload date||Hashes View|