Package: bfit
bfitbfitis aPythonapplication aimed to aid in the analysis of β-detected
nuclear magnetic/quadrupole resonance (β-NMR and β-NQR) data taken atTRIUMF.
These techniques are similar to muon spin rotation (μSR) and "conventional"
nuclear magnetic resonance (NMR), but use radioactive nuclei as theirNMRprobe in place of themuonor a stable isotope.
The instruments and research program are governed throughTRIUMF'sCMMS,
with more information given athttps://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 ofbfitis anyone performing experiments with or analyzing
data taken fromTRIUMF'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/UBCgroup).
A key goal of the project is to alleviate much of the technical tedium that is
often encountered during any analysis.
More generally,bfithas 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 inPython,
to be used in conjunction withbdataand theSciPyecosystem.Provide an intuitive, user-friendly interface for non-programmers.Be easily maintainable and distributable.CitingIf you usebfitin your work, please cite:D. Fujimoto, "bfit: A Python Application For Beta-Detected NMR,"J. Open Source Softw.6, 3598 (2021).Useful LinksbfitWikiAPI ReferenceAPI TutorialGUI TutorialmudpybdataCommunity GuidelinesContributing:Please submit your contribution tobfitthrough the list ofPull Requests!Reporting issues and/or seeking support:Please file a new ticket inbfit's list ofIssues- I will get an email
notification of your problem and try to fix it ASAP!Installation and UseDependenciesThe following packages/applications are neededpriortobfitinstallation:Python3.6 or higher: a dynamically typed programming language. [install]Tkinter:Python's de facto standard GUI package. [install]Install InstructionsCommandFrom thePyPIas user (recommended)pip install --user bfitFrom thePyPIas rootpip install bfitFrom sourcepython3 setup.py installNote thatpipshould point to a (version 3)Pythonexecutable
(e.g.,python3,python3.8, etc.).
If the above does not work, try usingpip3orpython3 -m pipinstead.Optional SetupFor convenience,
you may want to tellbfitwhere the data is stored on your machine.
This is done by defining two environment variables:BNMR_ARCHIVEandBNQR_ARCHIVE.
This can be done, for example, in your.bashrcscript.
Both variables expect the data to be stored in directories with a particular
heirarchy:/path/
|---bnmr/
|---bnqr/
|-------2017/
|-------2018/
|-----------045123.msrHere, the folders/path/bnmr/and/path/bnqr/both contain runs
(i.e.,.msrfiles) organized into subdirectories by year of aquasition.
In this case, you would set (in your.bashrc):exportBNMR_ARCHIVE=/path/bnmr/exportBNQR_ARCHIVE=/path/bnqr/Ifbfitcannot find the data, it will attempt to download the relaventMUD(i.e.,.msr) files fromhttps://cmms.triumf.ca/mud/runSel.html.
This is the default behaviour forbfitinstalled fromPyPI.First StartupTo launch the GUI from a terminal simply callbfit, if this fails, one can also use the alternative syntaxpython3 -m bfit, wherepython3may be replaced with any (version 3)Pythonexecutable.TestingTesting your installation ofbfitis accomplished by runningpytestwithin 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 subsequent attempts:pytest --lf. Further testing information can be foundhere.