Skip to main content

Dash and VS Code tooling for inspecting VMEC wout NetCDF equilibria

Project description

VMECdash

An interactive Dash application for exploring VMEC wout_*.nc stellarator equilibria.
It reconstructs magnetic surfaces with JAX, renders 1‑D/2‑D/3‑D plots and so on, motivated by the original MATLAB tool VMECplot.m.

Motivation: Quickly inspect the VMEC equilibrium quantities of interest without relying on difficult-for-starter-to-compile programs (such as libstell) or memory-heavy commercial software (such as MATLAB).

VMECdash Screenshot


Features

  • File upload for standard VMEC wout NetCDF output.
  • Summary dashboard with key scalar diagnostics and highlighted metadata (free/fixed boundary, mgrid file, etc.).
  • 1‑D profiles for rotational transform, safety factor, pressure, volume derivative, beta metrics, and more.
  • 2‑D visualisations:
    • R‑Z cross sections with geometry or interpolated scalar fields.
    • θ‑ζ flux-surface contours across a field period.
  • 3‑D flux surfaces with optional coordinate‑free background shading.
  • Field lines viewer for $\alpha-\zeta$ coordinates on selected flux
    • A nice choice for visualising magnetic ripple
    • 2D plots of $|B|(\alpha, \zeta)$
    • 1D plots of single period field line traces with different initial $\alpha$ values
    • Single field line transistions.
  • JAX acceleration for geometry reconstruction.

Requirements

Python 3.10+ is recommended. Install dependencies with conda:(optional)

conda activate your_env_name
pip install -r requirements.txt

Note for JAX: If you don't have a GPU/TPU or your gpu is not supported for FP64(like metal), then simply running pip install jax[cpu] to install the CPU-only version is good enough. GPU/TPU wheels require platform-specific instructions from the JAX documentation.


Running the App

python VMECdash.py

Dash defaults to http://127.0.0.1:8050/. The layout is responsive, so you can resize the browser to focus on plots or the control sidebar.

The packaged entry point is also available after installation:

pip install -e ".[dash]"
vmecdash serve

VS Code Native Preview

VMECdash now includes the first native VS Code integration surface:

  • a Dash-free Python backend at python -m vmecdash.vscode_backend --stdio;
  • a workspace VS Code extension under extension/;
  • a Custom Readonly Editor for wout*.nc files;
  • a Webview UI that renders backend Plotly figures with bundled plotly.min.js.

For local development, install the Python package in the interpreter VS Code should use:

pip install -e .

Then open extension/ as a VS Code extension development project or package it as a VSIX. In Remote-SSH, install vmecdash in the remote Python environment and set vmecdash.pythonPath if VS Code does not pick the desired interpreter.


Usage Tips

  1. Upload a VMEC NetCDF file (wout_*.nc) via the drag‑and‑drop area in the sidebar.
  2. Use Visualization Mode to switch between:
    • Summary Dashboard (shows statistics + multi-panel plots),
    • 1D Profiles, 2D Cross Sections, 2D Flux Surfaces, and 3D Geometry.
  3. Adjust sliders for toroidal angle (phi), flux surface index (s), and choose different physical quantities from the dropdowns.
  4. Toggle Coordinate-free background in 3‑D mode for clean screenshots.
  5. Click Download Plot to export the currently visible figure as a PNG.

The app caches equilibrium metadata, so switching modes or variables is fast.
For heavy 2‑D physics overlays, a pre-computation step runs on the server while keeping the UI responsive.


Repository Layout

Path Description
VMECdash.py Main Dash entry point (layout + callbacks).
vmec_jax.py JAX-powered data processor for VMEC equilibria.
views/ Modular UI components (overview, profiles, 2D/3D, fieldlines).
ui/ Shared UI helper components.
requirements.txt Python dependencies.
example/wout_PO.nc Example VMEC equilibrium (use your own files for new cases).

TroubleShooting

Feel free to open issues or pull requests to add new physical quantities, UI tweaks, or performance optimisations. Enjoy exploring your VMEC equilibria!

Next step

  • Add jax-based boozer coordinate transformation.
  • Fast evaulation of EffetiveRipple, GammaC, maybe slow without gpu.

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

vmecdash-0.1.0.tar.gz (705.7 kB view details)

Uploaded Source

Built Distribution

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

vmecdash-0.1.0-py3-none-any.whl (703.5 kB view details)

Uploaded Python 3

File details

Details for the file vmecdash-0.1.0.tar.gz.

File metadata

  • Download URL: vmecdash-0.1.0.tar.gz
  • Upload date:
  • Size: 705.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for vmecdash-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f666f6eaf566c1f732c7fd4c0096bdee307a29ea0304d648ba7b33e7592a1722
MD5 2079213cb99918f1073bd08e14ac3ff7
BLAKE2b-256 937109b00b4e6dd2258ed6392221e71f38a9b34875dd53d50aab4e3a4f466e2b

See more details on using hashes here.

File details

Details for the file vmecdash-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vmecdash-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 703.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for vmecdash-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 870836e6cdc11ca278aab834c4ae0006e5d19e094b35f8fb2f3c1641f8988ffe
MD5 cd861f2656e71d01f841682bf7d0b0e6
BLAKE2b-256 c4221674c9073729cbfb381b7359dda3ad2cb7fdde5a43c239ae90c522077f3c

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