Metadata-Version: 2.4
Name: megpy
Version: 2.0.7
Summary: megpy
Author-email: Garud Snoep <gsnoep42@gmail.com>, Aaron Ho <aaronkho@mit.edu>
Project-URL: Homepage, https://github.com/gsnoep/megpy
Project-URL: Bug Reports, https://github.com/gsnoep/megpy/issues
Project-URL: Source, https://github.com/gsnoep/megpy
Keywords: MHD,magnetic,equilibrium,toolkit,fusion,simulation
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26.4
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: xarray
Requires-Dist: h5py
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# 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:
```bash
$ git clone https://github.com/gsnoep/megpy.git
$ cd megpy
$ pip install --user -e .
```

To use MEGPy call the CLI:
```bash
$ python -m megpy <file_path> <parameterization> <x_fs>
```
For details on the CLI options:
```bash
$ 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)](https://w3.pppl.gov/ntcc/TORAY/G_EQDSK.pdf) from EFIT, ESCO, FreeGS, CHEASE or LIUQE
- [EX2GK](https://gitlab.com/aaronkho/EX2GK) pickle file
- IMAS equilibrium IDS

To be added:
- VMEC

# Supported flux-surface geometries
- Miller [(doi)](https://doi.org/10.1063/1.872666)
- Turnbull-Miller [(doi)](https://doi.org/10.1063/1.873380)
- Fourier / generalised Miller [(doi)](https://doi.org/10.1088/0741-3335/51/10/105009)
- Miller eXtended Harmonic (MXH) [(doi)](https://doi.org/10.1088/1361-6587/abc63b)

# Citation
If you use MEGPy in your research, please cite [(bibtex)](https://github.com/gsnoep/megpy/blob/main/citation.bib):
>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&--.
