Skip to main content

Provides a backend for xarray to read SDF files as created by the EPOCH plasma PIC code.

Project description

sdf-xarray

Dynamic TOML Badge Available on PyPI DOI Build/Publish Tests Read the Docs Formatted with black

sdf-xarray provides a backend for xarray to read SDF files as created by EPOCH using the SDF-C library. Part of BEAM (Broad EPOCH Analysis Modules).

[!IMPORTANT] To install this package make sure you are using one of the Python versions listed above.

Installation

Install from PyPI with:

pip install sdf-xarray

[!NOTE] For use within jupyter notebooks, run this additional command after installation:

pip install "sdf-xarray[jupyter]"

or from a local checkout:

git clone https://github.com/epochpic/sdf-xarray.git
cd sdf-xarray
pip install .

We recommend switching to uv to manage packages.

Usage

Single file loading

import xarray as xr

df = xr.open_dataset("0010.sdf")

print(df["Electric_Field_Ex"])

# <xarray.DataArray 'Electric_Field_Ex' (X_x_px_deltaf_electron_beam: 16)> Size: 128B
# [16 values with dtype=float64]
# Coordinates:
#   * X_x_px_deltaf_electron_beam  (X_x_px_deltaf_electron_beam) float64 128B 1...
# Attributes:
#     units:    V/m
#     full_name: "Electric Field/Ex"

Multi-file loading

To open a whole simulation at once, pass preprocess=sdf_xarray.SDFPreprocess() to xarray.open_mfdataset:

import xarray as xr
from sdf_xarray import SDFPreprocess

with xr.open_mfdataset("*.sdf", preprocess=SDFPreprocess()) as ds:
    print(ds)

# Dimensions:
# time: 301, X_Grid_mid: 128, ...
# Coordinates: (9) ...
# Data variables: (18) ...
# Indexes: (9) ...
# Attributes: (22) ...

SDFPreprocess checks that all the files are from the same simulation, as ensures there's a time dimension so the files are correctly concatenated.

If your simulation has multiple output blocks so that not all variables are output at every time step, then those variables will have NaN values at the corresponding time points.

For more in depth documentation please visit: https://sdf-xarray.readthedocs.io/

Citing

If sdf-xarray contributes to a project that leads to publication, please acknowledge this by citing sdf-xarray. This can be done by clicking the "cite this repository" button located near the top right of this page.

Contributing

We welcome contributions to the BEAM ecosystem! Whether it's reporting issues, suggesting features, or submitting pull requests, your input helps improve these tools for the community.

How to Contribute

There are many ways to get involved:

  • Report bugs: Found something not working as expected? Open an issue with as much detail as possible.
  • Request a feature: Got an idea for a new feature or enhancement? Open a feature request on GitHub Issues!
  • Improve the documentation: We aim to keep our docs clear and helpful—if something's missing or unclear, feel free to suggest edits.
  • Submit code changes: Bug fixes, refactoring, or new features are welcome.

All code is automatically linted, formatted, and tested via GitHub Actions.

To run checks locally before opening a pull request, see CONTRIBUTING.md or readthedocs documentation

Broad EPOCH Analysis Modules (BEAM)

BEAM logo

BEAM is a collection of independent yet complementary open-source tools for analysing EPOCH simulations, designed to be modular so researchers can adopt only the components they require without being constrained by a rigid framework. In line with the FAIR principles — Findable, Accessible, Interoperable, and Reusable — each package is openly published with clear documentation and versioning (Findable), distributed via public repositories (Accessible), designed to follow common standards for data structures and interfaces (Interoperable), and includes licensing and metadata to support long-term use and adaptation (Reusable). The packages are as follows:

  • sdf-xarray: Reading and processing SDF files and converting them to xarray.
  • epydeck: Input deck reader and writer.
  • epyscan: Create campaigns over a given parameter space using various sampling methods.

PlasmaFAIR

PlasmaFAIR logo

Originally developed by PlasmaFAIR, EPSRC Grant EP/V051822/1

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

sdf_xarray-0.3.1.tar.gz (26.8 MB view details)

Uploaded Source

Built Distributions

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

