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.2.tar.gz (21.3 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.2-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dhybridrpy-1.2.tar.gz
Algorithm Hash digest
SHA256 9585d480b2e2e72b886f3a7655cf703a0f0ec1e13b5853b3297f4a2e9b5bffdc
MD5 4cdfb48f865d373f022bdce936d9db5d
BLAKE2b-256 6d7d1aa8d5941b92ef11ce56b546f72ac41b9b0a6525d048e06d57a56d3d3ba4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dhybridrpy-1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1a838fe81b62364f0a5a03b50e79e1971e03219988f1a825e1d1e78b5eadc4a4
MD5 e16045d659b583b7e7a2a4afba093c26
BLAKE2b-256 4b13731d2c116f250f6d3bf272f6daf25e2c72245e2833c4f2c5edb5f32aabcf

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