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.5.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.5-cp313-cp313-win_amd64.whl (312.1 kB view details)

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.2.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (590.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.2.5-cp313-cp313-macosx_10_13_x86_64.whl (460.7 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.2.5-cp312-cp312-win_amd64.whl (312.5 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (589.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.2.5-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.5-cp311-cp311-win_amd64.whl (312.2 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (592.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.5-cp311-cp311-macosx_11_0_arm64.whl (412.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.2.5-cp311-cp311-macosx_10_9_x86_64.whl (448.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.2.5-cp310-cp310-win_amd64.whl (312.3 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (592.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.5-cp310-cp310-macosx_11_0_arm64.whl (412.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.2.5-cp310-cp310-macosx_10_9_x86_64.whl (447.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: sdf_xarray-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 d4a8b837a07f09a2484ced5af3aca4c8356016576a013417c405306ba179719a
MD5 319f37284edfec9c1cf4c6ba52070557
BLAKE2b-256 4c32a1e1ef392f6929d80b9e3104fb1c75bd81c108055f9134b646e649a31284

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 312.1 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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 61f0fae26ec162d953f013ddf2b271d623ab1f0934bb2961af8a7dee7295f644
MD5 7986c0719a038a1da76d867fa6c8b62b
BLAKE2b-256 032136567555473dc8afb6688ffb1987771e6a10dd2d1644bcf27b3798d400ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5e86bee2fd85ec07e65b564bcf5a6b325c9ef0533fff9c88755523d44244d0f
MD5 bac0b429ee3c57cc9df6ae6f37e63670
BLAKE2b-256 02e2a7c2580bae56fb2fd8cfdc10dbf24c2356aeffcf090140c859546f87b559

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf78a1d61b6b02a47ed1c8067ef4792ccc9dc2680d06fecb3bcda380e7256d19
MD5 a84164ee474cbde5564a3ce5be904360
BLAKE2b-256 4e98184d33ee87352e88dea0c6551beb2b1a09f74ad509446af973f412a34678

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 20d62dee216c28533fd0f728c3777282d49c445c991bd877d62c31ac9950c82b
MD5 27eb3b52f6a98c629f5b739a9241e0aa
BLAKE2b-256 ecfafe5d0c3c3d69d8786f90233bee6a2ef8d28f1b981c27f5340e533b4f5c3c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 312.5 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d06d2e47662d47e3f3cee9f3a4c21227dbac351b1740430b1274da1f86490229
MD5 5184a0b08ad95bce998dc755b7b596c9
BLAKE2b-256 9dd0ed3d665254412ee67bc1e4ab5041868d94f9cc88ee3cfe9e40278fde7c8a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 91ec1479d25e73931b0ca3ed7c26118c6516a3b1a05eb24d35b76ff254c3ff28
MD5 1b7b055884cf655771a3d272bc6bf987
BLAKE2b-256 ed77825b5f229c2f5e445e7a86055fa11e436be62e47f23af6b580a41fb4d096

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06f4009445cc5e05a891c6fd0382127ad1257c874b5b1bc985279f7a4f24bc64
MD5 10d8d7571f7b8de15be378f8c9c60e41
BLAKE2b-256 9f9fb133539bebf68237c8d17de44a3afd51f06f839586002d251e232179f03c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 59871e7ab5cae93068ab2e082c802ea9197086a1b4e5134cd8285b36f27de7b6
MD5 c9dfc623490ba041ecd42b0b0c83f438
BLAKE2b-256 3cf21c4dda6976857d1273d8957be346aff337d3488393427757d7d54870cdc9

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 312.2 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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 747c36ef407db9e84e0962e3dcf18a5fb4e6aca233d08edc58bf62ad1a2100d7
MD5 43c02d6148f890e258d6026feac62fbd
BLAKE2b-256 9beb62d81267b73e79c07cb539a96e53d544a589d6b1cdeeafa1298fa4cacc7b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cecd8b1a32fa5127c1970612e2db44f6586ddca86c5c9d301245365503a81b92
MD5 69984fdd7e7d48b5262473b38659a59a
BLAKE2b-256 d607ec50827c40402a961deafa70b3183578239860991732beef3b864949a3a2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1fd4dcfd358657e4dda73a1465d4617dbb5881e936233740322e0bb51cf8915
MD5 1f66438857824e8327e59ea116f694e9
BLAKE2b-256 a717a188496904145d41eb3e3bd0cc7bea82314d3e2cc3a394179f2b7d63d40d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 80cbfd5e8dcf0ea903d5a28a187312dfa09f044e44cf595395f9d74763251de3
MD5 921c1206ef655ae3007dc3aef2c36c7a
BLAKE2b-256 44c4ac48b6251f749586cded43f08269233ba2eb7bfd778e08c43cd0365fb38d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 312.3 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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e1c9adad960d1df2f523178a7bc286a01c01c245a20dda650e25c24f287010e6
MD5 17c64319dc7b712fb3308d65f5efc571
BLAKE2b-256 a67f5ebd61531d1130f188d45aa78444e51248631b65fde7fae3f82b8f2da503

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2e2c0977f8cd74ef19fa4828c378918f9d14b5e2c8e7e4765ace78338768ca23
MD5 938baed47230ea9c0c11da0f196d8e02
BLAKE2b-256 fe368d259d9e5b9826ff4660c4a8208d4c8e5f1b95cd5d1d7c50c27b6ceae2b4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8715ea876fb969df808ffa3deb8432f1587dde3ba09679d36bdfa9956c3b1567
MD5 3717ee02ae9a622bdb3a0d6ea0672380
BLAKE2b-256 bd1466d58e43c81151b56aaf6be40c80e8073b191f7dfe9ef42f38f42c979129

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ce480b5bc94661af6c125e8c6a3c402a4a01a9c1c01c51c2161308c7e72afc2a
MD5 aac10fea15e0912c45f9dcf6f22e0a66
BLAKE2b-256 b7925d3d05ac2e1c37079249cee06a6e30cece1c1d2fda6fc1bb59a2af0e153c

See more details on using hashes here.

Provenance

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