sdf_xarray-0.3.1-cp313-cp313-win_amd64.whl (316.9 kB view details)

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (616.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

sdf_xarray-0.3.1-cp313-cp313-macosx_11_0_arm64.whl (428.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.3.1-cp313-cp313-macosx_10_13_x86_64.whl (469.9 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.3.1-cp312-cp312-win_amd64.whl (317.4 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (614.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

sdf_xarray-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (429.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.3.1-cp312-cp312-macosx_10_13_x86_64.whl (471.3 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

sdf_xarray-0.3.1-cp311-cp311-win_amd64.whl (318.1 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (616.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

sdf_xarray-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (430.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.3.1-cp311-cp311-macosx_10_9_x86_64.whl (450.3 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.3.1-cp310-cp310-win_amd64.whl (318.3 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (615.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

sdf_xarray-0.3.1-cp310-cp310-macosx_11_0_arm64.whl (429.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl (449.0 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file sdf_xarray-0.3.1.tar.gz.

File metadata

  • Download URL: sdf_xarray-0.3.1.tar.gz
  • Upload date:
  • Size: 26.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sdf_xarray-0.3.1.tar.gz
Algorithm Hash digest
SHA256 67f25856185ebdef649bd1a45c849e75dd5aeb68741bd9b2b0b128d7a98cf390
MD5 d7b81cb12ef77201fccb72f47f5d038c
BLAKE2b-256 ca8a948a0dc9f600575df1f593bdbdae13be07019c154ffeb54276952576afc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1.tar.gz:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sdf_xarray-0.3.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 316.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sdf_xarray-0.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e585de7bf986d760fa270e4012fd2cfcf03a18596575c659f05eb7403cbb4a26
MD5 dfec0cb8886ad726e7ea9b2b50b73008
BLAKE2b-256 aa170d1002f2697395f18ec10b2a0b0914985e19d334f10290a575814b63c9ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp313-cp313-win_amd64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2673568e4e2efe4c5f6c558a3231d416b291675bce292ee901dc966f47a22bbc
MD5 3a4b81ad94f98b9ae0684130ee63539f
BLAKE2b-256 d7aa7dbb3669f371c7e0e82279940c49581fd8f02532be37f22162896118ce40

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f5168ce6d93acd667e2b01b492a819d5bd9db80e1b324c2124fde336ab98f22e
MD5 88586386046a1793c9a85027e64df9a4
BLAKE2b-256 6aacea9f5d4246e47df4efd7ebef2fe07b3290fbb2029c7555af80c5ca98526c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 67d97b671782682bc9cce9388d52323dbe2c839f732a6f737462b8a270a6e4c6
MD5 74920a98023543f518a3c5d32ef12afa
BLAKE2b-256 09b4d607a0f815452bb5e79b2660a7c88f6c31f08b868e76223d2ae5875bfa9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp313-cp313-macosx_10_13_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: sdf_xarray-0.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 317.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sdf_xarray-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f60b2ab1c2018e4b12e72016c5cd490085294da04ec886301be032b51eedb0bc
MD5 6a04c7c1f05729ac7c1bd22abe0310dc
BLAKE2b-256 73724f901a45a36c7af47062f62e3fa6db47202cfcaee6a5638b13b07e86567e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp312-cp312-win_amd64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 960f12f83476e78c37344649164f1f1447aa7a93630e2f9e26b94eebc164c3e5
MD5 816ab411eaad0985c0d4eb88e24f9a29
BLAKE2b-256 5fb1cdd793a67d9aaf053059cd0826f9236f80c262cb82999bd1f2991ce6f069

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad419ae51da56482279de8c82c296480a7c22091f419701c6dc73c3736ffd678
MD5 e154dca6c8ef626bfdfec37da31af524
BLAKE2b-256 af04849d1c146b5c1261436464d7bf39655c4f379c97ef82284587fc3d9a1db2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ef7db68e6e64b2400eca40384f03250db01fcf468a8d19e4d0c2b4ab56323f3e
MD5 988e2f8f492b956e21f58ded7d166f37
BLAKE2b-256 8bca3d6dd66854df071d43782c777207d045f1b1c1a1199d957dcaa7e203e6d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp312-cp312-macosx_10_13_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: sdf_xarray-0.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 318.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sdf_xarray-0.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 15faaf19e13a9f2d0d1b22c8c7420040bb2a6f76855ebdd87976a36806815ac5
MD5 11cc1bb780416c2f2658afe2c9e3d91f
BLAKE2b-256 b19ba70486e374e25cf300c50e01bb5a090dddbfaeef771662fc6fa04814fae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp311-cp311-win_amd64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9ec8624d14acb11b11a4fe251b407b7bfd37851c9696520bc058b197e48df5ef
MD5 0e06dc58e8a3557abd2636dc9f7dd7a9
BLAKE2b-256 2d6fdfbaf3f76a4c03015f7a5f092fae4d9656376822e920bb38ff31ca3a6c4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e118c38f73da3ea046bf0ec802daac22c5b66041f032b41b3bb5b885b4c31284
MD5 40866030ed4c2fb054bc59c83d07b55c
BLAKE2b-256 f7c791a1721609de4d2ca3e1f65c9503ccbadc9438bc05b8d3d99218e0873025

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 35ea7b2e0e8f22d6c312b84da0e4ec9a867f1176074f4069010735f54468e899
MD5 540b37331d06852974190089a0a063bd
BLAKE2b-256 255405e32e87aac4e4aef4b6281e1bff89049326e992275d8a40bc8da8e58d0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp311-cp311-macosx_10_9_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: sdf_xarray-0.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 318.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sdf_xarray-0.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 77ec1d0db7d8c8f14a565a6875cf572cdc9a88b25f730d9b55bdc751db3235c2
MD5 175d80b9ec3ac1f4931575c6047e4f4d
BLAKE2b-256 38433d815524bd3b4f8306f8df13a81452dc9ef0a34a8604a3d38d8cf0d68c34

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp310-cp310-win_amd64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e66ce92cf77263b9c8c6e34a2597e6939fb298104e2dfac87b4601821d79e9a
MD5 77a2b59bec5cefdd6acfcd9e9d02cf2b
BLAKE2b-256 ce39a8481cf908198a0b3244339b7fa0a41db797e565d11ccc0e3053c663103a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c1b4d14d3b8438c26532ff74854c19910a538e8055ecf225a12347e99b44fae
MD5 45deeb59a7ea4b4398d49cd7892e9767
BLAKE2b-256 a22e85f91ca3da2c7ac96005e77309712d6fe419facd69263f8a546fded0ece1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdf_xarray-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9e479f1be829760fc932ea5dae32d9b2eda6c7a84df0b0e69fa7e58eaf0651f5
MD5 ad708c0b0c5c7b2503d4e97c96fd40dc
BLAKE2b-256 43a5ad4e24238b304919a1afd5b0f45aac63bc23c3dac7970f0b6b3d2a94ba89

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl:

Publisher: build_publish.yml on epochpic/sdf-xarray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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