Collect FELTOR simulation data into xarray
Project description
xFELTOR
xFELTOR provides an interface for collecting the output data from a FELTOR simulation into an xarray dataset and extends xarray DataSet and DataArray classes with FELTOR specific plotting routines based on the animatplot.
xFELTOR is inspired by xBOUT and uses currently some of its plotting functionality.
Why xarray?
xarray is a powerful open-source python library which aims to provide Pandas-like labelling, visualization & analysis functionality for N-dimensional data. Some of the basic features are:
- Labelled multidimensional data: xarray wraps numpy arrays with their
dimsasDataArrays. - Clear syntax for operations: xarray provides clearer and more general syntax containing less magic numbers than numpy
- Lazy loading into memory: never wastes RAM on unneeded values
- Plotting convenience: xarray provides plotting functions (wrapping matplotlib) which automatically use an appropriate type of plot for the dimension of the data (1D, 2D etc.)
For more information see the xarray getting started guide. Tom Nicholas' presentation about xarray and xBOUT is also a good place to start.
Installation
Dev install:
git clone https://github.com/uit-cosmo/xFELTOR.git
cd xFELTOR
pip install -e .
Loading your data
The function open_feltordataset() uses xarray & dask to collect FELTOR
data into one xarray dataset. This can be either a single output file or multiple coherent files for restarted simulations.
The data can be loaded with
ds = open_feltordataset("./run_dir*/*.nc")
xFELTOR stores all variables from the FELTOR input file as attributes (xarray.Dataset.attrs).
Plotting Methods
In addition to the extensive functionalities provided by xarray, xFELTOR offers some useful plotting methods.
In order to plot the evolution of a 2D variable over time:
ds["electrons"].feltor.animate2D(x="x", y="y")
For plotting a 1D variable over time:
ds["electrons"].isel(y=100).feltor.animate1D(animate_over="time")
You can also plot multiple 1d and 2d variables over time:
ds.feltor.animate_list(
variables=[
ds["electrons"],
ds["ions"].isel(y=100),
ds["potential"],
ds["vorticity"],
]
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xfeltor-0.1.1.tar.gz.
File metadata
- Download URL: xfeltor-0.1.1.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6577025de85327557ef4a2d5a7e5a2f9aed127f00ca7c95f2cb03fbf98ed27e1
|
|
| MD5 |
15f5cc180659969139970e6bf820870a
|
|
| BLAKE2b-256 |
1fef4ebd597b821d81b59a75b84a62658e625e2dcc65107981be2a9ea0cf4b94
|
Provenance
The following attestation bundles were made for xfeltor-0.1.1.tar.gz:
Publisher:
python_publish.yml on feltor-dev/xFELTOR
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfeltor-0.1.1.tar.gz -
Subject digest:
6577025de85327557ef4a2d5a7e5a2f9aed127f00ca7c95f2cb03fbf98ed27e1 - Sigstore transparency entry: 253363237
- Sigstore integration time:
-
Permalink:
feltor-dev/xFELTOR@9ab2b1c10d36e0c6d615e82b55f6e7328afd8d66 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/feltor-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@9ab2b1c10d36e0c6d615e82b55f6e7328afd8d66 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xfeltor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xfeltor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4f2b0d3316143f4db1150820cd2e984e7c34acdcf706e9bcd01eb7b26616625
|
|
| MD5 |
0a88564299afc9be7260ecc764389245
|
|
| BLAKE2b-256 |
53e4db54bef1cbbb191c8451d08b86e25ee9ba5f370edad9da2aa16039fe121d
|
Provenance
The following attestation bundles were made for xfeltor-0.1.1-py3-none-any.whl:
Publisher:
python_publish.yml on feltor-dev/xFELTOR
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfeltor-0.1.1-py3-none-any.whl -
Subject digest:
b4f2b0d3316143f4db1150820cd2e984e7c34acdcf706e9bcd01eb7b26616625 - Sigstore transparency entry: 253363244
- Sigstore integration time:
-
Permalink:
feltor-dev/xFELTOR@9ab2b1c10d36e0c6d615e82b55f6e7328afd8d66 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/feltor-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@9ab2b1c10d36e0c6d615e82b55f6e7328afd8d66 -
Trigger Event:
push
-
Statement type: