Package: bdata
bdatabdatais a lightwieghtPythonpackage 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 intended user ofbdatais anyone analyzing data taken fromTRIUMF's β-NMR or β-NQR spectrometers.
A key goal of the project is to alleviate much of the technical tedium that is
often encountered during any analysis.Used withbfitand theSciPyecosystem,bdataforms part of a flexible API
in the analysis of β-NMR and β-NQR data.bdatahas been written to fullfill the following needs:Provide an intuitive means of interfacing withMUDfiles inPython.Fetch missing local data from thearchive.Support analyses by providing common data manipulations, such as calculating
asymmetries or combining scans.Contentsbdata[object]: access β-NMR and β-NQRMUDfilesbjoined[object]: appendbdataobjectsbmerged[object]: combinebdataobjectslife[mdictobject]: dictionary of probe lifetimes.containers[module]: specially definedmdictobjects with set function.exceptions[module]: custom exceptions and warnings for common issuesasym_fns[module]: functions for calculating asymmetries and errorsCitingIf you usebdatain your work, please cite:D. Fujimoto.Digging Into MUD With Python: mudpy, bdata, and bfit.arXiv:2004.10395 [physics.data-an].Community GuidelinesPlease submit contributions tobdatavia a pull requestTo report issues or get support, please file a new issueInstallation and UseDependenciesThe following packages/applications are needed prior tobdatainstallation:Python3.6 or higher: a dynamically typed programming language. [install]and the following are handelled automatically when retrievingbdatafrom thePyPI:iminuit: aJupyter-friendlyPythoninterface for theMINUIT2library.mudpy: data structures for parsingTRIUMFMUDfiles.pandas: a fast, powerful, flexible and easy to use data analysis/manipulation tool.requests: an elegant and simpleHTTPlibrary forPython.SciPy: fundamental algorithms for scientific computing inPython.Install InstructionsCommandFrom thePyPIas user (recommended)pip install --user bdataFrom thePyPIas rootpip install bdataFrom 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 ConfigurationFor convenience,
you may want to tellbdatawhere 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/Ifbdatacannot find the data, it will attempt to download the relaventMUDfiles
from thearchiveand store them in$HOME/.bdata.
This is the default behaviour forbdatainstalled fromPyPI