BZX - Boozer to GKV Coordinate Transformations
BZX is a Python package that transforms BOOZ_XFORM Boozer coordinate metrics into GKV field-aligned coordinates, enabling gyrokinetic analysis of VMEC equilibria.
Installation
To install from PyPI:
pip install bzx
Or install the latest development version from GitHub:
pip install git+https://github.com/GKV-developers/bzx.git
If your environment has any problems with installation, you can copy the single source script file bzx.py from the src/bzx/ directory and use it.
Usage
(i) Basic usage: Convert to GKV input file using BZX
Prepare VMEC equilibrium output (e.g. wout.nc) and its BOOZ_XFORM output (e.g. boozmn.nc).
from bzx import bzx
# Define transformation parameters
Ntheta_gkv = 1 # N_theta value in GKV
nrho = 11 # Radial grid points
ntht = 64 # Poloidal grid points
nzeta = 0 # Toroidal grid points (nzeta=0 corresponds to output GKV field-aligned coordinates)
alpha_fix = 0.0 # Field-line label: alpha = zeta - q*theta (not used for nzeta > 0)
# Run BZX transformation
bzx(Ntheta_gkv, nrho, ntht, nzeta, alpha_fix,
fname_boozmn="boozmn.nc", fname_wout="wout.nc",
output_file="./metric_boozer.bin.dat")
- Reads VMEC output file (
wout.nc) and BOOZ_XFORM output file (boozmn.nc). NetCDF format is recommended, but Binary format is also acceptable. - Converts them into field-aligned data and saves the result as GKV input binary file (
metric_boozer.bin.dat). - Note: some BOOZ_XFORM versions (e.g. the Python package
booz_xform==0.0.9) writephi_b = 0intoboozmn.nc. BZX detects this automatically and recovers the edge toroidal flux from thephivariable ofwout.nc(a NetCDFwoutis required in this case), printing a warning to stdout andlog_BZX.dat.
(ii) Example of workflow: From VMEC to GKV via BOOZ_XFORM and BZX
The script examples/run_vmecpp_boozxform_bzx.ipynb demonstrats how to use BZX, starting from generating an equilibrium.
-
Step 1: Compute a MHD equilibrium using VMEC++
- About VMEC++ :
-
Step 2: Convert the VMEC output to Boozer coordinates using BOOZ_XFORM
- About BOOZ_XFORM :
-
Step 3: Convert the BOOZ_XFORM output to GKV coordinates using BZX
- This project.
(iii) As a command line tool
After installation, you can use BZX directly as a CLI tool in a terminal, e.g.,
python -m bzx --Ntheta_gkv 1 --nrho 11 --ntht 64 \
--nzeta 0 --alpha_fix 0.0 \
--fname_boozmn "boozmn.nc" --fname_wout "wout.nc" \
--output_file "./metric_boozer.bin.dat"
All arguments of bzx function is specified by keyword arguments. See also help.
python -m bzx --help
Dependencies
BZX requires the following Python packages:
numpy,scipy,xarray- (Optional)
matplotlibfor visualization inexamples/ - (Optional)
booz_xformforexamples/run_vmecpp_boozxform_bzx.py - (Optional)
vmecppforexamples/run_vmecpp_boozxform_bzx.py
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Developed by Shinya Maeyama (maeyama.shinya@nifs.ac.jp)
Metadata
Release files for bzx 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bzx-0.1.3.tar.gz | 22.9 kB | With provenance | Details for bzx-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bzx-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for bzx-0.1.3-py3-none-any.whl |
Total release size: 41.7 kB
Release files / bzx-0.1.3.tar.gz
| Download URL | bzx-0.1.3.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54d50666d6f81024c20a5f012ee8729bdfabfbfa6a09ede6e4901a497b54821c
|
|
BLAKE2b-256 checksum How to use checksums |
c424e4f1bd23a08f946926c5a6c27fbf562da45f195fed1977c070fd0e8fc055
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logRelease files / bzx-0.1.3-py3-none-any.whl
| Download URL | bzx-0.1.3-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c54862943b1cc4674a8e92981ee7bd3caa3a475d5e53290cf8c6ec3f268ed695
|
|
BLAKE2b-256 checksum How to use checksums |
dafa9e7b59fd15209060290680f72e2bc2ff1aa1d8a70558bc36659457a1f9e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logSecurity for bzx 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for bzx-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.