{"id":47216857,"url":"https://github.com/diamondlightsource/mmg_toolbox","last_synced_at":"2026-03-13T16:01:27.317Z","repository":{"id":258270283,"uuid":"873562741","full_name":"DiamondLightSource/mmg_toolbox","owner":"DiamondLightSource","description":"Repository for useful python data analysis functions for the Diamond Magnetic Materials Group","archived":false,"fork":false,"pushed_at":"2026-03-11T16:11:38.000Z","size":2017,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-11T17:04:54.393Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DiamondLightSource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-16T11:29:46.000Z","updated_at":"2026-03-09T18:30:09.000Z","dependencies_parsed_at":"2025-03-11T09:22:35.983Z","dependency_job_id":"baa0ef81-95ef-4ac7-96cd-1701490288dc","html_url":"https://github.com/DiamondLightSource/mmg_toolbox","commit_stats":null,"previous_names":["danporter/mmg_toolbox","danporter/mmg_data_analysis","diamondlightsource/mmg_toolbox"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/DiamondLightSource/mmg_toolbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fmmg_toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fmmg_toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fmmg_toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fmmg_toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiamondLightSource","download_url":"https://codeload.github.com/DiamondLightSource/mmg_toolbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fmmg_toolbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30469844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-13T16:00:56.920Z","updated_at":"2026-03-13T16:01:27.297Z","avatar_url":"https://github.com/DiamondLightSource.png","language":"Python","readme":"[![PyPI](https://img.shields.io/pypi/v/dls-dodal.svg)](https://pypi.org/project/mmg_toolbox)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![](https://img.shields.io/github/forks/DiamondLightSource/mmg_toolbox?label=GitHub%20Repo\u0026style=social)](https://github.com/DiamondLightSource/mmg_toolbox)\n\n# mmg_toolbox\nRepository for useful python data analysis functions for the Diamond Magnetic Materials Group\n\n\nSource          | \u003chttps://github.com/DiamondLightSource/mmg_toolbox\u003e\n:---:           | :---:\nPyPI            | `pip install mmg_toolbox`\nDocumentation   | \u003chttps://diamondlightsource.github.io/mmg_toolbox\u003e\nReleases        | \u003chttps://github.com/DiamondLightSource/mmg_toolbox/releases\u003e\n\n\n### Installation\n*Requires:* Python \u003e=3.10, Numpy, h5py, matplotlib, hdfmap, nexus2srs\n```bash\npython -m pip install mmg_toolbox\n```\n\n### @DLS\nmmg_toolbox is available via the module system:\n```bash\n$ module load mmg\n(python)$ dataviewer\n# OR\n(python)$ create_notebooks\n```\n\n### Usage - Read a NeXus scan file\nRead data from a NeXus scan file in a python prompt or script\n```python\nfrom mmg_toolbox import data_file_reader\nscan = data_file_reader('12345.nxs', beamline='i16')\nprint(scan)  # print a metadata string\n\nscan.plot.plot()  # plot defaults\nscan.plot.show()\n```\n\n### Usage - DataViewer\nStart the dataviewer from a terminal\n```bash\n$ dataviewer\n```\nOr, to open the data viewer in the current folder:\n```bash\n$ dataviewer .\n```\nOr, to open the file viewer for a specific file:\n```bash\ndataviewer path/to/file.nxs\n```\n\n### Usage - Scripting\nmmg_toolbox contains many useful tools for data analysis in python scripts, for example:\n\n```python\nimport matplotlib.pyplot as plt\nfrom mmg_toolbox import Experiment\n\nexp = Experiment('/path/to/files')\n\n# list scans\nall_scans = exp.all_scan_numbers()  # {scan_number: filename}\nprint('\\n'.join(exp.scans_str(*all_scans)))\n\nexp.plot(1108746, 1108747, 1108748)\n\nscans = exp.scans(*range(-10, 0))\nfor scan in scans:\n    scan.plot()\n    axes, signal = scan.eval('axes, signal')\n```\n\n### create_notebooks\nthe *create_notebooks* script is included as a simple way to get started and create some default scripts in your\nworking directory. By default you will be prompted to provide a beamline and a directory or visit ID. The\nscript can then start a Jupyter Lab instance in that directory.\n\n| command                         |                                                        |\n|---------------------------------|--------------------------------------------------------|\n| `$ create_notebooks`            | interactively create scripts and start jupyter         |\n| `$ create_notebooks -b i10-1 .` | create i10-1 specific scripts in the current directory |\n| `$ create_notebooks --help`     | additional options                                     |\n\n### Dataviewer\nmmg_toolbox contains a tkinter based dataviewer for viewing data in NeXus files. Various plotting and processing \ncapabilities are available.\n![mmg_dataviewer](docs/images/mmg_dataviewer.png)\n\n\n## Feedback\nmmg_toolbox is still under development, so if you have any feedback, found any bugs or have any feature requests - \nplease do let me know! \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Fmmg_toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiamondlightsource%2Fmmg_toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Fmmg_toolbox/lists"}