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

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.3.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (617.6 kB view details)

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

sdf_xarray-0.3.2-cp313-cp313-macosx_11_0_arm64.whl (429.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.3.2-cp313-cp313-macosx_10_13_x86_64.whl (470.8 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.3.2-cp312-cp312-win_amd64.whl (318.3 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.3.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (615.8 kB view details)

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

sdf_xarray-0.3.2-cp312-cp312-macosx_11_0_arm64.whl (430.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.3.2-cp312-cp312-macosx_10_13_x86_64.whl (472.2 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

sdf_xarray-0.3.2-cp311-cp311-win_amd64.whl (319.0 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.3.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (617.8 kB view details)

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

sdf_xarray-0.3.2-cp311-cp311-macosx_11_0_arm64.whl (431.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl (451.3 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.3.2-cp310-cp310-win_amd64.whl (319.2 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.3.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (616.4 kB view details)

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

sdf_xarray-0.3.2-cp310-cp310-macosx_11_0_arm64.whl (430.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl (449.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: sdf_xarray-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 0f508bc80018743cd994985b576de0487b0c84ba54e7342a949aa53ad0d58725
MD5 dcf50ae537433dada7145881e0a27d10
BLAKE2b-256 880cdedc02885a7793687a5aa7b3a86e8275464b93626ae858846746e19cd08f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 317.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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ddc87cae578da208cc6319c72f5a2168dd556f3ba36ef4a05bb8e574ff25f42c
MD5 141b584d9c568d8506c498c400ef94f0
BLAKE2b-256 258be989f2f7a7c8c99bf4fb47845a8045ccaf87782afca81220bed9a2332480

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.2-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.2-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.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 60a4fabf4de5ddae4adfecdf09bf3f8e53b6cd9dd208a2f40eaa57daac186486
MD5 20db1831cde6ad0485c026c29ddf9616
BLAKE2b-256 e7d314485fe6cf47b1a01b7b3ed31ba75ba143f8176ed52c53bb820a090a3e6b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3bf047f418428f7d25cb9e040c59b38405ad5904b6698e6474498280445fb51a
MD5 c0400d3f9b2391ec7499d7ed79b072e4
BLAKE2b-256 02b4fcd14c43d8cb7e1e1944bef9910119fbf6f32d54e83521432abf24c2652c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a623341e07c64dc3bf9d1b387a388cd0a30322b1a257918abacd607eefae1ccf
MD5 513164a0834ad2bc3d1e36218d041667
BLAKE2b-256 599dad33d4966dd8d8bff402e6cdebfae89186f40dc76a209f485177c17c91f6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 318.3 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9957acf6c4173d8e5a5d6e177a7828c2b852fc8816fb4002def15c64144d2b35
MD5 98564fa85d247536deceba976bae5747
BLAKE2b-256 df057994a18fa9a96ce3db344b6afd250e4d25c63dbf56ba66ce649c5a269688

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.2-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.2-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.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e324aade75e54576b8a2d0b5a4c1f4242e7b61802c665260110d4ea1af5b3df
MD5 672598159db9fa764521322da7db8491
BLAKE2b-256 7516448bd079e0f84e826eddfb244b68139875730005ba15412a07cf627ea3c7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 810010de0d47090b541a1fba4b351622b16af5dbc66964cf8a7c1203bb2e14f0
MD5 40adb2f7cec8e0a0695df0ea20c311fc
BLAKE2b-256 f43f8f7a52f12bfd1941c713747bc1beeca555769846bcab2e144af95e9c12d4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c0073383424442ba06790790506ee6f524933a7bf5af3882a6b16dc1f207e217
MD5 4f0cc3b96db07f731206bc54de9022b6
BLAKE2b-256 fa2511cb742924eaa7ed1b5f1fb7330f53fc618f53e74059c75a2ce9af120afe

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 319.0 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bcac51a18e0f0cc000a32b31ee836a5eabdd731cfb44b5530c7d7c7ab3d21c6c
MD5 b19bc10a567d784c5f563ee9624e2d25
BLAKE2b-256 c055aaf28feb25e77f5fe4b369418d1c253c5fab6c4fecff9c108bc929e58e0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.2-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.2-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.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e91d410296661f94005d15b888d76844b0b5c2f8a1dbfb61fd9c7e19ddc67b80
MD5 1b241377e2d0bffde2e24fe9e41b573d
BLAKE2b-256 b122eec5c685fb5c84ed4c727243eda1466a6fa3e776eede37a458616a23398c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 837fcbdab68052322233290fb81e0cddd4e8e5a70e888e31606f3557ee137ff0
MD5 fee51a7f5f9487a885a3a99d6d5fdfce
BLAKE2b-256 60c2c65cbf7190775bed9d4edbb2584d47b39ebbdcb450495974c4fad4c70c7a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e5025b8e21ff255705d8d6873327068878929f1e057e94bd4c62235aee2d029f
MD5 97eb5f5d9f815ce94851e8c356054c59
BLAKE2b-256 bdce691169f4869ef0af1104bbf5dbd06be8998d668760f7461761a190cc3cc6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 319.2 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3f65f5fe5aa7c536a872234c84236dc3a905d4980acc354f3956a9bcaeccb1cb
MD5 6128ed512c574c3c10a37a0a16b59b4f
BLAKE2b-256 73eb02287887f1c7c16fcbfd24faf427b64ada50b79ec7054890c87990af9184

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.2-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.2-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.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3da57935edd02aa0e4a27e4596ff2031a56663327b4cab8299cfeb97631b0774
MD5 86be8c6d33decd7c376ca561b6b8cdc7
BLAKE2b-256 ab4f6c571a556cb8cdafa726cb6595da3c7d6ee3b52d1d81b9675759046d834b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4f270c03afcf758f5b3d9c003e3069b31ba7d569f588030529d624b9c49532ec
MD5 869e270ef3cb8f142caa456ba7f7e688
BLAKE2b-256 c477a981284c6ed1a1511b9e14d4bd2df49595e75fcfa4c614a87fa6f084a687

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8308793cc9023dac8fc6100d57e0a26e9f39df5d6731fb0380ce946b3f2884d2
MD5 7181ff7341c8bf2a1e70c9beffdb8a1d
BLAKE2b-256 78bbc45d1fbf2e949afee50f78df02fba257f7550d7d8518b52ae89ac1e98793

See more details on using hashes here.

Provenance

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