Skip to main content

A Python package to easily read input + output data from dHybridR.

Project description

dhybridrpy

PyPI version

dhybridrpy allows you to easily load and plot data from dHybridR simulations. It provides programmatic access to simulation input and output data and the ability to quickly visualize that data.

Features

  • Efficiently access simulation input data and output data like timesteps, fields (e.g. magnetic field), and phases (e.g. distribution functions).
  • Quickly plot 1D, 2D, and 3D output data.
  • Lazily load large datasets using dask.

Installation

The latest package version can be installed via pip:

pip install dhybridrpy

Usage

Basic usage of the package:

from dhybridrpy import DHybridrpy

# Enter your input file and output folder paths here
input_file = "examples/data/inputs/input"
output_folder = "examples/data/Output"

dpy = DHybridrpy(input_file=input_file, output_folder=output_folder)

# Print simulation timesteps
print(dpy.timesteps())

# Access an input variable
print(f"Timestep = {dpy.inputs['time']['dt']}")

# Access data at a specific timestep
ts = 1
Bx = dpy.timestep(ts).fields.Bx()
print(Bx.data)

# Plot data
import matplotlib.pyplot as plt
Bx.plot()
plt.show()

Further examples can be found in the examples folder.

License

Project licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.

Authors

  • Bricker Ostler
  • Miha Cernetic

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

dhybridrpy-1.3.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dhybridrpy-1.3-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file dhybridrpy-1.3.tar.gz.

File metadata

  • Download URL: dhybridrpy-1.3.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dhybridrpy-1.3.tar.gz
Algorithm Hash digest
SHA256 0d3c0694c44412cf6eb6b0c57d02a6b539ea8313486070264836e7ebfe7e4861
MD5 e3ff99e491b7ef75909c569100e44b33
BLAKE2b-256 c3194c588ff2bd3ea9f9bf504bacde5c864b9a3d98318e9256933877a9c7ca85

See more details on using hashes here.

File details

Details for the file dhybridrpy-1.3-py3-none-any.whl.

File metadata

  • Download URL: dhybridrpy-1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dhybridrpy-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 74a3ba6498e42f946add28d27bc08d7ca8403bf9faa30a4471bb28ba90ab0eae
MD5 8610faf79cb52b04f06723a341a5a6ef
BLAKE2b-256 9dd3020b286bd1e7bb5ee95a80268ed5eba5ba0a86aff69ee05414b78ccad02e

See more details on using hashes here.

Supported by

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