Minimal Python lib to process OOMMF format output files
Project description
.+------+-------+-------+-------+-------+-------+-------+
.' .' .' .' .' .' .' .'|
+---+--+'------+'------+'------+'------+'------+'------+' -
| | | | | | | | |
| O + O + M + M + F + P + Y + +
| | | | | | | | .'
+------+'------+'------+'------+-------+-------+-------+'
OOMMFPy
A very minimal and simple Python library to read and extract data from OOMMF
magnetisation files omf, which are also used in MuMax3. In addition to this
library we provide tools to plot omf files and convert them to vtk files.
Highlights:
- Read
omffiles in any format - Can also read
ovffiles and MuMax3 files - Painless conversion of the data in an
omffile into Numpy arrays for data analysis - Fast calculation (using Numpy) of the skyrmion number in a slice of the
system in any plane orientation (
xy,xz,yz) - Fast reading of
omffiles in binary format (using Numpy'sfromfile) - Minimal and super fast tool to convert
omffiles to VTK format - Plot functions
- Early support for Paraview plugin: read
omffiles directly!
Install
The easiest is to use pip or poetry to install the package from
PyPI
pip install oommfpy
The Github address can also be directly used to install the package via pip
pip install git+https://github.com/davidcortesortuno/oommfpy
Alternatively, a setup.py file is provided to install this library
git clone https://github.com/davidcortesortuno/oommfpy
cd oommfpy
pip install ./
If successful, the plot_omf and omf2vtk tools are installed in the
corresponding bin directory and can be called from the command line.
A C library is built with the installation process, thus the setup file tries to install Cython if is not present in the system.
Paraview plugin
A first version of a reader for Paraview is added in this last version. For now the installation is a bit of a hack:
-
After installing the
oommfpylibrary, locate theoommfpyfolder from thesite-packagesdirectory -
Download the latest version of Paraview with Python > 3.8 support
-
Copy the
oommfpydirectory into the Paraview Pythonsite-packagesfolder. For example, for Paraview 5.9.0 installed in thehomefolder:cp -r oommfpy $HOME/ParaView-5.9.0-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages/ -
Open Paraview and go to
Tools -> Manage Plugins -> Load Newand select the Python file in thetools/folder ofoommfpy(you can clone the repository) -
Now you can open any
omffile without converting to VTK!
Documentation
For now check the doc/ipynb folder which contains a tutorial with basic
functionality. To load a file with a magnetisation field, which is found more
commonly in simulations, use the MagnetisationData class. To load any field,
such as the dipolar field, use the FieldData class.
Scripts to convert omf to VTK can be called directly as, for example,
omf2vtk -i omfs/my_oommf_output.omf -o test.vtk
The input path can also be a directory or a path with a wildcard, e.g.
omfs/*.omf. This method assumes the files in the path come from the same
simulation as the tool loads the mesh from the first file in the path and then
only updates the magnetisation fields.
Similar options are provided for the plot_omf function. Use the --help for
details.
TODO
- More tests
- Add pyproject.toml file to avoid manual installation of Cython in setup.py
- More options to plotting library
- Print
zcoordinate when computing sk number - Allow Periodic boundaries for the skyrmion number calculation
- Add typing check
- Support for multiple OS
Citation
If you find this library useful, please cite this repository as:
@Misc{Cortes2019,
author = {David Cort{\'e}s-Ortu{\~n}o},
title = {OOMMFPy},
howpublished = {Zenodo doi:10.5281/zenodo.2611194. Github: https://github.com/davidcortesortuno/oommfpy},
year = {2019},
doi = {10.5281/zenodo.2611194},
url = {https://doi.org/10.5281/zenodo.2611194},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oommfpy-1.4-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: oommfpy-1.4-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 238.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e41ebcf1477b959386d0baad67cfdf2bd19942b06b90fccfb4f738f40e9e57cd
|
|
| MD5 |
9709b7a044d58c066a822a226fa2df62
|
|
| BLAKE2b-256 |
df59da4a17d8697f8a61aea8d1abbef2b879bd4d7f0e23a511d5b61161466d56
|
File details
Details for the file oommfpy-1.4-cp312-cp312-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: oommfpy-1.4-cp312-cp312-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 642.6 kB
- Tags: CPython 3.12, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cac62089525505c94d9932674e7c7da486925c12027c90ddbc9542c88491539c
|
|
| MD5 |
b82a405c7712efdc835d77f2d47cbc68
|
|
| BLAKE2b-256 |
239ac750abbe5ce4aa624985adc6114d29f1686a837250bb1d7e2efa2358b178
|
File details
Details for the file oommfpy-1.4-cp312-cp312-macosx_14_0_arm64.whl.
File metadata
- Download URL: oommfpy-1.4-cp312-cp312-macosx_14_0_arm64.whl
- Upload date:
- Size: 319.7 kB
- Tags: CPython 3.12, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc786febcc25298ea8c5d6f57a163ba6fc3d8a7c2489c43f6263c4c2e911b2c6
|
|
| MD5 |
66844935f2a75448675dd6605256359c
|
|
| BLAKE2b-256 |
21deb6955d2f577b185c0b611d952f113ab4668a314b149ccb3cad3390159dd3
|
File details
Details for the file oommfpy-1.4-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: oommfpy-1.4-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 237.3 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd6885f8192a86977746699d2297d4fb680bd6d23cab4b7f73f0e3ce54b7699
|
|
| MD5 |
659052664b0abef0d9217509183d6fbb
|
|
| BLAKE2b-256 |
9c431d3c26be4453d263b7def10048e809006534b53ad72c94b7313a802b4c20
|
File details
Details for the file oommfpy-1.4-cp311-cp311-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: oommfpy-1.4-cp311-cp311-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 654.0 kB
- Tags: CPython 3.11, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29064d3d6f2feb6b3b78b271af547a145c17bad0b3a305366647b588b1901d79
|
|
| MD5 |
dd9657b5a198af3d7569cd3c3067b4bc
|
|
| BLAKE2b-256 |
96970d35d6682c9569f48bfcc3f54409ec1202899db825e9436325421d41fd8a
|
File details
Details for the file oommfpy-1.4-cp311-cp311-macosx_14_0_arm64.whl.
File metadata
- Download URL: oommfpy-1.4-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 316.5 kB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5aa67f624f119e11cf552710905c90e74fc7ddb1f93f91de7c3956efa9ce476
|
|
| MD5 |
4ad287506ab58a272ee99b728d95e2bd
|
|
| BLAKE2b-256 |
dcbdac49d69f4eb50ab1190d9d302580334a88eb57ebf7a0e59a8edc599cf254
|
File details
Details for the file oommfpy-1.4-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: oommfpy-1.4-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 237.2 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44a34b31d8b521a9068ae278dc90a949c80894e2ffb039578cfd8d3833c893b8
|
|
| MD5 |
8ae98e8fe6e329596202763efa354141
|
|
| BLAKE2b-256 |
7ccf7bdea7dd5464980705969c698c8891352f12e942efaedcc170c5343aaec3
|
File details
Details for the file oommfpy-1.4-cp310-cp310-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: oommfpy-1.4-cp310-cp310-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 619.6 kB
- Tags: CPython 3.10, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c5849953f2c1e5b79db865b2a8d9edfa8899b1d11ef64850a900e1c1cf0719b
|
|
| MD5 |
d71b72f44d31f4735ca1bd12af7af595
|
|
| BLAKE2b-256 |
fca89c591b6fb0a96b0e51819f78bea4fbd842d6f31d8d48e510a01333693994
|
File details
Details for the file oommfpy-1.4-cp310-cp310-macosx_14_0_arm64.whl.
File metadata
- Download URL: oommfpy-1.4-cp310-cp310-macosx_14_0_arm64.whl
- Upload date:
- Size: 316.6 kB
- Tags: CPython 3.10, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
739ca097a0481c3f3e89b953182b20f3afeb2efbe08c580c8a2dc23451943152
|
|
| MD5 |
1c5ebca7f9ba41c8f342601366f5b742
|
|
| BLAKE2b-256 |
46dd20d63205c83dddb68a147cd1190204c40b41d7d3113e26d79db663b4059f
|