Skip to main content

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


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.8.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

pyzfn-0.1.8-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file pyzfn-0.1.8.tar.gz.

File metadata

  • Download URL: pyzfn-0.1.8.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyzfn-0.1.8.tar.gz
Algorithm Hash digest
SHA256 c5cab3243d3be574ad0c584018637cb4df01f674166e2f96682dc9006ac022c9
MD5 7513669f8a3d0d2bf86fb83d2aab7aa6
BLAKE2b-256 1be4ea29d5643e15cbceede523af806720fb3b19a2832f8b7f9d7539d8817652

See more details on using hashes here.

File details

Details for the file pyzfn-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: pyzfn-0.1.8-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.5

File hashes

Hashes for pyzfn-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4c55baf2d3f215dc48c2988c98696d390b514f615d78530a65c4ab9a39b8fad8
MD5 c692c9a4c3f3c28c8f8feebb28e9d8ce
BLAKE2b-256 161b0f5ec2180c15c6fca4bb5a6ba488ee971fd527edf065041cac54203d73ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page