Skip to main content

megpy

Project description

MEGPy: Magnetic Equilibrium Geometry Python

MEGPy is a package for quick extraction of (local) equilibrium quantities and visualisation of 2D magnetic equilibria used in magnetic confinement fusion research. It offers both a command line interface (CLI) and Python API.

Getting started

To get MEGPy clone and install the latest version:

$ git clone https://github.com/gsnoep/megpy.git
$ cd megpy
$ pip install --user -e .

To use MEGPy call the CLI:

$ python -m megpy <file_path> <parameterization> <x_fs>

For details on the CLI options:

$ python -m megpy -h

Or use the Python API, of which some examples can be found in /examples/.

To contribute, open a pull request or raise an issue!

Supported equilibrium formats

  • EQDSK (g-file) from EFIT, ESCO, FreeGS, CHEASE or LIUQE
  • EX2GK pickle file
  • IMAS equilibrium IDS

To be added:

  • VMEC

Supported flux-surface geometries

  • Miller (doi)
  • Turnbull-Miller (doi)
  • Fourier / generalised Miller (doi)
  • Miller eXtended Harmonic (MXH) (doi)

Citation

If you use MEGPy in your research, please cite (bibtex):

G. Snoep, J.T.W. Koenders, C. Bourdelle, J. Citrin and JET contributors, "Improved flux-surface parameterization through constrained nonlinear optimization," Physics of Plasmas 30, 063906 (2023)

                .#&%%%-.
            <===#%%%%%%%%%%.
               ?==%%( )%%%%%%
                )%%%%%%%%%%%%%\
                (%%%%%%%%%%%..%%%
                (%%%%%%%%&..    .\%.
                 %%%%%%%% &\,.  ..\%%%.
                 M%%%%%%%...&&%\%%%%%%%%%-
                   %%%%%.       .\%%%%%%%%%%.
                    %%%..             .\%%%%%%%.
                     E...               .\%%%%%%%-.
                        &...              )%%%%(%%%.
                           G..   .&).     )GS\   \%%%%%%-.
                              \&))  \&(%^^          \&%%%%%&.
                               )%%    %%                 \%%%%%%%&.
                            .&&     .%                        \&\\%%%%\\&..
                         .%<       (\                               %    \
                  .::-P-..-&  &&-Y&--.

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

megpy-2.0.9.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

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

megpy-2.0.9-py2.py3-none-any.whl (55.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file megpy-2.0.9.tar.gz.

File metadata

  • Download URL: megpy-2.0.9.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for megpy-2.0.9.tar.gz
Algorithm Hash digest
SHA256 2768ee92fbe347520333a96007b84e1e58c96483b59d3c04ffdda8b04b66fbe2
MD5 d9c44227ca81fa3b150817bbe063c2e3
BLAKE2b-256 5484b9fba84ee5dedf4e0d6abfab706e133520545b61c624f0687bc37d2263cc

See more details on using hashes here.

File details

Details for the file megpy-2.0.9-py2.py3-none-any.whl.

File metadata

  • Download URL: megpy-2.0.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 55.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for megpy-2.0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8f53e921e987a4617142b27a5a76044e7e5d0ab03ef05a2c6e29eeb4df260164
MD5 8c3fbf395a64e1f7e40bcdfa7cd6c0d9
BLAKE2b-256 17c3414585394954bac0e695beb058e2a1b3bf678f55f3192822ef6785bb3ea7

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