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

Uploaded CPython 3.13Windows x86-64

sdf_xarray-0.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (594.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.2-cp313-cp313-macosx_11_0_arm64.whl (418.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sdf_xarray-0.2.2-cp313-cp313-macosx_10_13_x86_64.whl (469.3 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

sdf_xarray-0.2.2-cp312-cp312-win_amd64.whl (319.4 kB view details)

Uploaded CPython 3.12Windows x86-64

sdf_xarray-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (593.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.2-cp312-cp312-macosx_11_0_arm64.whl (419.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sdf_xarray-0.2.2-cp312-cp312-macosx_10_13_x86_64.whl (470.8 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

sdf_xarray-0.2.2-cp311-cp311-win_amd64.whl (319.3 kB view details)

Uploaded CPython 3.11Windows x86-64

sdf_xarray-0.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (595.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.2-cp311-cp311-macosx_11_0_arm64.whl (419.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sdf_xarray-0.2.2-cp311-cp311-macosx_10_9_x86_64.whl (455.3 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

sdf_xarray-0.2.2-cp310-cp310-win_amd64.whl (319.1 kB view details)

Uploaded CPython 3.10Windows x86-64

sdf_xarray-0.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (597.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sdf_xarray-0.2.2-cp310-cp310-macosx_11_0_arm64.whl (419.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sdf_xarray-0.2.2-cp310-cp310-macosx_10_9_x86_64.whl (455.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: sdf_xarray-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6b7c42ba5db58dbb9f5c7a4400529808b2c7f5bc4cb105575eeb6632462044f9
MD5 6b6c9c250da8065bf10cd55a85e03381
BLAKE2b-256 dd41a909f3f2dce0b395fba18b35835431550b61cfa86703805391e40c8587ad

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 318.8 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fa608019c4e53188e19d0181b0f81177fd3572383dec03e6acc495354af6f168
MD5 1dce04b4e8a7fe020d0a1feaeed04dd1
BLAKE2b-256 45545cfc101eb8151c971ed07816213b6679c70d485f62e6427dba26e7438096

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4265f8c4167b19a1718e0dfeac6338c0da3726c57d62094a1d43bc718deaf247
MD5 2d948f1efc0f2decc5bb0d789856d67b
BLAKE2b-256 cf9718dd5efdf68f957a7592771a7c33cfb04931f8566a464543c7763e0ac0fe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb87e8971e497d18e95236decdbe9e4a8075431cd8e7713386b576d293802e46
MD5 0ef5c591db0771614662061303910772
BLAKE2b-256 34b6b3b6c04d9b479932e311799c13fc96eaca73b2bb4d0b4996f0f9b1fce120

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7c4a9070fa9d439c93486577c31de13c2cf83d36c69c46a994709502291474ca
MD5 b4bef8ee394ed962d49f9a1db79c7aea
BLAKE2b-256 10f3e537ec6530b5d43f298d2f7a33566f93857d8ca9f3513e7ab3bde51b7e7d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 319.4 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 24feaa90b749a2ae554d5b26e6fe040467f0ab53d8fca285889f9bca7574dea6
MD5 f6f74b145d7ffc35cb16a93872eee6d1
BLAKE2b-256 86621485a14405d41b59b9063f6e5a8aa754b0f9539755b48e89ce0fcc771c3e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54d8dcd4b05612b84b2a1b68dfecaef85b48c8973755e510c6172bdf9462625e
MD5 0a5ec44883a86618c71d03e42dd4d945
BLAKE2b-256 ea02ed5916432c132272a34df804a2060d26b1aa1f101fa9b16b67a7791cfb36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d89e6f87ac6c4e686f6a55fe649ee346524746d4b7b419be78c755595a219c17
MD5 2a8c5d81d2751026fbd1a637df2df4a9
BLAKE2b-256 53384990a9c7bf9dcbb363aa110f09a562dac2a47047ab061ffa383598b31969

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 4879f2e67ee53d2508d03a5574ff8d2070a39c14bda89634c5aa6057ff95d4d6
MD5 010ca4b668151ad843b4aa769bfacaf7
BLAKE2b-256 81e48dfe988b7754f993002c4be870ff8ffae79b0c68d9a01423e6e534a13479

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 319.3 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 95f32aee767c63a6d9489e64fb6c8147973d1c18776851df9dd30dc0be9fd795
MD5 62f7c8d768af8878ac7ed7a352a39db8
BLAKE2b-256 d899d29fe59f0d8bddc2171105a0c0ceb760f71cae6b84c97c7e361ff739dc4c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f93180e3de3f5fb8a8acd8ee3c0df8b7669370358b0b584c6dea75e63c12179a
MD5 1089d182c1a7e3697720ab4c05480ce9
BLAKE2b-256 4c2985373d74cd16bf62e09ba6a03f66fdaa9fd1a31a5240288d531c4171522f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03ddc87aca69b765e96dd5c96c6f15def509ac82345366db8706db8d0f4d8a83
MD5 0f8ee417f7e56f42b36658257923a4bd
BLAKE2b-256 f59ab2b9b4532aec9bc8b55863559a14900cbc561fdea422881541722c265a78

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 183cbbf8b954785ff972b60844a0a18464cd07b08d86dc5f0be9a29371a6e3b7
MD5 a5f62b351f112a523a8c6686db8d20af
BLAKE2b-256 94e607100fa8a9cd1b322e73a776e19896cdfb6ae67263008a46ae71c7f1d0ed

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sdf_xarray-0.2.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 319.1 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4f5d7c45229e90130f892d9bbf27f1a5679b2ca14cd2d1dc4cb2569787cfe006
MD5 62c52278a2cd39e7828ac9abdbc3d607
BLAKE2b-256 11b36f96ac7ed75dd1b35c572d084eb659a29973f3ada169208d252e4044d86b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ad7f18f7ed0d948d32db7311ed48f8add25b5d22008e8e0d9a383d8b3e7e18d
MD5 3a7cf0aea2f387384980a337c5bae6c1
BLAKE2b-256 5c9d980441cee27f7edc90eca4b31f146dba367963ed0132d5e01cc5052faf1e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30f520eebff7ff9cc0b1a659f22e158e00b4db08fa2e82102a0fa602b00c08b0
MD5 3884a8b69a7a4cd061f25c1a00155b35
BLAKE2b-256 32bf03e42e6ac7ef830efd364737144c379a78cc4b7b19e1886d4986a5ba85c6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sdf_xarray-0.2.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 378f04a800a7e86be8c6d3b6e858f47181735b035e7cdaf9233ec005615b82b8
MD5 04326a2c38a9828834d7eabb1ceb8e07
BLAKE2b-256 120b967cbfca5187d5a0f4277274761fa43db0f7ff3046dc266ef5988b19efc8

See more details on using hashes here.

Provenance

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