bdata
bdata is a lightwieght Python package 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 intended user of bdata is anyone analyzing data taken from TRIUMF'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 with bfit and the SciPy ecosystem, bdata forms part of a flexible API in the analysis of β-NMR and β-NQR data. bdata has been written to fullfill the following needs:
- Provide an intuitive means of interfacing with MUD files in Python.
- Fetch missing local data from the archive.
- Support analyses by providing common data manipulations, such as calculating asymmetries or combining scans.
Contents
bdata[object]: access β-NMR and β-NQR MUD filesbjoined[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 errors
Citing
If you use bdata in your work, please cite:
- D. Fujimoto. Digging Into MUD With Python: mudpy, bdata, and bfit. arXiv:2004.10395 [physics.data-an].
Community Guidelines
- Please submit contributions to bdata via a pull request
- To report issues or get support, please file a new issue
Installation and Use
Dependencies
The following packages/applications are needed prior to bdata installation:
and the following are handelled automatically when retrieving bdata from the PyPI:
- iminuit : a Jupyter-friendly Python interface for the MINUIT2 library.
- mudpy : data structures for parsing TRIUMF MUD files.
- pandas : a fast, powerful, flexible and easy to use data analysis/manipulation tool.
- requests : an elegant and simple HTTP library for Python.
- SciPy : fundamental algorithms for scientific computing in Python.
Install Instructions
| Command | |
|---|---|
| From the PyPI as user (recommended) | pip install --user bdata |
| From the PyPI as root | pip install bdata |
| From source | python3 setup.py install |
Note that pip should point to a (version 3) Python executable
(e.g., python3, python3.8, etc.).
If the above does not work, try using pip3 or python3 -m pip instead.
Optional Configuration
For convenience,
you may want to tell bdata where the data is stored on your machine.
This is done by defining two environment variables:
BNMR_ARCHIVE and BNQR_ARCHIVE.
This can be done, for example, in your .bashrc script.
Both variables expect the data to be stored in directories with a particular
heirarchy:
/path/
bnmr/
bnqr/
2017/
2018/
045123.msr
Here, the folders /path/bnmr/ and /path/bnqr/ both contain runs
(i.e., .msr files) organized into subdirectories by year of aquasition.
In this case, you would set (in your .bashrc):
export BNMR_ARCHIVE=/path/bnmr/
export BNQR_ARCHIVE=/path/bnqr/
If bdata cannot find the data, it will attempt to download the relavent MUD files
from the archive and store them in $HOME/.bdata.
This is the default behaviour for bdata installed from PyPI
Metadata
Release files for bdata 6.11.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bdata-6.11.5.tar.gz | 60.7 kB | Without provenance | Details |
Release files / bdata-6.11.5.tar.gz
| Download URL | bdata-6.11.5.tar.gz |
|---|---|
| Size | 60.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d6d57850614086d15ecc0ef04f06142a8091d508921936d5bd6886cb6a72d7e
|
|
BLAKE2b-256 checksum How to use checksums |
c307b2fff02ebd6e372ed2fc9d4aa5b59871034d878c9a680d17915492a196c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for bdata 6.11.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.