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:
dt = job.attrs["dt"]
# or as a class attribute (given that you have no dataset named similarly):
dt = job.dt
# 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.9.tar.gz
(26.2 kB
view details)
Built Distribution
pyzfn-0.1.9-py3-none-any.whl
(24.6 kB
view details)
File details
Details for the file pyzfn-0.1.9.tar.gz
.
File metadata
- Download URL: pyzfn-0.1.9.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75811a9fbd212e5e87504168c0383121b70961c51c14fc55d93c6a783eff933f |
|
MD5 | 8c14887306f74e229ceb7b12db9d7630 |
|
BLAKE2b-256 | c1feb8397f70abf50f53004e3f6e3d4468b5babe7c47f8609c89aace07730228 |
File details
Details for the file pyzfn-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: pyzfn-0.1.9-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a689f29b52970ad296424a7206af31f07fab001cbffbb790b9f6f3971707c723 |
|
MD5 | 037e16f464c28b68c0e6b0bbecc1358b |
|
BLAKE2b-256 | 2dc0099f903b46289ba5551928748792b932efa346f1b22781ba5599a23eb830 |