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

PyPI Build/Publish Tests

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

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (594.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.2.1-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.1-cp312-cp312-win_amd64.whl (319.5 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (593.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.2.1-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.1-cp311-cp311-win_amd64.whl (319.4 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (595.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.1-cp311-cp311-macosx_11_0_arm64.whl (420.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.2.1-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.1-cp310-cp310-win_amd64.whl (319.2 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (597.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.1-cp310-cp310-macosx_11_0_arm64.whl (420.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.2.1-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.1.tar.gz.

File metadata

  • Download URL: sdf_xarray-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e49a41d4db778b732cd2592115ba5044dd788be210eb97467733675b03129eb0
MD5 6f968bcd74ede024ab978d2d3c16fd6d
BLAKE2b-256 1ff1c7874af23771111e62b659603c8a325b1ae3c273b8d03d6c7f26a7de719a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 318.9 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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 df3fa29b7eb52586319b5a8e60f94e4baea1870200665f1cbb7a5431f8a780e5
MD5 f174cc62b3e684e79a9fd9421425c75b
BLAKE2b-256 3ccfcd54f79073cf64b95448e12091f946796b168fcc6e4a3855fdce0ff6677a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 55f8efd7354bdf8a823abf63d6be1776026e0293ab594199db64879c29cc76ac
MD5 411b7b4437bd3accb80b4293b0446161
BLAKE2b-256 e344b0fbbc5f189998bf8ef8a621c644ff97037fb747d12fc5f5a5e731efcd02

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0ab106a2fb41ed91b71e0933111d1f1b33d6e1b6c44ee6e0615de1565dfd72d
MD5 c36191d1a41335eb399d83e1561ee3b2
BLAKE2b-256 22091f05c0cf27121fc39f9243a566738686e6bce55f7a10977dd2d9a9491056

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 4172cf8338d242b4c4b76741737ef02e872202de2b85c1e59e4444cbb26a5b43
MD5 32f9b62efdd7ab3e1a41d4d9573d4b0c
BLAKE2b-256 559f68de9c963f2bdd1a7bc2a6b133272d205089e8bc600d5fd9d2fcd882141c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 319.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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d34f8a17fc0d533c5789afe33edd1a74aa4daf8dbde72d47614b6012d1076a3a
MD5 c80e019ce0f9faf99f95dcb3b0eed369
BLAKE2b-256 973f5e8c300b2d619bb451fdcfd34c841faa85677ecf1ba4864ae470e5aafc60

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 163face26c9d0631eed8db1fa407a9f7c0acda4d464f38b3ae75d9d8a52f152c
MD5 53904b008976b9265f71ee00cdac7c8a
BLAKE2b-256 05694c0c9c3cd1b92cc4cfd978c54379a38744d6af828ffcb25556b386efffff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4bc2b14767fce7ee223f92da6a4f3dae1b494ce189f169f164391d20d451f9b9
MD5 8e932235b30b86c5937af8cb22a8c7ce
BLAKE2b-256 f63e81cb90e09c830f9974f3f8b76e03a48e7098cb7a0c4542909a50701a0942

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 4e1b6e79eb1a78b3d4a5890b58aea04b860d9418e5aa9e7cb7ecf9bdfcbb2220
MD5 3cb5bf4aa6a19a4eebf8c423f7599f3f
BLAKE2b-256 5fdf1460c37ddbf45b536a19c7366c1f21b2b1717246466ff13c285ddfd461d4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 319.4 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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9bd3f64e21392aecbde285e1d2a1da4c65cd2fb39afbf4c0218325482b80324a
MD5 948885ac954158c625104dd67ee629bd
BLAKE2b-256 a99746ec8fc2ea75f5ea74fc9481bd0f6231df41d40c3c2e6f0ec14f333d054b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9e5ce52d2970b1f8536a8e305de8cd393cbe115a0f8556392a07c09e6e657212
MD5 cd35a21b119c4b93311b5e105a0b4878
BLAKE2b-256 b9d0dad92606ae5b6e2b40e09e8bda2482738752faea0ab7a134483f2adbf09e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07de982f577f120b15d941d8d0493f98984b7cfaada90326a5d5f8c9112985d9
MD5 91d472f2d21b1e2ebf3aea23610977c8
BLAKE2b-256 5ac701ccf03b8e9c038c0b738d24f17ebc130b1dd5c3b29b8573ada14b08dd26

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 87a68158c233451534e8e1fc1e1eabcdc4ac00d33dc57ac1b59c6017fcb00cad
MD5 fa6273a59e15d15aa2c52b9ce33e2267
BLAKE2b-256 d780e9a1c0fe74a4f26fa4aa24f13a42cd43a02ac8cf3b0627eb57cd9da00629

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.1-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.12.9

File hashes

Hashes for sdf_xarray-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7f48f45628a194a3086e1993e4ff25f78cd690fce7851d16f2ee53198195b08e
MD5 734fcd0c96c470985c988aaac0ad0503
BLAKE2b-256 bc0bae0e0b89ad6312477b08c3fc5ccd65f1d34728d0f8a5b84e2fecda70362e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 92f5621c1d276bface1e14fc485fcdfafa71c2feb609b3eb55df094196e404b3
MD5 0979828f4c11a2626ca697e320407913
BLAKE2b-256 b67853d276a8e4a39919bb34b14bb6e4087ca8df89378433099cc2ce1e700ab2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b008703f5c31bd225738ce5c1901216711d74005ed35ecc2f42cfefb6e3782c
MD5 8dae8f59cad4573159173db4df5479e9
BLAKE2b-256 83eb997f584282c786f2e45d77835c55c2d61521c662b4b1ee6937f85f1fdb61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 99ccdcc900c13da1181f86a96f40eeed201c313e623eda217e76fefa4b2769a4
MD5 5b4f13cca850866ff84feafb4733ad25
BLAKE2b-256 ff95ea45546a6ea4c92af0f991591824456f47f61fe6af9d6d83700b067b34b4

See more details on using hashes here.

Provenance

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