imas2xarray
Imas2xarray is a library that makes it as simple and intuitive as possible to read and write IMAS data in HDF5 format with Python. There is no need to manually define the paths or fiddle with the different dimensions and long keys.
Reading
>>> from imas2xarray import to_xarray
>>>
>>> path = '/pfs/work/g2aho/public/imasdb/test/3/92436/1/'
>>> ids = 'equilibrium'
>>>
>>> ds = to_xarray(path, ids)
>>> ds
<xarray.Dataset>
Dimensions: (time: 1, rho_tor_norm: 101, ion: 4)
Coordinates:
* time (time) float64 50.04
* rho_tor_norm (rho_tor_norm) float64 0.0 0.01 0.02 0.03 ... 0.98 0.99 1.0
Dimensions without coordinates: ion
Data variables: (12/14)
q (time, rho_tor_norm) float64 0.7887 0.7888 ... 4.262 4.845
collisionality (time, rho_tor_norm) float64 23.23 7.554 ... 7.31 10.19
t_i_ave (time, rho_tor_norm) float64 1.036e+04 1.036e+04 ... 508.4
... ...
n_e (time, rho_tor_norm) float64 7.976e+19 ... 1.742e+19
p_i (time, ion, rho_tor_norm) float64 1.242e+05 ... 0.2948
n_e_tot (time, rho_tor_norm) float64 7.976e+19 ... 1.742e+19
Writing
>>> from imas2xarray import to_imas
>>>
>>> ds['t_e'] *= 1.1
>>>
>>> to_imas(
>>> path,
>>> dataset=ds,
>>> ids=ids
>>> )
For more advanced use-cases and examples, please see the documentation.
Installing imas2xarray
To install:
pip install imas2xarray
Imas2xarray is supported on Python versions 3.9 or newer.
Development
Check out our Contributing Guidelines to get started with development.
Suggestions, improvements, and edits are most welcome.
Metadata
Release files for imas2xarray 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imas2xarray-0.4.0.tar.gz | 20.8 kB | Without provenance | Details for imas2xarray-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imas2xarray-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for imas2xarray-0.4.0-py3-none-any.whl |
Total release size: 38.8 kB
Release files / imas2xarray-0.4.0.tar.gz
| Download URL | imas2xarray-0.4.0.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4a2e4462430512c18ff44c192fa814da1490e343e9568d70615350822206232
|
|
BLAKE2b-256 checksum How to use checksums |
e1057cb0ca2620614497b7e7b1979b224ffe6b58bdd0cc74c431ce27ce999de8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / imas2xarray-0.4.0-py3-none-any.whl
| Download URL | imas2xarray-0.4.0-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c18051453e514dfdc9b54b297bdcb1f61764f0219628942db63fa5f600de40f
|
|
BLAKE2b-256 checksum How to use checksums |
f2c82312bc1a6cd9c48c312673e4a418d7cc390a452ec3681466d0943826442e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for imas2xarray 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.