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.4.tar.gz (11.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.4-cp313-cp313-win_amd64.whl (312.0 kB view details)

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (590.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.4-cp313-cp313-macosx_11_0_arm64.whl (409.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.2.4-cp313-cp313-macosx_10_13_x86_64.whl (460.6 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.2.4-cp312-cp312-win_amd64.whl (312.3 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (589.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.4-cp312-cp312-macosx_11_0_arm64.whl (411.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.2.4-cp312-cp312-macosx_10_13_x86_64.whl (461.9 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

sdf_xarray-0.2.4-cp311-cp311-win_amd64.whl (312.1 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (592.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.4-cp311-cp311-macosx_11_0_arm64.whl (412.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.2.4-cp311-cp311-macosx_10_9_x86_64.whl (447.9 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.2.4-cp310-cp310-win_amd64.whl (312.1 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (592.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.4-cp310-cp310-macosx_11_0_arm64.whl (412.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.2.4-cp310-cp310-macosx_10_9_x86_64.whl (446.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: sdf_xarray-0.2.4.tar.gz
  • Upload date:
  • Size: 11.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.4.tar.gz
Algorithm Hash digest
SHA256 34eb922e03eeacb20289cf3acceda9304c4f3974cc5476e352f9d60c5b8975b4
MD5 5a1659190f9745e7f9afa0dfcd2e38d3
BLAKE2b-256 5f5dd815ef1b55217e0ea15af3a8cbf76bcfb09adaa00e1f81894fbbd6e91389

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 312.0 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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5e5feed595ec1c99749e2ce2ade896e3a088ac94b3245c37f1c4aedda1efe47f
MD5 488014882236ee1d23e00e398de5ff05
BLAKE2b-256 00315e40e3910177f782f100dba615a1cf0267a2fc315a7f727b34e38b589151

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-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.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c25f89fcbaf762535a0a64f1101cba28fa12474186bd4c064bda071ecde3f336
MD5 75567d71c1192fbcbc0f1a70cc5e7bf1
BLAKE2b-256 b103f82b0dbf84c56464ba16c8dc54841341e401044f5a3946e69fcb3336c46b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_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.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1ee91269a391275d5896cd6a9c3e2bf4f9bb3644b3c22e342bdb4efc45dbd47c
MD5 703e40d51d736869b0ad03c9212788c4
BLAKE2b-256 ce1ef64cd2141f823939d53dcdf59c0253ce2666cbe41685e5b7fe7025351f22

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 34218c965548284293670dcd41b09a495c058c7e1785fa7033fb61494c1ed31e
MD5 65d97871f06445ebfad099cc6855a8fe
BLAKE2b-256 b07cb8f02381d4af1dea83f1588880a409829bfef08ef9201f200fde0e6f3be7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 312.3 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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e0062bd4023cb61c8ec0cdfeb69477c17c7f29f0e97286b3ee9d55a3cf8e272b
MD5 0a6e5f1b347e65e85a342e7a905ba88a
BLAKE2b-256 d63b773091f158a601a8395b63353f40f11f73657e833485f5e9ea29f35846ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-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.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa6cae2fd3a858d30babee85ae8059f33b7bf23c4604ba6a8738724148bcdcc1
MD5 827bd8bafd8fe2335d66ed95ebd24bd3
BLAKE2b-256 7fdc2ff2073851c64d33bb65047c49b9d4f33103bdab7212d90409dbad3f2f85

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_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.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00f8e968d01fa1cd198c2c9158aadc3963c8b27dd4ad80192f5bdd4601b41f00
MD5 73d112a84961d0691c926c72ca90942a
BLAKE2b-256 ad4e19a144bf1bd075d183aca0daf9ab9f3e3b8da044c829afc81e5f892be606

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 00b173ae5599b70e14083a558de5a085323fdbb7e564ddd41adc1a44653dfa9c
MD5 529b0587202c9d78364008f5f3bf3cfb
BLAKE2b-256 fe761d0bf373af8c75aedf7acbc20390ee8df50886b22fa9f51bfba023fe816b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 312.1 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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 119481b83f882c7a3bfe00f73883ff4d4b16d4b8b6101398a99d5c4727de15f4
MD5 9fa302db39b686f6bb818e86e89eae75
BLAKE2b-256 491e48574b3d406069a2d2a86ccaec3bef517d25dbffe72441c9d45a022149f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-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.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4f36e6798e609231d428cb061baf32ca0683ae39343a33baa0c318dec7433d74
MD5 950bc5bffb355e59afa9db66feed6b64
BLAKE2b-256 8019f939c27b29e5cd66303b625c7cf64538b684c735ce74c3b7a110836890c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_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.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc3aa99a414204eb79a2010ae4f56c4f3660111367fe2914dc13f4514190e26b
MD5 be4719d95a3317169b327ffc6febb6f0
BLAKE2b-256 b4a267eaa720e1a82aa8d55fde33cc5906bc6e454251c3552f64a02e949cc6ce

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4f932f3be1cf38f1e981c99cd565b052a99e04d1bf7a92fc608c16e39b24c442
MD5 c1f2859cb971d16aad566d741ac7cd22
BLAKE2b-256 e43fdabeeed55a6861dec7a30956fa242a385fc14993a8d71e35e179aff4994a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 312.1 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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1d2f40bd1d76d25f71e9ff573eb001081162b56ea5b142449a0616eff2c410d1
MD5 f96d15c07fe38d1eeb81730076f57bb6
BLAKE2b-256 fcada686a5da7fdf396e6c22282b383192ee31261f9d20a795568221ccece5a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-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.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 60302dfd6417054636eed1ed744fc8f560668911bdd2733287709da93fc345a0
MD5 c62edb8c4f32bd636e951682b1ad56f1
BLAKE2b-256 b3db4adcf447158016518156668752b2c47e680389220a96e9f6e4f36dd26377

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_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.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e49f23668ec5c74d2f4008f2762f0eb77aac91560176ffd5f1b541c14f3c8b2
MD5 f851edc6319d5efb0d2efb2beedaa7b8
BLAKE2b-256 dc66f8cd77c3b4302cb1891b7fda9aebf3df5b379be401d7f46f917bb10be882

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e5fb0a3d7ee841022257864e031c77071ab1d2e17d09ea48a6b30b7dc6cc068f
MD5 31cd44b70d1028723e9c9b187f35c653
BLAKE2b-256 be2d15f38b00719e9775696ccfc97853ee660b82af3c5d40cae5a9b616025e59

See more details on using hashes here.

Provenance

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