John Walk

Projects

Fusion Primer

Photography

Publications

Pluralsight Tech Blog

Medium

Github

LinkedIn

eqtools Python package

John Walk

July 2015

The basic computational tasks associated with magnetic-equilibrium reconstructions in tokamaks, namely

  • the handling of derived quantities, e.g., calculated plasma current, safety factor profile
  • flux mapping between real-space machine geometry and different plasma coordinate systems for experimental data

are universal among tokamak fusion experiments. Despite this, experiments typically utilize locally-developed solutions designed for the particulars of that experiment's data storage and usage.

These tasks are base-level for nearly any analysis workflow in a tokamak - but the ad-hoc development in existing toolkits inhibits the mobility of higher-level codes (which use data based on magnetic reconstructions) to other devices (as the code may require substantial rewrites or modification to address the particulars of the new data storage design). Moreover, reconstruction codes are often developed with a quite static design, such that the code implementation is difficult to extend to new data formats (e.g., to handle both the primary MDSplus tree-based data system and the eqdsk storage files produced directly by the EFIT reconstruction), necessitating parallel workflows for functionally identical tasks depending on the data source.

The new eqtools Python package provides a modular, extensible, open-source toolkit for handling magnetic-equilibrium reconstructions. We've designed eqtools to provide a consistent, straightforward, human-readable to the researcher for both coordinate-mapping routines (historically handled in separate standalone routines) and access to derived quantities (often handled with manual hooks into data storage). The eqtools package is constructed with a modular, object-oriented design, such that the package is easily extensible to handle data from different experiments, reconstruction codes, and storage methods, providing a single unified interface for data from any machine or code.

The implementation of basic data-handling tasks in Python removes a serious roadblock to the adoption of Python as a day-to-day analysis and scripting language for fusion research, which offers numerous advantages in ease of use, computational speed, user/developer base, and free/open-source implementations compared to current common working languages for fusion research (IDL and Matlab in particular).

The eqtools package is distributed on PyPI, version controlled through GitHub, and documented at Read the Docs.