β-NMR and β-NQR Data Analysis
Project description
bfit
A Python application for the analysis of β-detected nuclear magnetic and quadrupole resonance (β-NMR and β-NQR) data taken at TRIUMF. These techniques are similar to muon spin rotation (μSR), using a radioactive atomic ion in the place of the muon. bfit has been written to satisfy the following needs:
- Provide the means for quick on-line analyses during beam time.
- Provide a useful and flexible API for refined analyses in Python3, in conjunction with bdata.
- User-friendly for non-programmers.
- Be easily maintainable and distributable.
The intended audience is any user of the the β-NMR or β-NQR spectrometers, be they a new student, visiting scientist, or someone from the local group with decades of experience.
Useful links
Community Guidelines
- Contributing: Please submit a pull request!
- Reporting issues or seeking support: please create an issue, and I will get an email with your problem.
Installation
Dependencies needed pre-install
Package | Install Instruction |
---|---|
Cython | pip3 install --user Cython |
NumPy | pip3 install --user numpy |
Tkinter for python3 | Directions |
python version 3.6 or higher | Directions |
Installation
Command | |
---|---|
Install as user (recommended) | pip install --user bfit |
Install as root | pip install bfit |
Note that pip
should point to the python3 version. If the above does not work try pip3
or python3 -m pip
instead.
Optional Setup
You may want to tell bfit where the data is stored. This is done by defining environment variables
BNMR_ARCHIVE
and BNQR_ARCHIVE
(for convenience add this to your .bashrc script). The expected file format is as follows:
/path/
bnmr/
bnqr/
2017/
2018/
045123.msr
In this example, you would set BNQR_ARCHIVE=/path/bnqr/
to the directory containing the year directories.
If bfit cannot find the data, it will attempt to download the files from musr.ca according to the defaults set in the bdata package.
First Startup
To launch the GUI, simply call
bfit
in the terminal. If this fails, one can also use the
python3 -m bfit
syntax, where python3
may be replaced with any python3 executable.
Testing your installation
Testing bfit is most easily accomplished by comparing with a number of other independently developed codes:
- bnmr_1f: A command line tool written by R.M.L. McFadden to analyze CW resonance (1f) measurements.
- bnmr_2e: A command line tool written by R.M.L. McFadden to analyze pulsed resonance (2e) measurements.
- bnmrfit physica scripts: An older command line tool, well tested through well over a decade of use. The fitting is somewhat minimal however.
- BNMROffice: A GUI analysis tool similar to bfit, although out of date with regards to new run modes, and no longer maintained.
- musrfit: A popular and extensive analysis tool for muSR experiments for which a library of β-NMR functions has been included by Z. Salman.
These, and a number of un-published works from R.M.L. McFadden and W.A. MacFarlane, were used to test bfit. Most of them rely on the MINUIT2 minimizer provided by ROOT, so the bfit "migrad" minimizer should be used for a best comparison.
The header information can be checked against that provided from the online archive search. For example, see the run headers for run 40123 from 2020.
The user is invited to follow the usage example to confirm their installation is behaving as expected.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.