sdf-xarray 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/.github/workflows/build_publish.yml +2 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/.gitmodules +1 -1
- sdf_xarray-0.2.2/BEAM.png +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/CITATION.cff +2 -3
- sdf_xarray-0.2.2/CONTRIBUTING.md +102 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/LICENCE +1 -1
- sdf_xarray-0.2.2/PKG-INFO +187 -0
- sdf_xarray-0.2.2/PlasmaFAIR.svg +192 -0
- sdf_xarray-0.2.2/README.md +120 -0
- sdf_xarray-0.2.2/docs/.gitignore +3 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/conf.py +5 -2
- sdf_xarray-0.2.2/docs/contributing.rst +4 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/getting_started.rst +13 -13
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/index.rst +4 -2
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/key_functionality.rst +5 -1
- sdf_xarray-0.2.2/docs/unit_conversion.rst +176 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/pyproject.toml +36 -1
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/src/sdf_xarray/__init__.py +23 -23
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/src/sdf_xarray/_version.py +9 -4
- sdf_xarray-0.2.2/tests/test_basic.py +180 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/test_cython.py +2 -1
- sdf_xarray-0.2.2/tests/test_epoch_accessor.py +39 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/uv.lock +764 -1
- sdf_xarray-0.2.0/PKG-INFO +0 -190
- sdf_xarray-0.2.0/README.md +0 -131
- sdf_xarray-0.2.0/docs/.gitignore +0 -2
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.SDFBackendArray.rst +0 -38
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.SDFDataStore.rst +0 -42
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.SDFEntrypoint.rst +0 -37
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.SDFPreprocess.rst +0 -25
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.combine_datasets.rst +0 -6
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.make_time_dims.rst +0 -6
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.open_mfdataset.rst +0 -6
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.rst +0 -52
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.sdf_interface.Block.rst +0 -35
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.sdf_interface.Constant.rst +0 -34
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.sdf_interface.Mesh.rst +0 -40
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.sdf_interface.SDFFile.rst +0 -37
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.sdf_interface.Variable.rst +0 -40
- sdf_xarray-0.2.0/docs/generated/sdf_xarray.sdf_interface.rst +0 -35
- sdf_xarray-0.2.0/tests/test_basic.py +0 -169
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/.github/workflows/black.yml +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/.github/workflows/lint.yml +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/.github/workflows/tests.yml +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/.gitignore +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/.readthedocs.yaml +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/CMakeLists.txt +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/_templates/custom-class-template.rst +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/_templates/custom-module-template.rst +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/api.rst +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/make.bat +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0000.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0001.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0002.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0003.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0004.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0005.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0006.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0007.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0008.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0009.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0010.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0011.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0012.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0013.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0014.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0015.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0016.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0017.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0018.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0019.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0020.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0021.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0022.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0023.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0024.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0025.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0026.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0027.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0028.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0029.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0030.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0031.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0032.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0033.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0034.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0035.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0036.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0037.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0038.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0039.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/0040.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/deck.status +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/epoch1d.dat +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/input.deck +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/normal.visit +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/docs/tutorial_dataset_1d/restart.visit +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/src/sdf_xarray/csdf.pxd +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/src/sdf_xarray/plotting.py +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/src/sdf_xarray/sdf_interface.pyx +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_array_no_grids/0000.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_array_no_grids/0001.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_array_no_grids/README.md +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_array_no_grids/input.deck +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0000.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0001.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0002.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0003.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0004.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0005.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0006.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0007.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0008.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0009.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/0010.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/README.md +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_files/input.deck +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_mismatched_files/0000.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_mismatched_files/0001.sdf +0 -0
- {sdf_xarray-0.2.0 → sdf_xarray-0.2.2}/tests/example_mismatched_files/0002.sdf +0 -0
|
Binary file
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
cff-version: 1.2.0
|
|
2
|
-
title:
|
|
3
|
-
sdf-xarray - Provides a backend for xarray to read SDF files as created by the EPOCH plasma PIC code.
|
|
2
|
+
title: 'sdf-xarray: Read EPOCH SDF files in xarray'
|
|
4
3
|
message: 'If you use this software, please cite it using the metadata from this file.'
|
|
5
4
|
type: software
|
|
5
|
+
repository-code: 'https://github.com/epochpic/sdf-xarray'
|
|
6
6
|
authors:
|
|
7
7
|
- family-names: Hill
|
|
8
8
|
given-names: Peter
|
|
@@ -16,5 +16,4 @@ authors:
|
|
|
16
16
|
given-names: Shaun
|
|
17
17
|
orcid: 'https://orcid.org/0009-0005-0693-030X'
|
|
18
18
|
affiliation: University of York
|
|
19
|
-
repository-code: 'https://github.com/PlasmaFAIR/sdf-xarray'
|
|
20
19
|
date-released: '2024-07-25'
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
We welcome contributions to the BEAM ecosystem! Whether it's reporting issues,
|
|
4
|
+
suggesting features, improving the documentation, or submitting pull requests,
|
|
5
|
+
your input helps improve these tools for the community.
|
|
6
|
+
|
|
7
|
+
## How to Contribute
|
|
8
|
+
|
|
9
|
+
There are many ways to get involved:
|
|
10
|
+
|
|
11
|
+
- **Report bugs** - Found something not working as expected? Open an issue
|
|
12
|
+
with as much detail as possible.
|
|
13
|
+
- **Request a feature** - Got an idea for a new feature or enhancement?
|
|
14
|
+
Open a feature request on
|
|
15
|
+
[GitHub Issues](https://github.com/epochpic/sdf-xarray/issues).
|
|
16
|
+
- **Improve the documentation** - If something is missing or unclear, feel free
|
|
17
|
+
to suggest edits or open a pull request.
|
|
18
|
+
- **Submit code changes** - Bug fixes, refactoring, and new features are
|
|
19
|
+
all welcome.
|
|
20
|
+
|
|
21
|
+
## Code
|
|
22
|
+
|
|
23
|
+
### Style
|
|
24
|
+
|
|
25
|
+
We follow [PEP 8](https://peps.python.org/pep-0008/) and use the
|
|
26
|
+
following tools:
|
|
27
|
+
|
|
28
|
+
- [ruff](https://github.com/astral-sh/ruff) for linting
|
|
29
|
+
- [black](https://black.readthedocs.io/en/stable/) for formatting
|
|
30
|
+
- [isort](https://pycqa.github.io/isort/) for sorting imports
|
|
31
|
+
|
|
32
|
+
To run these tools locally, install the optional dependencies and run:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install "sdf-xarray[lint]"
|
|
36
|
+
ruff check
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Running and Adding Tests
|
|
40
|
+
|
|
41
|
+
We use [pytest](https://docs.pytest.org/en/stable/) to run tests.
|
|
42
|
+
All new functionality should include relevant tests, placed in the `tests/`
|
|
43
|
+
directory and following the existing structure.
|
|
44
|
+
|
|
45
|
+
Before submitting code changes, ensure that all tests pass:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install "sdf-xarray[test]"
|
|
49
|
+
pytest
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Documentation
|
|
53
|
+
|
|
54
|
+
### Style
|
|
55
|
+
|
|
56
|
+
When contributing to the documentation:
|
|
57
|
+
|
|
58
|
+
- Wrap lines at 80 characters.
|
|
59
|
+
- Follow the format of existing `.rst` files.
|
|
60
|
+
- Link to external functions or tools when possible.
|
|
61
|
+
|
|
62
|
+
### Compiling and Adding Documentation
|
|
63
|
+
|
|
64
|
+
To build the documentation locally, first install the required packages:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install "sdf-xarray[docs]"
|
|
68
|
+
cd docs
|
|
69
|
+
make html
|
|
70
|
+
```
|
|
71
|
+
Every time you make changes to the documentation or add a new page, you must
|
|
72
|
+
re-run the `make html` command to regenerate the HTML files.
|
|
73
|
+
|
|
74
|
+
### Previewing Documentation
|
|
75
|
+
|
|
76
|
+
#### Using VS Code Extensions
|
|
77
|
+
|
|
78
|
+
Once the html web pages have been made you can review them installing the
|
|
79
|
+
[Live Server](https://marketplace.visualstudio.com/items/?itemName=ritwickdey.LiveServer)
|
|
80
|
+
VS Code extension. Navigate to the `_build/html` folder, right-click the
|
|
81
|
+
`index.html`, and select **"Open with Live Server"**. This
|
|
82
|
+
will open a live preview of the documentation in your web browser.
|
|
83
|
+
|
|
84
|
+
#### Using a Simple Python Server
|
|
85
|
+
|
|
86
|
+
Alternatively, if you're not using VS Code, you can start a simple local server with Python:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
python -m http.server -d _build/htm
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then open http://localhost:8000 in your browser to view the documentation.
|
|
93
|
+
|
|
94
|
+
## Continuous Integration
|
|
95
|
+
|
|
96
|
+
All pull requests are automatically checked using GitHub Actions for:
|
|
97
|
+
|
|
98
|
+
- Linting (`ruff`)
|
|
99
|
+
- Formatting (`black` and `isort`)
|
|
100
|
+
- Testing (`pytest`)
|
|
101
|
+
|
|
102
|
+
These checks must pass before a pull request can be merged.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: sdf-xarray
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Provides a backend for xarray to read SDF files as created by the EPOCH plasma PIC code.
|
|
5
|
+
Author-Email: Peter Hill <peter.hill@york.ac.uk>, Joel Adams <joel.adams@york.ac.uk>, Shaun Doherty <shaun.doherty@york.ac.uk>
|
|
6
|
+
License: Copyright 2024, Peter Hill, Joel Adams, epochpic team
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without
|
|
9
|
+
modification, are permitted provided that the following conditions are
|
|
10
|
+
met:
|
|
11
|
+
|
|
12
|
+
1. Redistributions of source code must retain the above copyright
|
|
13
|
+
notice, this list of conditions and the following disclaimer.
|
|
14
|
+
|
|
15
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
16
|
+
notice, this list of conditions and the following disclaimer in the
|
|
17
|
+
documentation and/or other materials provided with the distribution.
|
|
18
|
+
|
|
19
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
20
|
+
contributors may be used to endorse or promote products derived from
|
|
21
|
+
this software without specific prior written permission.
|
|
22
|
+
|
|
23
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
+
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
+
|
|
35
|
+
Requires-Python: >=3.10
|
|
36
|
+
Requires-Dist: numpy>=2.0.0
|
|
37
|
+
Requires-Dist: xarray>=2024.1.0
|
|
38
|
+
Requires-Dist: dask>=2024.7.1
|
|
39
|
+
Requires-Dist: cython>=3.0
|
|
40
|
+
Provides-Extra: docs
|
|
41
|
+
Requires-Dist: sphinx>=5.3; extra == "docs"
|
|
42
|
+
Requires-Dist: sphinx_autodoc_typehints>=1.19; extra == "docs"
|
|
43
|
+
Requires-Dist: sphinx-book-theme>=0.4.0rc1; extra == "docs"
|
|
44
|
+
Requires-Dist: sphinx-argparse-cli>=1.10.0; extra == "docs"
|
|
45
|
+
Requires-Dist: sphinx-inline-tabs; extra == "docs"
|
|
46
|
+
Requires-Dist: pickleshare; extra == "docs"
|
|
47
|
+
Requires-Dist: ipython; extra == "docs"
|
|
48
|
+
Requires-Dist: matplotlib; extra == "docs"
|
|
49
|
+
Requires-Dist: pint; extra == "docs"
|
|
50
|
+
Requires-Dist: pint-xarray; extra == "docs"
|
|
51
|
+
Requires-Dist: myst-parser; extra == "docs"
|
|
52
|
+
Provides-Extra: test
|
|
53
|
+
Requires-Dist: pytest>=3.3.0; extra == "test"
|
|
54
|
+
Requires-Dist: dask[complete]; extra == "test"
|
|
55
|
+
Requires-Dist: matplotlib; extra == "test"
|
|
56
|
+
Provides-Extra: lint
|
|
57
|
+
Requires-Dist: ruff; extra == "lint"
|
|
58
|
+
Provides-Extra: build
|
|
59
|
+
Requires-Dist: cibuildwheel[uv]; extra == "build"
|
|
60
|
+
Provides-Extra: jupyter
|
|
61
|
+
Requires-Dist: dask[diagnostics]; extra == "jupyter"
|
|
62
|
+
Requires-Dist: ipykernel>=6.29.5; extra == "jupyter"
|
|
63
|
+
Provides-Extra: pint
|
|
64
|
+
Requires-Dist: pint; extra == "pint"
|
|
65
|
+
Requires-Dist: pint-xarray; extra == "pint"
|
|
66
|
+
Description-Content-Type: text/markdown
|
|
67
|
+
|
|
68
|
+
# sdf-xarray
|
|
69
|
+
|
|
70
|
+

|
|
71
|
+

|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
sdf-xarray provides a backend for [xarray](https://xarray.dev) to read SDF files as created by
|
|
75
|
+
[EPOCH](https://epochpic.github.io) using the [SDF-C](https://github.com/epochpic/SDF_C) library.
|
|
76
|
+
Part of [BEAM](#broad-epoch-analysis-modules-beam) (Broad EPOCH Analysis Modules).
|
|
77
|
+
|
|
78
|
+
## Installation
|
|
79
|
+
|
|
80
|
+
Install from PyPI with:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install sdf-xarray
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> [!NOTE]
|
|
87
|
+
> For use within jupyter notebooks, run this additional command after installation:
|
|
88
|
+
>
|
|
89
|
+
> ```bash
|
|
90
|
+
> pip install "sdf-xarray[jupyter]"
|
|
91
|
+
> ```
|
|
92
|
+
|
|
93
|
+
or from a local checkout:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
git clone https://github.com/epochpic/sdf-xarray.git
|
|
97
|
+
cd sdf-xarray
|
|
98
|
+
pip install .
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
We recommend switching to [uv](https://docs.astral.sh/uv/) to manage packages.
|
|
102
|
+
|
|
103
|
+
## Usage
|
|
104
|
+
|
|
105
|
+
### Single file loading
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
import xarray as xr
|
|
109
|
+
|
|
110
|
+
df = xr.open_dataset("0010.sdf")
|
|
111
|
+
|
|
112
|
+
print(df["Electric_Field_Ex"])
|
|
113
|
+
|
|
114
|
+
# <xarray.DataArray 'Electric_Field_Ex' (X_x_px_deltaf_electron_beam: 16)> Size: 128B
|
|
115
|
+
# [16 values with dtype=float64]
|
|
116
|
+
# Coordinates:
|
|
117
|
+
# * X_x_px_deltaf_electron_beam (X_x_px_deltaf_electron_beam) float64 128B 1...
|
|
118
|
+
# Attributes:
|
|
119
|
+
# units: V/m
|
|
120
|
+
# full_name: "Electric Field/Ex"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Multi-file loading
|
|
124
|
+
|
|
125
|
+
To open a whole simulation at once, pass `preprocess=sdf_xarray.SDFPreprocess()`
|
|
126
|
+
to `xarray.open_mfdataset`:
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
import xarray as xr
|
|
130
|
+
from sdf_xarray import SDFPreprocess
|
|
131
|
+
|
|
132
|
+
with xr.open_mfdataset("*.sdf", preprocess=SDFPreprocess()) as ds:
|
|
133
|
+
print(ds)
|
|
134
|
+
|
|
135
|
+
# Dimensions:
|
|
136
|
+
# time: 301, X_Grid_mid: 128, ...
|
|
137
|
+
# Coordinates: (9) ...
|
|
138
|
+
# Data variables: (18) ...
|
|
139
|
+
# Indexes: (9) ...
|
|
140
|
+
# Attributes: (22) ...
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`SDFPreprocess` checks that all the files are from the same simulation, as
|
|
144
|
+
ensures there's a `time` dimension so the files are correctly concatenated.
|
|
145
|
+
|
|
146
|
+
If your simulation has multiple `output` blocks so that not all variables are
|
|
147
|
+
output at every time step, then those variables will have `NaN` values at the
|
|
148
|
+
corresponding time points.
|
|
149
|
+
|
|
150
|
+
For more in depth documentation please visit: <https://sdf-xarray.readthedocs.io/>
|
|
151
|
+
|
|
152
|
+
## Citing
|
|
153
|
+
|
|
154
|
+
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.
|
|
155
|
+
|
|
156
|
+
## Contributing
|
|
157
|
+
|
|
158
|
+
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.
|
|
159
|
+
|
|
160
|
+
### How to Contribute
|
|
161
|
+
|
|
162
|
+
There are many ways to get involved:
|
|
163
|
+
- **Report bugs**: Found something not working as expected? Open an issue with as much detail as possible.
|
|
164
|
+
- **Request a feature**: Got an idea for a new feature or enhancement? Open a feature request on [GitHub Issues](https://github.com/epochpic/sdf-xarray/issues)!
|
|
165
|
+
- **Improve the documentation**: We aim to keep our docs clear and helpful—if something's missing or unclear, feel free to suggest edits.
|
|
166
|
+
- **Submit code changes**: Bug fixes, refactoring, or new features are welcome.
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
All code is automatically linted, formatted, and tested via GitHub Actions.
|
|
170
|
+
|
|
171
|
+
To run checks locally before opening a pull request, see [CONTRIBUTING.md](CONTRIBUTING.md) or [readthedocs documentation](https://sdf-xarray.readthedocs.io/en/latest/contributing.html)
|
|
172
|
+
|
|
173
|
+
## Broad EPOCH Analysis Modules (BEAM)
|
|
174
|
+
|
|
175
|
+

|
|
176
|
+
|
|
177
|
+
**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:
|
|
178
|
+
|
|
179
|
+
- [sdf-xarray](https://github.com/epochpic/sdf-xarray): Reading and processing SDF files and converting them to [xarray](https://docs.xarray.dev/en/stable/).
|
|
180
|
+
- [epydeck](https://github.com/epochpic/epydeck): Input deck reader and writer.
|
|
181
|
+
- [epyscan](https://github.com/epochpic/epyscan): Create campaigns over a given parameter space using various sampling methods.
|
|
182
|
+
|
|
183
|
+
## PlasmaFAIR
|
|
184
|
+
|
|
185
|
+

|
|
186
|
+
|
|
187
|
+
Originally developed by [PlasmaFAIR](https://plasmafair.github.io), EPSRC Grant EP/V051822/1
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
width="366.76099mm"
|
|
6
|
+
height="69.805mm"
|
|
7
|
+
viewBox="0 0 366.76099 69.805"
|
|
8
|
+
version="1.1"
|
|
9
|
+
id="svg1"
|
|
10
|
+
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
|
|
11
|
+
sodipodi:docname="full_plus_small_logo.svg"
|
|
12
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
13
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
14
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
17
|
+
<sodipodi:namedview
|
|
18
|
+
id="namedview1"
|
|
19
|
+
pagecolor="#505050"
|
|
20
|
+
bordercolor="#eeeeee"
|
|
21
|
+
borderopacity="1"
|
|
22
|
+
inkscape:showpageshadow="0"
|
|
23
|
+
inkscape:pageopacity="0"
|
|
24
|
+
inkscape:pagecheckerboard="true"
|
|
25
|
+
inkscape:deskcolor="#d1d1d1"
|
|
26
|
+
inkscape:document-units="mm"
|
|
27
|
+
inkscape:zoom="0.72871773"
|
|
28
|
+
inkscape:cx="618.20919"
|
|
29
|
+
inkscape:cy="363.65247"
|
|
30
|
+
inkscape:window-width="1920"
|
|
31
|
+
inkscape:window-height="1022"
|
|
32
|
+
inkscape:window-x="1919"
|
|
33
|
+
inkscape:window-y="0"
|
|
34
|
+
inkscape:window-maximized="1"
|
|
35
|
+
inkscape:current-layer="text1749-2-8-7-5-7-84"
|
|
36
|
+
inkscape:export-bgcolor="#00000000" />
|
|
37
|
+
<defs
|
|
38
|
+
id="defs1">
|
|
39
|
+
<radialGradient
|
|
40
|
+
inkscape:collect="always"
|
|
41
|
+
xlink:href="#linearGradient85783"
|
|
42
|
+
id="radialGradient88717-3-2-0-3-4-1"
|
|
43
|
+
cx="105.32675"
|
|
44
|
+
cy="55.141571"
|
|
45
|
+
fx="105.32675"
|
|
46
|
+
fy="55.141571"
|
|
47
|
+
r="76.598824"
|
|
48
|
+
gradientTransform="matrix(1.8681401,0,0,0.28136892,-37.574933,72.156165)"
|
|
49
|
+
gradientUnits="userSpaceOnUse" />
|
|
50
|
+
<linearGradient
|
|
51
|
+
inkscape:collect="always"
|
|
52
|
+
id="linearGradient85783">
|
|
53
|
+
<stop
|
|
54
|
+
style="stop-color:#000000;stop-opacity:0"
|
|
55
|
+
offset="0"
|
|
56
|
+
id="stop85779" />
|
|
57
|
+
<stop
|
|
58
|
+
style="stop-color:#000000;stop-opacity:0;"
|
|
59
|
+
offset="1"
|
|
60
|
+
id="stop85781" />
|
|
61
|
+
</linearGradient>
|
|
62
|
+
<radialGradient
|
|
63
|
+
inkscape:collect="always"
|
|
64
|
+
xlink:href="#linearGradient85783"
|
|
65
|
+
id="radialGradient1"
|
|
66
|
+
cx="105.32675"
|
|
67
|
+
cy="55.141571"
|
|
68
|
+
fx="105.32675"
|
|
69
|
+
fy="55.141571"
|
|
70
|
+
r="76.598824"
|
|
71
|
+
gradientTransform="matrix(1.8681401,0,0,0.28136892,27.451125,241.52477)"
|
|
72
|
+
gradientUnits="userSpaceOnUse" />
|
|
73
|
+
<radialGradient
|
|
74
|
+
inkscape:collect="always"
|
|
75
|
+
xlink:href="#linearGradient85783"
|
|
76
|
+
id="radialGradient2"
|
|
77
|
+
cx="105.32675"
|
|
78
|
+
cy="55.141571"
|
|
79
|
+
fx="105.32675"
|
|
80
|
+
fy="55.141571"
|
|
81
|
+
r="76.598824"
|
|
82
|
+
gradientTransform="matrix(1.8681401,0,0,0.28136892,27.451125,241.52477)"
|
|
83
|
+
gradientUnits="userSpaceOnUse" />
|
|
84
|
+
<radialGradient
|
|
85
|
+
inkscape:collect="always"
|
|
86
|
+
xlink:href="#linearGradient85783"
|
|
87
|
+
id="radialGradient4"
|
|
88
|
+
cx="105.32675"
|
|
89
|
+
cy="55.141571"
|
|
90
|
+
fx="105.32675"
|
|
91
|
+
fy="55.141571"
|
|
92
|
+
r="76.598824"
|
|
93
|
+
gradientTransform="matrix(1.8681401,0,0,0.28136892,27.451125,241.52477)"
|
|
94
|
+
gradientUnits="userSpaceOnUse" />
|
|
95
|
+
<radialGradient
|
|
96
|
+
inkscape:collect="always"
|
|
97
|
+
xlink:href="#linearGradient85783"
|
|
98
|
+
id="radialGradient88717-3-2-0-3-4-7-9"
|
|
99
|
+
cx="105.32675"
|
|
100
|
+
cy="55.141571"
|
|
101
|
+
fx="105.32675"
|
|
102
|
+
fy="55.141571"
|
|
103
|
+
r="76.598824"
|
|
104
|
+
gradientTransform="matrix(1.2133651,0,0,0.18275034,-87.956077,77.224315)"
|
|
105
|
+
gradientUnits="userSpaceOnUse" />
|
|
106
|
+
<radialGradient
|
|
107
|
+
inkscape:collect="always"
|
|
108
|
+
xlink:href="#linearGradient85783"
|
|
109
|
+
id="radialGradient8"
|
|
110
|
+
cx="105.32675"
|
|
111
|
+
cy="55.141571"
|
|
112
|
+
fx="105.32675"
|
|
113
|
+
fy="55.141571"
|
|
114
|
+
r="76.598824"
|
|
115
|
+
gradientTransform="matrix(1.2133651,0,0,0.18275034,35.083533,242.94704)"
|
|
116
|
+
gradientUnits="userSpaceOnUse" />
|
|
117
|
+
<radialGradient
|
|
118
|
+
inkscape:collect="always"
|
|
119
|
+
xlink:href="#linearGradient85783"
|
|
120
|
+
id="radialGradient10"
|
|
121
|
+
cx="105.32675"
|
|
122
|
+
cy="55.141571"
|
|
123
|
+
fx="105.32675"
|
|
124
|
+
fy="55.141571"
|
|
125
|
+
r="76.598824"
|
|
126
|
+
gradientTransform="matrix(1.2133651,0,0,0.18275034,35.083533,242.94704)"
|
|
127
|
+
gradientUnits="userSpaceOnUse" />
|
|
128
|
+
<radialGradient
|
|
129
|
+
inkscape:collect="always"
|
|
130
|
+
xlink:href="#linearGradient85783"
|
|
131
|
+
id="radialGradient12"
|
|
132
|
+
cx="105.32675"
|
|
133
|
+
cy="55.141571"
|
|
134
|
+
fx="105.32675"
|
|
135
|
+
fy="55.141571"
|
|
136
|
+
r="76.598824"
|
|
137
|
+
gradientTransform="matrix(1.2133651,0,0,0.18275034,35.083533,242.94704)"
|
|
138
|
+
gradientUnits="userSpaceOnUse" />
|
|
139
|
+
</defs>
|
|
140
|
+
<g
|
|
141
|
+
inkscape:label="Layer 1"
|
|
142
|
+
inkscape:groupmode="layer"
|
|
143
|
+
id="layer1"
|
|
144
|
+
transform="translate(58.472916,-52.122915)">
|
|
145
|
+
<g
|
|
146
|
+
id="text1749-2-8-7-5-7-84"
|
|
147
|
+
style="font-size:47.4507px;line-height:1.25;stroke:url(#radialGradient88717-3-2-0-3-4-1);stroke-width:0.495057"
|
|
148
|
+
aria-label="{PlasmaFAIR}">
|
|
149
|
+
<path
|
|
150
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';stroke-opacity:0"
|
|
151
|
+
d="m 16.339942,89.189673 c 3.985858,0.521958 5.646633,1.992929 5.646633,4.365464 0,2.562338 -1.99293,5.741535 -1.99293,9.679943 0,3.74861 2.70469,5.74153 7.212507,5.74153 h 2.135281 v -1.89802 l -1.281169,-0.14236 c -3.274098,-0.3796 -4.602718,-1.13881 -4.602718,-3.89095 0,-3.606256 1.043916,-7.070157 1.043916,-8.968185 0,-3.036845 -1.32862,-5.172126 -4.412915,-5.836436 3.084295,-0.66431 4.412915,-2.799591 4.412915,-5.836436 0,-1.898028 -1.043916,-5.361929 -1.043916,-8.968182 0,-2.75214 1.32862,-3.511352 4.602718,-3.890957 l 1.281169,-0.142352 v -1.898028 h -2.135281 c -4.507817,0 -7.212507,1.992929 -7.212507,5.741534 0,3.938408 1.99293,7.117605 1.99293,9.679943 0,2.372535 -1.660775,3.843506 -5.646633,4.365464 z"
|
|
152
|
+
id="path5" />
|
|
153
|
+
<path
|
|
154
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';fill:#ca0020"
|
|
155
|
+
d="m 44.762904,71.870168 c 5.694084,0 8.208971,2.657239 8.208971,7.259957 0,4.460366 -2.277634,7.544661 -8.019168,7.544661 h -3.131746 v -2.277633 c 0,-4.223113 0,-8.446225 0.0949,-12.526985 z m -11.910125,-0.237253 4.365464,0.521957 c 0.0949,4.08076 0.0949,8.16152 0.0949,12.242281 v 2.325084 c 0,4.128211 0,8.256421 -0.0949,12.24228 l -4.365464,0.521958 v 1.945475 h 13.475998 v -1.945475 l -4.412915,-0.521958 c -0.0949,-3.41645 -0.0949,-6.643098 -0.0949,-10.059548 h 2.467436 c 9.727393,0 13.381097,-4.460366 13.381097,-9.774844 0,-5.551732 -4.033309,-9.442689 -12.052477,-9.442689 H 32.852779 Z m 27.046932,29.799035 h 11.767774 v -1.708222 l -3.796056,-0.66431 c -0.04745,-2.514887 -0.0949,-5.077224 -0.0949,-7.592111 V 73.483492 l 0.189803,-6.737999 -0.66431,-0.379606 -7.402309,2.135281 v 1.660775 l 3.890958,0.474507 v 20.830857 c 0,2.514887 -0.04745,5.029774 -0.0949,7.592111 l -3.796056,0.66431 z m 32.219029,0.47451 c 1.660775,0 2.989394,-0.61686 4.128211,-2.467436 l -0.949014,-1.043915 c -0.521958,0.616859 -1.043915,1.043915 -1.850577,1.043915 -1.043916,0 -1.708225,-0.759211 -1.708225,-2.799591 V 86.532434 c 0,-5.978788 -2.372535,-8.256422 -7.354859,-8.256422 -4.839971,0 -8.351323,2.277634 -9.252886,5.883887 0.142352,1.233718 0.901563,1.945479 2.230183,1.945479 1.281169,0 2.04038,-0.806662 2.467436,-2.277634 l 0.901564,-3.084295 c 0.996464,-0.237254 1.850577,-0.284704 2.562337,-0.284704 3.131746,0 4.460366,1.138816 4.460366,5.741534 v 1.186268 c -1.898028,0.427056 -3.890957,1.043915 -5.361929,1.565873 -6.405844,2.325084 -7.876816,4.460365 -7.876816,7.165055 0,3.938405 2.894493,5.931335 6.358394,5.931335 2.799591,0 4.365464,-1.23372 6.975252,-3.796053 0.379606,2.230183 1.99293,3.653703 4.270563,3.653703 z M 78.737643,95.405715 c 0,-1.423521 0.521958,-3.226648 4.650169,-4.839972 0.996464,-0.379605 2.70469,-0.949014 4.365464,-1.423521 v 7.259957 c -2.894493,2.087831 -3.796056,2.514887 -5.219577,2.514887 -2.182732,0 -3.796056,-0.996464 -3.796056,-3.511351 z m 27.284197,6.643095 c 6.12114,0 9.25288,-3.179194 9.25288,-6.785447 0,-2.989394 -1.80312,-5.219577 -6.54819,-6.975253 l -1.47098,-0.521958 c -3.22664,-1.186267 -4.36546,-1.992929 -4.36546,-4.08076 0,-1.945479 1.51842,-3.226647 4.41291,-3.226647 1.13882,0 2.23019,0.284704 3.2741,0.806661 l 0.75921,3.796056 h 2.46744 l 0.1898,-4.839971 c -2.04038,-1.233718 -4.08076,-1.945479 -6.64309,-1.945479 -5.31448,0 -8.256426,3.226648 -8.256426,6.690549 0,3.226647 2.277636,5.124675 5.741536,6.405844 l 2.18273,0.806662 c 2.98939,1.043916 4.41292,2.087831 4.41292,4.128211 0,2.135281 -1.70823,3.606253 -5.31448,3.606253 -1.47097,0 -2.70469,-0.237253 -3.84351,-0.759211 l -0.90156,-4.128211 h -2.609791 l 0.189803,5.219581 c 2.325088,1.18626 4.412918,1.80312 7.070158,1.80312 z m 13.00148,-0.61686 h 11.00856 v -1.708222 l -3.27409,-0.66431 c -0.0475,-2.372534 -0.0949,-5.504281 -0.0949,-7.592111 v -6.927802 c 2.32509,-1.99293 4.12822,-2.847042 6.31095,-2.847042 2.79959,0 3.89095,1.423521 3.89095,5.741534 v 4.03331 c 0,2.182732 -0.0474,5.267027 -0.0949,7.592111 l -3.51135,0.66431 v 1.708222 h 11.00856 v -1.708222 l -3.32155,-0.66431 c -0.0474,-2.372534 -0.0949,-5.409379 -0.0949,-7.592111 v -4.412915 c 0,-0.854113 -0.0474,-1.660775 -0.0949,-2.372535 2.41999,-2.182732 4.36547,-2.989394 6.3584,-2.989394 2.75214,0 3.98585,1.233718 3.98585,5.646633 v 4.128211 c 0,2.182732 -0.0474,5.267027 -0.0949,7.592111 l -3.51135,0.66431 v 1.708222 h 11.00856 v -1.708222 l -3.32155,-0.66431 c -0.0474,-2.372534 -0.0949,-5.409379 -0.0949,-7.592111 v -4.887422 c 0,-5.883887 -2.23018,-8.303873 -6.07369,-8.303873 -3.08429,0 -6.16859,1.518423 -8.58857,4.460366 -0.80667,-3.131746 -2.65724,-4.460366 -5.64664,-4.460366 -2.94194,0 -6.07369,1.803127 -8.30387,4.318014 l -0.3796,-3.843507 -0.71176,-0.474507 -6.6431,2.894493 v 1.660774 l 3.7486,0.427057 c 0.0949,1.898028 0.14235,3.321549 0.14235,5.931337 v 2.277634 c 0,2.135281 -0.0474,5.219577 -0.0949,7.592111 l -3.51135,0.66431 z m 60.59459,0.47451 c 1.66078,0 2.9894,-0.61686 4.12821,-2.467436 l -0.94901,-1.043915 c -0.52196,0.616859 -1.04392,1.043915 -1.85058,1.043915 -1.04391,0 -1.70822,-0.759211 -1.70822,-2.799591 V 86.532434 c 0,-5.978788 -2.37254,-8.256422 -7.35486,-8.256422 -4.83997,0 -8.35132,2.277634 -9.25289,5.883887 0.14235,1.233718 0.90157,1.945479 2.23019,1.945479 1.28116,0 2.04038,-0.806662 2.46743,-2.277634 l 0.90156,-3.084295 c 0.99647,-0.237254 1.85058,-0.284704 2.56234,-0.284704 3.13175,0 4.46037,1.138816 4.46037,5.741534 v 1.186268 c -1.89803,0.427056 -3.89096,1.043915 -5.36193,1.565873 -6.40585,2.325084 -7.87682,4.460365 -7.87682,7.165055 0,3.938405 2.8945,5.931335 6.3584,5.931335 2.79959,0 4.36546,-1.23372 6.97525,-3.796053 0.37961,2.230183 1.99293,3.653703 4.27056,3.653703 z m -13.38109,-6.500745 c 0,-1.423521 0.52195,-3.226648 4.65016,-4.839972 0.99647,-0.379605 2.70469,-0.949014 4.36547,-1.423521 v 7.259957 c -2.89449,2.087831 -3.79606,2.514887 -5.21958,2.514887 -2.18273,0 -3.79605,-0.996464 -3.79605,-3.511351 z"
|
|
156
|
+
id="path6" />
|
|
157
|
+
<path
|
|
158
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';fill:#0571b0"
|
|
159
|
+
d="m 186.11869,71.632915 4.36546,0.521957 c 0.0949,4.08076 0.0949,8.16152 0.0949,12.242281 v 2.325084 c 0,4.128211 0,8.256421 -0.0949,12.24228 l -4.36546,0.521958 v 1.945475 h 13.476 v -1.945475 l -4.41292,-0.521958 c -0.0949,-3.890957 -0.0949,-7.924267 -0.0949,-12.621886 h 7.35486 l 0.66431,4.934873 h 2.18273 V 79.604632 h -2.18273 l -0.66431,4.507816 h -7.35486 c 0,-3.890957 0,-8.019168 0.0949,-12.052477 h 11.15092 l 1.04391,6.026239 h 2.70469 l -0.33215,-8.398774 h -23.63045 z m 36.63194,3.131746 4.74507,14.140308 h -9.53759 z m -14.42501,26.667289 h 10.86621 v -1.945475 l -4.65017,-0.616859 2.65724,-7.734464 h 11.00856 l 2.60979,7.781914 -4.65017,0.569409 v 1.945475 h 12.90659 v -1.945475 l -3.5588,-0.427057 -10.107,-29.609236 h -2.98939 l -10.107,29.419434 -3.98586,0.616859 z m 32.88331,-29.799035 4.36546,0.521957 c 0.0949,4.08076 0.0949,8.16152 0.0949,12.242281 v 2.325084 c 0,4.128211 0,8.256421 -0.0949,12.24228 l -4.36546,0.521958 v 1.945475 h 13.42855 v -1.945475 l -4.36547,-0.521958 c -0.0949,-4.08076 -0.0949,-8.16152 -0.0949,-12.24228 v -2.325084 c 0,-4.128211 0,-8.256422 0.0949,-12.242281 l 4.36547,-0.521957 v -1.945479 h -13.42855 z m 30.74806,0.237253 c 4.88742,0 6.97525,2.182732 6.97525,6.168591 0,3.796056 -2.37253,6.548196 -7.49721,6.548196 h -3.6537 c 0,-4.507816 0,-8.541125 0.0949,-12.716787 z m -13.14384,-0.237253 4.36546,0.521957 c 0.0949,4.08076 0.0949,8.16152 0.0949,12.242281 v 2.325084 c 0,4.128211 0,8.256421 -0.0949,12.24228 l -4.36546,0.521958 v 1.945475 h 13.42854 v -1.945475 l -4.36546,-0.521958 c -0.0949,-3.796056 -0.0949,-7.687013 -0.0949,-12.24228 h 2.32508 c 3.84351,0 5.59918,0.71176 6.50075,4.555267 l 1.89803,7.592112 c 0.5694,2.277634 1.89802,3.036844 4.88742,3.036844 1.47097,0 2.60979,-0.1898 3.5588,-0.47451 v -1.945475 l -3.6537,-0.427057 -2.04038,-7.022703 c -1.09137,-3.748605 -2.79959,-5.45683 -5.59919,-6.026239 5.31448,-0.949014 7.97172,-4.318013 7.97172,-8.019168 0,-5.219577 -4.27056,-8.303872 -11.53052,-8.303872 h -13.28619 z"
|
|
160
|
+
id="path7" />
|
|
161
|
+
<path
|
|
162
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';stroke-opacity:0"
|
|
163
|
+
d="m 302.04078,87.291645 c -3.98585,-0.521958 -5.64663,-1.992929 -5.64663,-4.365464 0,-2.562338 1.99293,-5.741535 1.99293,-9.679943 0,-3.748605 -2.70469,-5.741534 -7.21251,-5.741534 h -2.13528 v 1.898028 l 1.28117,0.142352 c 3.2741,0.379605 4.60272,1.138817 4.60272,3.890957 0,3.606253 -1.04392,7.070154 -1.04392,8.968182 0,3.036845 1.32862,5.172126 4.41292,5.836436 -3.0843,0.66431 -4.41292,2.799591 -4.41292,5.836436 0,1.898028 1.04392,5.361929 1.04392,8.968185 0,2.75214 -1.32862,3.51135 -4.60272,3.89095 l -1.28117,0.14236 v 1.89802 h 2.13528 c 4.50782,0 7.21251,-1.99292 7.21251,-5.74153 0,-3.938408 -1.99293,-7.117605 -1.99293,-9.679943 0,-2.372535 1.66078,-3.843506 5.64663,-4.365464 z"
|
|
164
|
+
id="path8" />
|
|
165
|
+
</g>
|
|
166
|
+
<path
|
|
167
|
+
id="path388577"
|
|
168
|
+
style="fill:none;stroke:#000000;stroke-width:2.565"
|
|
169
|
+
d="M 6.0495663,87.671242 A 31.619991,31.619991 0 0 1 -25.570425,119.29123 31.619991,31.619991 0 0 1 -57.190416,87.671242 31.619991,31.619991 0 0 1 -25.570425,56.05125 31.619991,31.619991 0 0 1 6.0495663,87.671242 Z" />
|
|
170
|
+
<g
|
|
171
|
+
id="text1749-2-8-7-5-7-8-8"
|
|
172
|
+
style="font-size:30.8195px;line-height:1.25;stroke:url(#radialGradient88717-3-2-0-3-4-7-9);stroke-width:0.321542"
|
|
173
|
+
aria-label="{PF}">
|
|
174
|
+
<path
|
|
175
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';stroke-opacity:0"
|
|
176
|
+
d="m -52.938103,88.287636 c 2.588838,0.339015 3.66752,1.294419 3.66752,2.835394 0,1.664253 -1.294419,3.72916 -1.294419,6.287178 0,2.434741 1.756712,3.729162 4.684564,3.729162 h 1.386878 v -1.232782 l -0.832127,-0.09246 c -2.126545,-0.246556 -2.989491,-0.739668 -2.989491,-2.527199 0,-2.342282 0.678029,-4.592105 0.678029,-5.824885 0,-1.972448 -0.862946,-3.359326 -2.866214,-3.790799 2.003268,-0.431473 2.866214,-1.81835 2.866214,-3.790798 0,-1.23278 -0.678029,-3.482604 -0.678029,-5.824886 0,-1.787531 0.862946,-2.280643 2.989491,-2.527199 l 0.832127,-0.09246 v -1.23278 h -1.386878 c -2.927852,0 -4.684564,1.294419 -4.684564,3.729159 0,2.558019 1.294419,4.622925 1.294419,6.287178 0,1.540975 -1.078682,2.49638 -3.66752,2.835394 z"
|
|
177
|
+
id="path1" />
|
|
178
|
+
<path
|
|
179
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';fill:#ca0020"
|
|
180
|
+
d="m -34.477227,77.038519 c 3.69834,0 5.331774,1.725892 5.331774,4.715383 0,2.897033 -1.479336,4.900301 -5.208496,4.900301 h -2.034087 v -1.479336 c 0,-2.742936 0,-5.485871 0.06164,-8.136348 z m -7.735694,-0.154098 2.835394,0.339015 c 0.06164,2.650477 0.06164,5.300954 0.06164,7.951431 v 1.510155 c 0,2.681297 0,5.362593 -0.06164,7.951431 l -2.835394,0.339015 v 1.263599 h 8.752738 v -1.263599 l -2.866214,-0.339015 c -0.06164,-2.219004 -0.06164,-4.31473 -0.06164,-6.533734 h 1.602614 c 6.317998,0 8.691099,-2.897033 8.691099,-6.348817 0,-3.605881 -2.619657,-6.13308 -7.828153,-6.13308 h -8.290445 z"
|
|
181
|
+
id="path2" />
|
|
182
|
+
<path
|
|
183
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';fill:#0571b0"
|
|
184
|
+
d="m -24.060213,76.884421 2.835394,0.339015 c 0.06164,2.650477 0.06164,5.300954 0.06164,7.951431 v 1.510155 c 0,2.681297 0,5.362593 -0.06164,7.951431 l -2.835394,0.339015 v 1.263599 h 8.752738 v -1.263599 l -2.866214,-0.339015 c -0.06164,-2.527199 -0.06164,-5.146856 -0.06164,-8.197987 h 4.777023 l 0.431473,3.205228 h 1.417697 v -7.581597 h -1.417697 l -0.431473,2.927853 h -4.777023 c 0,-2.527199 0,-5.208496 0.06164,-7.828153 h 7.242583 l 0.678029,3.914076 h 1.7567113 L -8.7121022,75.620822 H -24.060213 Z"
|
|
185
|
+
id="path3" />
|
|
186
|
+
<path
|
|
187
|
+
style="font-family:'Source Serif Pro';-inkscape-font-specification:'Source Serif Pro';stroke-opacity:0"
|
|
188
|
+
d="m 1.7973621,87.054856 c -2.58883801,-0.339014 -3.6675205,-1.294419 -3.6675205,-2.835394 0,-1.664253 1.29441899,-3.729159 1.29441899,-6.287178 0,-2.43474 -1.75671149,-3.729159 -4.68456399,-3.729159 h -1.3868775 v 1.23278 l 0.8321265,0.09246 c 2.1265455,0.246556 2.9894915,0.739668 2.9894915,2.527199 0,2.342282 -0.678029,4.592106 -0.678029,5.824886 0,1.972448 0.862946,3.359325 2.86621349,3.790798 -2.00326749,0.431473 -2.86621349,1.818351 -2.86621349,3.790799 0,1.23278 0.678029,3.482603 0.678029,5.824885 0,1.787531 -0.862946,2.280643 -2.9894915,2.527199 l -0.8321265,0.09246 v 1.232782 h 1.3868775 c 2.9278525,0 4.68456399,-1.294421 4.68456399,-3.729162 0,-2.558018 -1.29441899,-4.622925 -1.29441899,-6.287178 0,-1.540975 1.07868249,-2.496379 3.6675205,-2.835394 z"
|
|
189
|
+
id="path4" />
|
|
190
|
+
</g>
|
|
191
|
+
</g>
|
|
192
|
+
</svg>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# sdf-xarray
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
sdf-xarray provides a backend for [xarray](https://xarray.dev) to read SDF files as created by
|
|
8
|
+
[EPOCH](https://epochpic.github.io) using the [SDF-C](https://github.com/epochpic/SDF_C) library.
|
|
9
|
+
Part of [BEAM](#broad-epoch-analysis-modules-beam) (Broad EPOCH Analysis Modules).
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Install from PyPI with:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install sdf-xarray
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> [!NOTE]
|
|
20
|
+
> For use within jupyter notebooks, run this additional command after installation:
|
|
21
|
+
>
|
|
22
|
+
> ```bash
|
|
23
|
+
> pip install "sdf-xarray[jupyter]"
|
|
24
|
+
> ```
|
|
25
|
+
|
|
26
|
+
or from a local checkout:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/epochpic/sdf-xarray.git
|
|
30
|
+
cd sdf-xarray
|
|
31
|
+
pip install .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
We recommend switching to [uv](https://docs.astral.sh/uv/) to manage packages.
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Single file loading
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import xarray as xr
|
|
42
|
+
|
|
43
|
+
df = xr.open_dataset("0010.sdf")
|
|
44
|
+
|
|
45
|
+
print(df["Electric_Field_Ex"])
|
|
46
|
+
|
|
47
|
+
# <xarray.DataArray 'Electric_Field_Ex' (X_x_px_deltaf_electron_beam: 16)> Size: 128B
|
|
48
|
+
# [16 values with dtype=float64]
|
|
49
|
+
# Coordinates:
|
|
50
|
+
# * X_x_px_deltaf_electron_beam (X_x_px_deltaf_electron_beam) float64 128B 1...
|
|
51
|
+
# Attributes:
|
|
52
|
+
# units: V/m
|
|
53
|
+
# full_name: "Electric Field/Ex"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Multi-file loading
|
|
57
|
+
|
|
58
|
+
To open a whole simulation at once, pass `preprocess=sdf_xarray.SDFPreprocess()`
|
|
59
|
+
to `xarray.open_mfdataset`:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
import xarray as xr
|
|
63
|
+
from sdf_xarray import SDFPreprocess
|
|
64
|
+
|
|
65
|
+
with xr.open_mfdataset("*.sdf", preprocess=SDFPreprocess()) as ds:
|
|
66
|
+
print(ds)
|
|
67
|
+
|
|
68
|
+
# Dimensions:
|
|
69
|
+
# time: 301, X_Grid_mid: 128, ...
|
|
70
|
+
# Coordinates: (9) ...
|
|
71
|
+
# Data variables: (18) ...
|
|
72
|
+
# Indexes: (9) ...
|
|
73
|
+
# Attributes: (22) ...
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`SDFPreprocess` checks that all the files are from the same simulation, as
|
|
77
|
+
ensures there's a `time` dimension so the files are correctly concatenated.
|
|
78
|
+
|
|
79
|
+
If your simulation has multiple `output` blocks so that not all variables are
|
|
80
|
+
output at every time step, then those variables will have `NaN` values at the
|
|
81
|
+
corresponding time points.
|
|
82
|
+
|
|
83
|
+
For more in depth documentation please visit: <https://sdf-xarray.readthedocs.io/>
|
|
84
|
+
|
|
85
|
+
## Citing
|
|
86
|
+
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
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.
|
|
92
|
+
|
|
93
|
+
### How to Contribute
|
|
94
|
+
|
|
95
|
+
There are many ways to get involved:
|
|
96
|
+
- **Report bugs**: Found something not working as expected? Open an issue with as much detail as possible.
|
|
97
|
+
- **Request a feature**: Got an idea for a new feature or enhancement? Open a feature request on [GitHub Issues](https://github.com/epochpic/sdf-xarray/issues)!
|
|
98
|
+
- **Improve the documentation**: We aim to keep our docs clear and helpful—if something's missing or unclear, feel free to suggest edits.
|
|
99
|
+
- **Submit code changes**: Bug fixes, refactoring, or new features are welcome.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
All code is automatically linted, formatted, and tested via GitHub Actions.
|
|
103
|
+
|
|
104
|
+
To run checks locally before opening a pull request, see [CONTRIBUTING.md](CONTRIBUTING.md) or [readthedocs documentation](https://sdf-xarray.readthedocs.io/en/latest/contributing.html)
|
|
105
|
+
|
|
106
|
+
## Broad EPOCH Analysis Modules (BEAM)
|
|
107
|
+
|
|
108
|
+

|
|
109
|
+
|
|
110
|
+
**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:
|
|
111
|
+
|
|
112
|
+
- [sdf-xarray](https://github.com/epochpic/sdf-xarray): Reading and processing SDF files and converting them to [xarray](https://docs.xarray.dev/en/stable/).
|
|
113
|
+
- [epydeck](https://github.com/epochpic/epydeck): Input deck reader and writer.
|
|
114
|
+
- [epyscan](https://github.com/epochpic/epyscan): Create campaigns over a given parameter space using various sampling methods.
|
|
115
|
+
|
|
116
|
+
## PlasmaFAIR
|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+
Originally developed by [PlasmaFAIR](https://plasmafair.github.io), EPSRC Grant EP/V051822/1
|