Repository for useful python data analysis functions for the Diamond Magnetic Materials Group
| Source | https://github.com/DiamondLightSource/mmg_toolbox |
|---|---|
| PyPI | pip install mmg_toolbox |
| Documentation | https://diamondlightsource.github.io/mmg_toolbox |
| Releases | https://github.com/DiamondLightSource/mmg_toolbox/releases |
Requires: Python >=3.10, Numpy, h5py, matplotlib, hdfmap, nexus2srs
python -m pip install mmg_toolboxmmg_toolbox is available via the module system:
$ module load mmg
(python)$ dataviewerStart the dataviewer from a terminal
$ dataviewerOr, to open the data viewer in the current folder:
$ dataviewer .Or, to open the file viewer for a specific file:
dataviewer path/to/file.nxsmmg_toolbox contains many useful tools for data analysis in python scripts, for example:
import matplotlib.pyplot as plt
from mmg_toolbox import Experiment
exp = Experiment('/path/to/files')
# list scans
all_scans = exp.all_scan_numbers() # {scan_number: filename}
print('\n'.join(exp.scans_str(*all_scans)))
exp.plot(1108746, 1108747, 1108748)
scans = exp.scans(*range(-10, 0))
for scan in scans:
scan.plot()
axes, signal = scan.eval('axes, signal')mmg_toolbox contains a tkinter based dataviewer for viewing data in NeXus files. Various plotting and processing
capabilities are available.

mmg_toolbox is still under development, so if you have any feedback, found any bugs or have any feature requests - please do let me know!