Metadata-Version: 2.1
Name: imas2xarray
Version: 0.3.0
Summary: Imas2xarray is a tool reading IMAS data in hdf5 format into xarray.
Author: Victor Azizi
Author-email: Stef Smeets <s.smeets@esciencecenter.nl>
License: Apache 2.0 License
Project-URL: homepage, https://github.com/duqtools/imas2xarray
Project-URL: issues, https://github.com/duqtools/imas2xarray/issues
Project-URL: documentation, https://imas2xarray.readthedocs.io
Project-URL: changelog, https://github.com/duqtools/imas2xarray/releases
Keywords: modelling,tokamak,fusion-reactor,imas
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: importlib_resources; python_version < "3.10"
Requires-Dist: numpy
Requires-Dist: h5py
Requires-Dist: pydantic>=2.0
Requires-Dist: pydantic-yaml>=1.0
Requires-Dist: scipy
Requires-Dist: xarray
Provides-Extra: develop
Requires-Dist: bump-my-version; extra == "develop"
Requires-Dist: ruff; extra == "develop"
Requires-Dist: pre-commit; extra == "develop"
Requires-Dist: coverage[toml]; extra == "develop"
Requires-Dist: pytest; extra == "develop"
Requires-Dist: pytest-dependency; extra == "develop"
Requires-Dist: pycodestyle; extra == "develop"
Provides-Extra: docs
Requires-Dist: jinja2; extra == "docs"
Requires-Dist: markdown-include; extra == "docs"
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-gen-files; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Requires-Dist: mknotebooks; extra == "docs"
Provides-Extra: publishing
Requires-Dist: twine; extra == "publishing"
Requires-Dist: wheel; extra == "publishing"
Requires-Dist: build; extra == "publishing"
Provides-Extra: imas
Requires-Dist: imas; extra == "imas"

[![Documentation Status](https://readthedocs.org/projects/imas2xarray/badge/?version=latest)](https://imas2xarray.readthedocs.io/en/latest/?badge=latest)
[![Tests](https://github.com/duqtools/imas2xarray/actions/workflows/test.yaml/badge.svg)](https://github.com/duqtools/imas2xarray/actions/workflows/test.yaml)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/imas2xarray)](https://pypi.org/project/imas2xarray/)
[![PyPI](https://img.shields.io/pypi/v/imas2xarray.svg?style=flat)](https://pypi.org/project/imas2xarray/)
![Coverage](https://gist.githubusercontent.com/stefsmeets/f635ee4ac999ce969fa1d23a57e006ae/raw/covbadge.svg)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10256040.svg)](https://doi.org/10.5281/zenodo.10256040)

![imas2xarray banner](https://raw.githubusercontent.com/duqtools/imas2xarray/main/src/imas2xarray/data/logo.png)


# imas2xarray

**Imas2xarray** is a library that makes it as simple and intuitive as possible to load an IMAS dataset in HDF5 format into Python. There is no need to manually define the paths or fiddle with the different dimensions and long keys.

```python
>>> 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
```

For more advanced use-cases and examples, please see the [documentation](https://imas2xarray.readthedocs.io).

## Installing imas2xarray

To install:

```console
pip install imas2xarray
```

Imas2xarray is supported on Python versions 3.9 or newer.

## Development

Check out our [Contributing Guidelines](CONTRIBUTING.md#Getting-started-with-development) to get started with development.

Suggestions, improvements, and edits are most welcome.
