An open API service indexing awesome lists of open source software.

https://github.com/fusion-power-plant-framework/eqdsk

g-eqdsk reading and writing with identification and conversion between COCOS versions
https://github.com/fusion-power-plant-framework/eqdsk

eqdsk equilibrium file-format nuclear-fusion plasma-physics

Last synced: 5 months ago
JSON representation

g-eqdsk reading and writing with identification and conversion between COCOS versions

Awesome Lists containing this project

README

          

# Eqdsk

[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
[![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![Downloads](https://img.shields.io/pypi/dm/eqdsk?color=blue)
[![Actions status](https://github.com/Fusion-Power-Plant-Framework/eqdsk/actions/workflows/main_and_pr.yml/badge.svg)](https://github.com//Fusion-Power-Plant-Framework/eqdsk/actions)

An EQDSK reader and writer for GEQDSK (more soon), with COCOS identification and conversion.

There is support for writing an eqdsk to a JSON format (which is now preferred) and an IMAS database integration.

We have extended the EQDSK standard to optionally allow for the definition of a CoilSet.

## Setup

We are pip installable therefore for the most recent release:

```bash
pip install eqdsk
```

or for the most recent commit

```bash
pip install git+https://github.com/Fusion-Power-Plant-Framework/eqdsk.git
```

For a developer setup please see [CONTRIBUTING.md](CONTRIBUTING.md#setup-with-hatch)

## Basic Usage

To read in an eqdsk (json or eqdsk) in its raw state:

```python
from eqdsk import EQDSKInterface

EQDSKInterface.from_file('file.json', no_cocos=True)
```

To read in an eqdsk file with a known cocos format and convert it to a given cocos format:

```python
EQDSKInterface.from_file('file.eqdsk', from_cocos=11, to_cocos=17)
```

Alternatively if the direction (clockwise or anticlockwise) and the units of phi (V.s or V.s/rad) are known,
the cocos standard will be calculated for you:

```python
EQDSKInterface.from_file('file.eqdsk', clockwise_phi=True, volt_seconds_per_radian=True)
```

## CLI

This package includes a CLI tool for eqdsk exploration.

This can be accessed by running `eqdsk` in the terminal after installing the package (or in the Hatch `cli` environment, see [CONTRIBUTING.md](CONTRIBUTING.md#setup-with-hatch)).

For more information on the CLI tool, run `eqdsk --help`.