# bfit
<a href="https://pypi.org/project/bfit/" alt="PyPI Version"><img src="https://img.shields.io/pypi/v/bfit?label=PyPI%20Version"/></a>
<img src="https://img.shields.io/pypi/format/bfit?label=PyPI%20Format"/>
<img src="https://img.shields.io/github/languages/code-size/dfujim/bfit"/>
<img src="https://img.shields.io/tokei/lines/github/dfujim/bfit"/>
<img src="https://img.shields.io/pypi/l/bfit"/>
<a href="https://github.com/dfujim/bfit/commits/master" alt="Commits"><img src="https://img.shields.io/github/commits-since/dfujim/bfit/latest/master"/></a>
<a href="https://github.com/dfujim/bfit/commits/master" alt="Commits"><img src="https://img.shields.io/github/last-commit/dfujim/bfit"/></a>
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](https://github.com/dfujim/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
* [Documentation](https://github.com/dfujim/bfit/wiki)
* [API reference](https://github.com/dfujim/bfit/wiki/API-Reference)
* [GUI Tutorial](https://github.com/dfujim/bfit/wiki/GUI-Tutorial)
### Community Guidelines
* Contributing: Please submit a pull request!
* Reporting issues or seeking support: please create an [issue](https://github.com/dfujim/bfit/issues), 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](https://tkdocs.com/tutorial/install.html) |
| python version 3.6 or higher | [Directions](https://www.python.org/downloads/) |
### 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](http://musr.ca/mud/runSel.html) according to the defaults set in the [bdata](https://pypi.org/project/bdata/) package.
### First Startup
To launch the GUI, simply call
```bash
bfit
```
in the terminal. If this fails, one can also use the
```bash
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](https://gitlab.com/rmlm/bnmr_1f): A command line tool written by R.M.L. McFadden to analyze CW resonance (1f) measurements.
* [bnmr_2e](https://gitlab.com/rmlm/bnmr_2e): A command line tool written by R.M.L. McFadden to analyze pulsed resonance (2e) measurements.
* [bnmrfit](https://gitlab.com/rmlm/bnmrfit) physica scripts: An older command line tool, well tested through well over a decade of use. The fitting is somewhat minimal however.
* [BNMROffice](https://github.com/hsaadaoui/bnmroffice): A GUI analysis tool similar to bfit, although out of date with regards to new run modes, and no longer maintained.
* [musrfit](http://lmu.web.psi.ch/musrfit/user/html/index.html#): A popular and extensive analysis tool for muSR experiments for which a library of [β-NMR functions](http://lmu.web.psi.ch/musrfit/user/html/user-libs.html) 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](https://root.cern.ch/doc/master/Minuit2Page.html) provided by [ROOT](https://root.cern/), 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](https://musr.ca/mud/runSel.html). For example, see the run headers for [run 40123 from 2020](https://musr.ca/mud/mud_hdrs.php?ray=Run%2040123%20from%20BNMR%20in%202020&cmd=heads&fn=data/BNMR/2020/040123.msr).
The user is invited to follow the [usage example](https://github.com/dfujim/bfit/wiki/Example-Usage) to confirm their installation is behaving as expected.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
bfit-4.7.0.tar.gz (77个子文件)
bfit-4.7.0
bfit
test
calculator_nqr_B0.py 625B
tab_fetch_files.py 3KB
leastsquares.py 2KB
testing.py 962B
tab_fileviewer.py 2KB
functions.py 5KB
calculator_nmr_atten.py 873B
minuit.py 2KB
calculator_nmr_B1.py 561B
__init__.py 13B
do_test.py 2KB
global_fitter.py 5KB
__init__.py 4KB
backend
entry_color_set.py 732B
FunctionPlacer.py 23KB
ParameterFunction.py 3KB
fitdata.py 8KB
PltTracker.py 15KB
raise_window.py 267B
colors.py 475B
__init__.py 98B
ConstrainedFunction.py 4KB
__main__.py 67B
fitting
fitter_migrad_hesse.py 944B
fitter.py 21KB
fitter_migrad_minos.py 943B
integrator.cpp 881KB
leastsquares.py 6KB
functions.py 8KB
fitter_curve_fit.py 892B
decay_31mg.py 14KB
minuit.py 6KB
__init__.py 292B
FastNumericalIntegration_src
integration_fns.h 521B
DEIntegrationConstants.h 15KB
DEIntegrator.h 7KB
integration_fns.cpp 2KB
integrator.pyx 5KB
fit_bdata.py 17KB
global_bdata_fitter.py 3KB
global_fitter.py 31KB
data
icon.gif 5KB
nmr_antenna_data.csv 314B
gui
popup_set_ppm_reference.py 2KB
calculator_nqr_B0.py 5KB
tab_fetch_files.py 47KB
popup_ongoing_process.py 5KB
popup_param.py 10KB
bfit.py 75KB
tab_fileviewer.py 46KB
calculator_nmr_atten.py 7KB
popup_terminal.py 2KB
popup_fit_results.py 11KB
template_fit_popup.py 13KB
popup_drawstyle.py 3KB
popup_fit_constraints.py 12KB
tab_fit_files.py 102KB
popup_show_param.py 4KB
calculator_nmr_B1.py 5KB
__init__.py 17B
popup_add_param.py 8KB
popup_units.py 3KB
popup_redraw_period.py 2KB
popup_deadtime.py 3KB
popup_set_histograms.py 5KB
setup.cfg 38B
README.md 5KB
LICENSE 34KB
PKG-INFO 7KB
bfit.egg-info
dependency_links.txt 1B
PKG-INFO 7KB
SOURCES.txt 2KB
top_level.txt 5B
entry_points.txt 36B
requires.txt 157B
MANIFEST.in 212B
setup.py 2KB
共 77 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功