GEQDSK Viewer
A VS Code extension for visualizing tokamak equilibrium data stored in .geqdsk (G-EQDSK / g-file) files.
Features
- Right-click Context Menu: Plot or save any file as GEQDSK via right-click menu (works with any file extension)
- Plot or Save: Choose to display in a matplotlib window (X11) or save as PNG file
- CLI Command: Use
geqdsk-viewer <file> [mode] from the terminal
- Equilibrium Visualization: Displays magnetic flux surfaces, plasma boundary, and key equilibrium parameters
- X-point Coordinates: Shows upper and lower X-point locations in the information panel
- Auto-install Dependencies: Automatically prompts to install required Python packages if missing
Requirements
- Python 3 with the following packages (auto-installed if missing):
The extension will automatically prompt you to install missing packages on first use.
Usage
VS Code (GUI)
- Right-click on any GEQDSK file (any extension) in the Explorer or Editor
- Select one of the following from the context menu:
- "GEQDSK Viewer: Plot(no save)" - Opens a matplotlib window via X11 (requires display)
- "GEQDSK Viewer: Save" - Saves as
<filename>.png in the same directory (works on remote/SSH)
- View the equilibrium plot
Use the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and search for "GEQDSK Viewer".
Terminal (CLI)
Install the CLI alias via Command Palette → "GEQDSK Viewer: Install 'geqdsk-viewer' command", then:
# Plot (opens X11 window)
geqdsk-viewer g123456.01000
# Explicitly specify plot mode
geqdsk-viewer g123456.01000 plot
# Save as PNG instead of displaying
geqdsk-viewer g123456.01000 save
Tip: Use save mode when working over SSH/Remote, as matplotlib windows require a display.
What is GEQDSK (G-EQDSK)?
GEQDSK (G-EQDSK, also known as "g-file") is a standard file format widely used in fusion plasma physics for storing MHD (magnetohydrodynamic) equilibrium data from tokamak devices. It contains:
- Plasma boundary shape
- Magnetic flux function (ψ)
- Pressure profile
- Safety factor (q) profile
- Toroidal current profile
- And other equilibrium parameters
For detailed file format specification, refer to the G-EQDSK documentation.
Credits
Known Issues
- Requires Python to be available in the system PATH
- Large GEQDSK files may take longer to process
Release Notes
0.0.7
- Simplified to single-file operation
- Right-click menu renamed: "Plot(no save)" and "Save"
- CHEASE-related code removed for lighter packaging
- Performance optimization (vectorized numpy operations)
- Proper attribution for original eqdsk.py author
0.0.4
- Added right-click context menu "GEQDSK Viewer: Plot geqdsk"
- Support for any file extension (not just .geqdsk)
- X-point coordinates displayed in the plot
- Plot opens in matplotlib window instead of saving PNG file
0.0.3
- Updated documentation with G-EQDSK specification link
- Added credits for PLARE Lab (SNU) and 3DST Lab
0.0.2
- Improved error handling
- Added progress notification
0.0.1
- Initial release
- Basic GEQDSK file viewing support
License
MIT
Enjoy visualizing your fusion equilibrium data!