Package: eqtools
eqtoolsIntroductionPython tools for magnetic equilibria in tokamak plasmas.  Provides framework for portable, modular tools for manipulation of magnetic equilibria in tokamak plasmas, including mapping of flux surfaces into a variety of coordinate systems.  Includes tools for handling EFIT data stored in Alcator C-Mod MDSPlus trees, as well as eqdsk files.Full documentation is available athttp://eqtools.readthedocs.org/Package DependenciesThe following packages are required or recommended:NumPy: Required.SciPy: Required.F2PY: Optional, needed to build the optionaltrisplinemodule.matplotlib: Optional, needed to produce plot of flux surfaces.MDSplus: Optional, needed to use data stored in MDSplus trees.dd: Optional, needed to use data from ASDEX-Upgrade shotfiles.All of these should be available via pip (and should be installed automatically if you runpip install eqtoolsas described in the next section). If you wish to build in place, you may first need to run:pip install numpy scipy f2py matplotlibInstallationThe easiest way to install the latest release version is with pip:pip install eqtoolsTo install from source, uncompress the source files and, from the directory containingsetup.py, run the following command:python setup.py installOr, to build in place, run:python setup.py build_ext --inplaceIf you build in place, you will also need to add your eqtools folder to your PYTHONPATH shell variable:export PYTHONPATH=$PYTHONPATH:/path/to/where/you/put/eqtools/Running TestsTwo tests are included:test.pyuses the moduleSolovievEFITto compare the result fromeqtoolsto Soloviev's analytic solution to the Grad-Shafranov equation for circular flux surfaces. Running this script in an interactive Python session will yield a number of plots, where you can verify that the analytic andeqtoolsresults agree.unittests.pycontains many tests of the internal consistency of the coordinate mapping routines. By default, it will try to access data from the Alcator C-Mod tree. If this is not possible, it will try to load its data from the filetest_data.pkl. You may wish to modify the script to pull in data from your own local site to make sure the specific version you need is working properly. To run these tests, from the directory containingunittests.pyandtest_data.pkl, run the command:python unittests.pySummary of FilesThe following files comprise theeqtoolspackage:LICENSE.md: The license file.eqtoolsis released under the terms of the GNU General Public License (GPL), version 3.README.md: This readme file.setup.py: Thesetuptoolssetup file. See above for installation instructions.The package contents itself are in theeqtoolsdirectory:__init__.py: Initialization file for the Python package.core.py: Contains the basic classes the package is built with.EFIT.py: Contains abstract classes to access data generated by the EFIT equilibrium reconstruction code.CModEFIT.py: Contains classes to access Alcator C-Mod data.D3DEFIT.py: Contains classes to access DIII-D data.NSTXEFIT.py: Contains classes to access NSTX data.TCVLIUQE.py: Contains classes to access TCV data.FromArrays.py: Contains classes to construct equilibria from arrays of data.trispline.py: Contains Python wrappers for the functions defined in_tricub.pyf._tricub.c: C implementation of tricubic spline interpolation._tricub.pyf: F2PY wrapper for_tricub.c.afilereader.py: Contains classes to read the data from EFIT "a" files.pfilereader.py: Contains classes to read EFIT "p" files.eqdskreader.py: Contains classes to read EFIT eqdsk files.filewriter.py: Contains classes to write EFIT eqdsk files.Test scripts are provided in thetestsdirectory:SolovievEFIT.py: Contains classes to construct analytic Soloviev equilibria with circular flux surfaces.test.py: Compares the analytical solution to the results fromeqtoolsfor Soloviev's solution to the Grad-Shafranov equation with circular flux surfaces.unittests.py: Conducts extensive consistency checks on all of the coordinate mapping routines.demo.py: Contains a very bare-bones demo to make sureeqtoolsis working. For a more detailed tutorial, refer to the documentation athttp://eqtools.readthedocs.org/