Skip to main content

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

Project description

dhybridrpy

PyPI version Documentation Status

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), phases (e.g., distribution functions), and particle tracks.
  • Quickly plot 1D, 2D, and 3D output data.
  • Compute FFT power spectra and 1D spatial averages.
  • Follow individual particle trajectories across a simulation.
  • Lazily load large datasets using dask.
  • Perform arithmetic operations on data objects directly.

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 and in the online documentation.

Documentation

Full documentation is available at dhybridrpy.readthedocs.io.

License

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

Authors

  • Bricker Ostler
  • Miha Cernetic

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.8.tar.gz (29.6 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.8-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dhybridrpy-1.8.tar.gz
Algorithm Hash digest
SHA256 89fe4b143d190331f193085a58d0a118a0ef49f173d5c2da21901ff14db5842c
MD5 9bd6c69ef925f0246acbda5407fe1b1a
BLAKE2b-256 563e69638384d394ffcf058366fc38602457f9c93577e82ea67fbf86a0575201

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dhybridrpy-1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2e779a6ad9b5e3e9eb64bc116498335d8d7ea2bcd14330e5e0bff3c265294561
MD5 72c041f27d50a50df74c658c11a907c2
BLAKE2b-256 4550adc4dd47668e840215accc48b7d2f72381e86bfbee002cf3bb74bb14bfef

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