micromagnetic post processing library
Project description
Pyzfn
A micromagnetic post processing library for the data generated by amumax, a fork of mumax3.
Wrapper around zarr.hierarchy.Group
from zarr to implement convenience functions that work with the ouput of a modified mumax3.
Installation
pip install pyzfn
Usage
90 % of the functionnalities are provided by zarr, please refer to that documentation extensively.
from pyzfn import Pyzfn
job = Pyzfn("path/to/job.zarr")
# Use this extensively
job.pp # pretty print the data tree with a widget
job.p # not pretty print, but does not need a widget
# Getting simulation metadata:
# json file located at path/to/job.zarr/.attrs
# You can acces it like a python dict:
dx = job.attrs["dx"]
# or as a class attribute (given that you have no dataset named similarly):
dx = job.dx
# Get data you saved in amumax:
# Ex: the x component of the magnetization for all cells for 10 <= t < 20
# t ,z,y,x,c
mag = job.m[10:20,:,:,:,0] # mag is a number array
# This will not load the data
mag_dst = job.m
# You need to slice it to obtain the numpy array
arr = mag_dst[:]
# Some very useful info
mag_dst.info
# Reminder that the `help` and `dir` functions in python exist:
help(mag_dst)
# The following is not from zarr, they are convenient (somewhat optimized) post processing functions
job.calc_disp()
job.calc_modes()
# Data visualization:
job.snapshot() # visualize data for a specific t
job.ispec() # interactive fft spectra
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 Distribution
pyzfn-0.1.11.tar.gz
(51.9 kB
view details)
Built Distribution
pyzfn-0.1.11-py3-none-any.whl
(39.9 kB
view details)
File details
Details for the file pyzfn-0.1.11.tar.gz
.
File metadata
- Download URL: pyzfn-0.1.11.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5023a4b7bf8651abd3820be618fec338c9e783d9a164ed1ba3dfc48452f087bd |
|
MD5 | 4e8c0def57fb30cee5afcfefd42a06c6 |
|
BLAKE2b-256 | 25442a493f9a7864e3bfa539807a5de429de38980c1b67ce0aabb695e46b5979 |
File details
Details for the file pyzfn-0.1.11-py3-none-any.whl
.
File metadata
- Download URL: pyzfn-0.1.11-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 941185dc049b4874a4fa1b4937b2da51123a0810dadf3a6742af37a52ace590a |
|
MD5 | c47b2f1caaa089019e6806098058b4b5 |
|
BLAKE2b-256 | fe38ec5278bfbb5cd681525dba5432f0c83340b59166a069bf7aa481bb9d7ceb |