Skip to main content

Python module for an easy work with a tokamak plasma equilibrium.

Project description

PLEQUE - PLasma EQUilibrium Enjoyment module [pleɪɡ]

GitHub py3comp

PLEQUE is a Python module allowing simple visualisation and manipulation of tokamak plasma equilibria. For more information see the documentation at https://pleque.readthedocs.io.

Note: The work is still in the early development stage, so pleque probably contains bugs. You are very welcome to submit your wishes, encountered bugs or any other comments as an issue. Minor changes in the code structure may occur before the 0.1.0 release.

Getting Started

Prerequisites

The following packages are required to install pleque:

python>=3.5
numpy
scipy
shapely
scikit-image
xarray
pandas
h5py
omas

They should be automatically handled by pip further in the installation process.

Download the source code

First, pick where you wish to install the code:

 cd /desired/path/

There are two options how to get the code: from PyPI or by cloning the repository.

From PyPI (https://pypi.org/project/pleque/)

pip install --user pleque

Alternatively, you may use the unstable experimental release (probably with more fixed bugs):

 pip install --user -i https://test.pypi.org/simple/ pleque

Clone the github repository

git clone https://github.com/kripnerl/pleque.git
cd pleque
pip install --user .

Congratulations, you have just installed pleque!

Examples

The following example shows how to load an equilibrium saved in the eqdsk format. The equilibrium used here comes from a FIESTA simulation of the COMPASS-Upgrade tokamak.

from pleque.io import readers
import pkg_resources
import matplotlib as plt

#Locate a test equilibrium
filepath = pkg_resources.resource_filename('pleque', 'resources/baseline_eqdsk')

The heart of pleque is its Equilibrium class, which contains all the equilibrium information (and much more). Typically its instances are called eq.

# Create an instance of the `Equilibrium` class
eq = readers.read_geqdsk(filepath)

The Equilibrium class comes with tons of interesting functions and caveats.

# Plot a simple overview of the equilibrium
eq.plot_overview()

# Calculate the separatrix area
sep_area = eq.lcfs.area

# Get absolute magnetic field magnitude at given point
R = 0.7 #m
Z = 0.1 #m
B = eq.B_abs(R, Z)

Equilibria may be visualised in many different ways; they may be used for mapping or field line tracing; the possibilities are virtually endless. If there's a caveat you find missing from pleque, write to us! Further examples can be found as notebooks in the notebooks folder or in the examples directory.

Version

0.0.7

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related projects

  • FreeGS - free boundary Grad-Shafranov solver in Python.
  • OMFIT is an integrated modeling and experimental data analysis software for magnetically confined thermonuclear fusion experiments. The goal of OMFIT is to enhance existing scientific workflows and enable new integrated modeling capabilities. To achieve these goals OMFIT adopts a bottom-up collaborative development approach.
  • OMAS (Ordered Multidimensional Array Structure) is a Python library designed to simplify the interface of third-party codes with the ITER Integrated Modeling and Analysis Suite (IMAS) . ITER IMAS defines a data model, a data get/put API, and a data storage infrastructure used for manipulating ITER data.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pleque-0.0.7.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pleque-0.0.7-py3-none-any.whl (5.5 MB view details)

Uploaded Python 3

File details

Details for the file pleque-0.0.7.tar.gz.

File metadata

  • Download URL: pleque-0.0.7.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/6.0.0 pkginfo/1.9.6 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.65.0 CPython/3.9.16

File hashes

Hashes for pleque-0.0.7.tar.gz
Algorithm Hash digest
SHA256 cfba36049262c9b3beff0c74d15ddbeb480df22506783774c4483f8262154637
MD5 4815b66093a0cb167693f5b87a62059e
BLAKE2b-256 00383a02c39415cb48fd633cbcbde530b9c9c7c95db49f3e9a26346758129da4

See more details on using hashes here.

File details

Details for the file pleque-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: pleque-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/6.0.0 pkginfo/1.9.6 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.65.0 CPython/3.9.16

File hashes

Hashes for pleque-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e2623e8f10046b0cb3f6a2377cd0441b0df80544985050dfa3f5d32c347e42fb
MD5 3d01645eaa0d77b29fbb9e92990a7ef1
BLAKE2b-256 47977b183f1f87ae4663a138ab5db0af5ed42c046f9fafe70947d6dc392fd9ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page