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).

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.2.6.tar.gz (26.6 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.2.6-cp313-cp313-win_amd64.whl (315.5 kB view details)

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.2.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (615.3 kB view details)

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

sdf_xarray-0.2.6-cp313-cp313-macosx_11_0_arm64.whl (409.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.2.6-cp313-cp313-macosx_10_13_x86_64.whl (460.8 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.2.6-cp312-cp312-win_amd64.whl (315.9 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (613.4 kB view details)

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

sdf_xarray-0.2.6-cp312-cp312-macosx_11_0_arm64.whl (411.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.2.6-cp312-cp312-macosx_10_13_x86_64.whl (462.0 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

sdf_xarray-0.2.6-cp311-cp311-win_amd64.whl (316.6 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (615.5 kB view details)

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

sdf_xarray-0.2.6-cp311-cp311-macosx_11_0_arm64.whl (412.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.2.6-cp311-cp311-macosx_10_9_x86_64.whl (447.5 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.2.6-cp310-cp310-win_amd64.whl (316.8 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (614.2 kB view details)

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

sdf_xarray-0.2.6-cp310-cp310-macosx_11_0_arm64.whl (411.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.2.6-cp310-cp310-macosx_10_9_x86_64.whl (446.5 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for sdf_xarray-0.2.6.tar.gz
Algorithm Hash digest
SHA256 6e007a2e64def148aef77d69cd1d428be5293de841928f1a533e7f12ac3dbadb
MD5 9ffca19921b5d462257de57769868d97
BLAKE2b-256 12071fbdb27e5e17d5c22e2fa09cf424c851206ba4a370dad7601e7f2db5a3d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6.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.2.6-cp313-cp313-win_amd64.whl.

File metadata

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

File hashes

Hashes for sdf_xarray-0.2.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f312f5f86528156b43cf4e97b4622251cf3e6090cbb4243c967281d61d4b93be
MD5 550ebc5cffdff3a7e5a844766219479b
BLAKE2b-256 d86f25fc8635c0c3a095377decd9dda0d7d3e29edfeed4b3cf4dbdf6bbb31be8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-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.2.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2b0b391c7e19d04e5fe3c755c8390d702c996e0d57030a0f15f92b02ff4ec4c2
MD5 00a4b8231da57785659962420af4fe87
BLAKE2b-256 6f0e5fb2568966e87722fc30f2d4e436c70da81e6e90f87b21b047ad89241ca5

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9e56ff8c56c93a20eecd6f98f9d65e08fe9009e8b43904c7da7148cd7b6c441
MD5 8872272fa82e9423d1d9cd785dccb6a8
BLAKE2b-256 24bf65b4e9d0115f004e9e4f14dbc181b67a0c52913d6dde480b90bf4d80768a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6350ef6270a6f31a73c067073c84179214d4f8c6b39593104124aafa1d25324f
MD5 d07f925104b2f021d0a74609e96c0909
BLAKE2b-256 5c00850211ecc93e586d251d0c0a257d591a0b34c5d77412bf9ccb121e0d0e02

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp312-cp312-win_amd64.whl.

File metadata

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

File hashes

Hashes for sdf_xarray-0.2.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 487b0cb2f1409051638c7eb1657df46db2607beeb45641582357bbc317928196
MD5 21e976383f16f3b97c129378dc0e9e28
BLAKE2b-256 fa514589b88c9801927a3509e2b9aa31cfbddecb940ef3477792a46cd1934ca5

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-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.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e8811b9aed0b4a54980f7a5e5fee9b143d7f4e2ba4befe1a3a4f60f9b10ba766
MD5 6d766048ffd3814c4cc798ef8d595738
BLAKE2b-256 e893d19875e36cc787cab4519ce45c13211c1de18eb0a6abb1186a4b5413bbad

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 59d65cbf52d4c2910b48efe517f0ccb1439c64c9fe1e81d35f3aaf2557c74570
MD5 037ccb9fea1be0592a8cb64b8bf31367
BLAKE2b-256 6b2a07cf55f115aacdd89e78fe972c00cf39c5ad95d400ab047daa43678042ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 aa921c4e5e7e7f60e3496fc952653a3db0ec8a56440373752419400201220736
MD5 bc66d6f1023f759a48c8589be473e4bb
BLAKE2b-256 9ff6dacf316987a7b6d97aaf8d80c887b974936f6da5947d348da96930372f26

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp311-cp311-win_amd64.whl.

File metadata

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

File hashes

Hashes for sdf_xarray-0.2.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2b22aec634cde31c5ca0149ad954f1b73b367373c24428079933797495fcd181
MD5 590452af8bc16f4fb7574ff8512e0f91
BLAKE2b-256 63aca5c46c9eb52560259aaf3a0927a3c8da2fb1dfec16a0ac1628eb9caa9136

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-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.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b6aea7760ced58f88445df73e2e1f7d4d4c3a1604d4e6d451d02b20108ba16f
MD5 62a6194a7e28d63cad775e4d0e092db0
BLAKE2b-256 52e4ffe1cf4f4c63dcfb71a179edc08585338f3b68a12dcf078ec7110586e6bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85ed9535494161fb666cc501d409a665c50bd991dbc8e55705f463a061b4fee2
MD5 d7a8b20c3f6b6b266073296440a08db3
BLAKE2b-256 91a410267a7ac91b07d3072101d6658bd3a45d40ec6b2a5b70fecfafc2b1f1da

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ae0ed36b645d6a77a281ab421b6404d3f33171011b8bfe66996eb23f57871c96
MD5 7a528558112d747b4696f1fbd4cac17e
BLAKE2b-256 cf188420a71ddf3fa1f463b860fd17f1c4a59e08191e2896445351ae22cfbdb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp310-cp310-win_amd64.whl.

File metadata

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

File hashes

Hashes for sdf_xarray-0.2.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 152eafa680393fb1e134bc19071bbf2582d61df99df06573be399814b9d15521
MD5 c26e51c3d02f3186ece094dae265391b
BLAKE2b-256 25ba094f1c44e4ed703e8b9df93d86600a82895af474808d89e2f33acebf1532

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-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.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a4091cb3ceddea54e08990680a5f837e37173d812dda6b39ce34a0c4986c6bb4
MD5 90d3ebcab9c77d8adbee6f744dab8466
BLAKE2b-256 82e39cd2a341244829916d07cfe089ff0aa10d22e9a725dd8257d7709fb793c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 003f0fe25f9fb50480f91c54ff5513d80b36dfe125a930d744aa984722e870f8
MD5 ed20500333c3b190473c42c17b200104
BLAKE2b-256 77b53a7c872d18961421e886cbfda3d2dc890f0859c81d7f7a60cbc2402f811e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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.2.6-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 77aa775b56660d55de1a87321cb34c93bee1e9770802ef0d407a4610a6b575ad
MD5 6b6e0c33583f691dde1852831206163d
BLAKE2b-256 db0d13e1c1655b070825bb55429a80f68cbfbab281e40571f76ed6037421e7b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.6-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