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.0.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.3.0-cp313-cp313-win_amd64.whl (315.8 kB view details)

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (615.6 kB view details)

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

sdf_xarray-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (426.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.3.0-cp313-cp313-macosx_10_13_x86_64.whl (468.7 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.3.0-cp312-cp312-win_amd64.whl (316.2 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (613.7 kB view details)

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

sdf_xarray-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (428.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.3.0-cp312-cp312-macosx_10_13_x86_64.whl (470.1 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

sdf_xarray-0.3.0-cp311-cp311-win_amd64.whl (316.9 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (615.7 kB view details)

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

sdf_xarray-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (429.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl (449.2 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.3.0-cp310-cp310-win_amd64.whl (317.1 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (614.4 kB view details)

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

sdf_xarray-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (428.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl (447.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: sdf_xarray-0.3.0.tar.gz
  • Upload date:
  • Size: 26.6 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.0.tar.gz
Algorithm Hash digest
SHA256 f1c01226febf4970ccd09af3bf4b44dd0db41e78335c5d48390149ed451ca63d
MD5 b0da3019e4e59e04d884a24d8c4dd0e9
BLAKE2b-256 3d85743d875a0bdb970f8672ea14772fd3abdc9a76da4b2725493908dd7172ba

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 315.8 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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 81650ed2acd924cb9d317b2c184850a9a23c3a037ed0ec6892ae14486335987e
MD5 357579976f8a67179c767aab8aa01484
BLAKE2b-256 22dade4f2991731040a01268d91ef2c73557254fe72ba2f645cf8e19050fa60f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.0-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.0-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.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a7a2e05704f5bbf03e47ee130cebc0da877a6840440a7e3f1b121e7d7d32663f
MD5 98da81226d79e58680b0bf189764178b
BLAKE2b-256 b0dd1a63de83ede495364e4654a851d0969ecb6c8dd5a2bcb3ab67c5baa72eb4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 59beb4642e25c29d4da7879fba0baa4b894573381aee0bc172883c4c8f37e39f
MD5 859ce833a7ebc42b3716e07145da12de
BLAKE2b-256 4627c94f518c19703df20517bb83d4f82f6f6f13315741b40f30abd028ce691b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3f3172a8fb5717fe96f004aabc43a38d402a264c669c8c25fffcfbe0c96b45e3
MD5 f22992a7e5bf776bc9a180bc2b032247
BLAKE2b-256 de39bf98600abae4a6a4697e1b126dda44d7a262043a7bed9cf6e8dc2ee8003b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 316.2 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 457be449b06414765160c94a75d1c057be635c4117e93dc568a1ab00b111e0b8
MD5 c38855268c7bc38f039a1bf61d9cd051
BLAKE2b-256 5f6273238f67aac24b59d2c9ec19abfd3190d0661dbd9c7414cf7137dfbaf996

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.0-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.0-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.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2aa19fbc2a2899fccecb14063aa23386b048af9a8bc46412cdef5c1d6c6eb85
MD5 abbc7ec3bf5324d309f5647d90ac15fa
BLAKE2b-256 4e67046fb121a74629f68455ded742089c124b62da001ca125c0d646158d82a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b09c73f509f13ed7d69f9a950359d8b8176954bd51dfa71af0bc43b848724a05
MD5 690746f7631972fb3d58eca57ef0b68d
BLAKE2b-256 74a9efbec079912b35e6ee27217a07b1714398651955e1e3e59e7c3ce75c05ea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7e385f3e432bde6bdf21f721739792ed09f575b3daf1d5435d045624c45b7c11
MD5 3a66fcd6c53ece4e59aac8137d8f7b23
BLAKE2b-256 ea6ca2151023732ff4c918aac45ce9f18da766230e8aad82b3f197780ebf8f60

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 316.9 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ccd54275102e76a989e4e71ce8ae2a77043cf5f3bd68599efc91ecf34c48d1bc
MD5 71ddbb370e4841dfac2f54d212dc2cca
BLAKE2b-256 b89affd73d609ad5810a4e90abeee6f5b57cf1d66dcdf86c3831cb1431ea3990

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.0-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.0-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.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5243c4e1aa46042ba0107fbfe9776c160e1e5b7a1835efcb14043f911c3b46e7
MD5 2878e39cc37732eebf5009aa9ea516e8
BLAKE2b-256 13138c51a1d9f5edc21f31cdfa429b33b99148d66227dab537d94bf668ac3d2e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46d5a4684e8e55137e07b7779c2e5af744ff0095ad1cba12b72dd2e2fe4a6d3f
MD5 5e1749acc563f637b8e833a656b2f1bf
BLAKE2b-256 0e2bc310a14bd9f9c166352c40b0bca0954b94b4b9a6d4e2824281b5640ddac4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b354d14d5c06e6e5578b836dcb896c0bff46f251f0083bd0d9ce9ba8252a1644
MD5 5af3b23a52a1344f3309079a65b98d4d
BLAKE2b-256 ae91883ed211aae071c1049d131f292b62ffb688804b11a4bc32ebc5107b7391

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 317.1 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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 08cb614a3b0f5b03d8177d96b45e38ceba3f43d9b6f4cfd4e616719490bd7ed0
MD5 d2812cbff3f06abb77defdd0e6749ee0
BLAKE2b-256 45650796d4170c0a6d7a8050b7af033fc695abfeeeb3f8cd576a3de6b61f3f21

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdf_xarray-0.3.0-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.0-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.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8e155a956b401d5eeb282edfcf6dfff24c2d7e9ed61e0ea78260d8b1875a0853
MD5 cbf5886bcdef3633778d665ef81d2dc8
BLAKE2b-256 cc54c567293db642aa67c359a11e45270c15b662c79f7e472098f645faef0a98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 700932a0580f9fabf688cdb8bfc2797e3b3266d375fe4c1c0acf4c52a036afea
MD5 e8d74775aa57111861c840a4e9aa1cf1
BLAKE2b-256 976d3a786f69a45cf168d59f3b0d639882b2cf62f250a300fbbacbfba56ec242

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2208c22f5c7326ea403eab37cfd0d50c6ecaa43c27fd985e017d8035463e2bf5
MD5 28ba1a8d98caee076f582b0607e0c2ca
BLAKE2b-256 365350049299004c4ec4fa6213a467bef6ef70962f47324460d6ed8bb72b2334

See more details on using hashes here.

Provenance

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