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 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.3.tar.gz (11.2 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.3-cp313-cp313-win_amd64.whl (319.1 kB view details)

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (595.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.3-cp313-cp313-macosx_11_0_arm64.whl (418.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.2.3-cp313-cp313-macosx_10_13_x86_64.whl (469.6 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.2.3-cp312-cp312-win_amd64.whl (319.7 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (594.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.3-cp312-cp312-macosx_11_0_arm64.whl (420.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.2.3-cp312-cp312-macosx_10_13_x86_64.whl (471.1 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

sdf_xarray-0.2.3-cp311-cp311-win_amd64.whl (319.6 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (596.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.3-cp311-cp311-macosx_11_0_arm64.whl (420.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.2.3-cp311-cp311-macosx_10_9_x86_64.whl (455.6 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.2.3-cp310-cp310-win_amd64.whl (319.4 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (597.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.3-cp310-cp310-macosx_11_0_arm64.whl (420.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.2.3-cp310-cp310-macosx_10_9_x86_64.whl (455.4 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: sdf_xarray-0.2.3.tar.gz
  • Upload date:
  • Size: 11.2 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.3.tar.gz
Algorithm Hash digest
SHA256 ea20ca87e2f988e9f5ed1fd0fce9ec4b2a4057ac719080f68f407b68b86d9cd5
MD5 e71713785b8cb50ead886d9fb6c1d89d
BLAKE2b-256 154db125ef9dd68570037c3694b3ce9484c63b3aaca04859d2a113ca218eb187

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 319.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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7a1b052a82c77611c79a937dc0bff958d4e498aef3ca2fdadfbb26981cb8fb5d
MD5 27b5a2b349951e110c36d3ef5081b5ef
BLAKE2b-256 69fed0389a13b7c7b4f5a62cbbad081afa8c4eac094652761eff65cbfb709d0a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 699f2d8b80047baa072ab47b3a6f075986af07752d941c8a39f3ac69ff4e2d91
MD5 2981920bfa4e08f7d71d48af717a30d5
BLAKE2b-256 ca1e7aa6ebf863454f0f47f2fb298e1ca3c5526f60cec1adbdc2fd8ba791c25f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00356148a87f96ab8d02eef7f6f44b49363877fc98841452da23b45cd6c177f4
MD5 8887a74b84fac99f339e1e8f957170c7
BLAKE2b-256 f469631d2fcc792fe1044cf1d741ed5ebb27fb7ff0ba03a462b7cdd3d4fb1e2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 61e03db199d3505dcd20100aa9ebe6c8f6f5f10a32aa081952d3a23d830c8fe9
MD5 0a7fb19bd6fd729d32806a9486379079
BLAKE2b-256 e0175edf3f3a3908a3e1f97e6e57a7c1b7ec868a0febbdd91a4f6f2f9145f59c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 319.7 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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d08b031d1b74da641b147e488f6f3f7e46a5756ce8af1171f38b4dcff4c549d2
MD5 eb409b02093af4edfe29880a348a615c
BLAKE2b-256 ac4b194951ed02d3393420ed935178a9e4397ebe182489abe65ae7f3b3a16d83

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6fbe218c9964f5c5df352dd3b686333ed60550db62cf567f398e108c2c4b4be3
MD5 0d580292c505240c1035baec687ab4f1
BLAKE2b-256 4f37649764c232f22046430ffe0a9b9addce48e35fd48f6bd5f76348cdf8b96b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12bb9a4d1b9c1f3f0e58f350e1ce7553bf5ed62c7a1d6ff7019adb8208d750bc
MD5 ca6676a6b0e1f6e248d7b53e9632026c
BLAKE2b-256 c75d379bde6bee211df1ca9928b9432217997e2b1b5c3097705b89b4b4955597

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 60f251c2f2f6f66169d993c7e61a47ea66cbbf2941d5e6157781f30a1a87e730
MD5 7918a48351578942866faecacc527aa6
BLAKE2b-256 f5ef1f371ed0e19f3004c6d97b81aa0ed7f5ade6be7e1c6a189017f8415500ee

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 319.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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 57678bd317239384fb2e5e27cf629756649670189b625dfb464740d2060eb330
MD5 88b2454b337725fa072bc2b5d2177bdf
BLAKE2b-256 5fb51f4ee1767c3aa73535282c853402ad4d93a287f6b10e82c40c05bbade07b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be29a8aafcadb0c229e7d187e96acedd69fed432aa565b9f1632c063394a5045
MD5 ed169d8bd44d1d31d0185b168f7e3d6e
BLAKE2b-256 627e1412ccbc54177fd77dcd5eb9b1f17a99fbfb0c4c6f73217232150ebe52b5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c659c5d928eab211786f121e21b97e14b0a13665b07e175db6270a5cfc06ec14
MD5 76e6544ae2db3ed966298043e07d8800
BLAKE2b-256 1689bbfd79947c8a431270428329f76d639beca6551f0f628bbe06babec1db77

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4c2b9d820801400da3d3ec7b3c7f33e2b63e62f8ccd046a639d34893cb5092c0
MD5 91715d6fc8846ee4d8df83c2524a069e
BLAKE2b-256 eba8d548761f37dbf06ce4b5f17729cb58c6d011246d87ce467531c363aa8ad1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 319.4 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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 46f8d8a47bc0f0cf4cd327ce78a4911db01e0447540a84021ff087658e88254a
MD5 442061963aac9e8cc2bd0de7fcc9f851
BLAKE2b-256 803116d56d8a8374a99c0da3a8d19c8d6a52859e20a142dc9aa4c779307c76f1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de029e9de8470582a1703df7795475e1e454362b8500176b21b80e3eb3d05b94
MD5 2e1471e56a3314b6dbd4646ded1815d0
BLAKE2b-256 2b72476f6d8c094512096dbc23c256cff939931b1a5193d12c7c6dd7fd07c52e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f3f9c0188cc3b051f48d281ec738e52aa4ed7aec4e1551010a9247d47041b31
MD5 bcc87fa31199903da8add5519b4154cd
BLAKE2b-256 259a2ce06ec1aca45ff0bf106fbd4bd9747153f9b70f9ee85baf2f60e87f06d4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1086c01a2f46149cad0d57164d5c223c8b648862867c0713fbf39f1465c09d45
MD5 efe7b8df3d3d267e58d5a45c4458b44e
BLAKE2b-256 b5b87e360fb2aab9935d23236a617d632422b24b17dfef7534478bfd9e1d1418

See more details on using hashes here.

Provenance

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