Analysis Module
The Analysis module provides post-processing and visualization utilities for GPEC simulation outputs.
Submodules
ForceFreeStates: Plotting functions for DCON-style ideal MHD stability resultsEquilibrium: Plotting functions for equilibrium objects
GeneralizedPerturbedEquilibrium.Analysis — Module
AnalysisPost-processing and visualization utilities for GPEC simulation outputs.
Submodules
ForceFreeStates: Plotting functions for DCON-style ideal MHD stability resultsEquilibrium: Plotting functions for equilibrium objects
ForceFreeStates
GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates — Module
ForceFreeStatesPost-processing and visualization functions for ForceFreeStates (DCON-style ideal MHD stability) results stored in GPEC HDF5 output files.
GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates.plot_eigenmode_summary — Method
plot_eigenmode_summary(h5path; save_path=nothing)Three-panel summary of the free-boundary energy matrix eigenmodes, analogous to the DCON summary plot produced by OMFIT GPEC.
Panels:
- Top: |eigenvector| vs index for the least stable mode
- Bottom-left: heatmap of |W_t| (eigenvectors) vs mode index
- Bottom-right: |eigenvalue| on log scale vs mode index
Eigenvectors are scaled by χ₁ = 2π ψ₀ × 10⁻³ to match GPEC conventions.
Arguments
h5path: Path to a GPEC HDF5 output file with vacuum data (vac_flag = true)
Keyword arguments
save_path: If provided, save the figure to this path (default:nothing)
Returns
A Plots.jl plot object.
GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates.plot_mode_displacement — Method
plot_mode_displacement(h5path; modes=1:5, save_path=nothing)Plot Im(ξψ) vs ψN for the least stable eigenmode, showing one curve per requested poloidal mode number m.
Arguments
h5path: Path to a GPEC HDF5 output file (e.g."gpec.h5")
Keyword arguments
modes: Iterable of m values to plot (default:1:5)save_path: If provided, save the figure to this path (default:nothing)
Returns
A Plots.jl plot object.
GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates.plot_stability_criterion — Method
plot_stability_criterion(h5path; save_path=nothing)Plot the stability criterion (smallest eigenvalue of W⁻¹, crit) vs ψ_N. A sign change in crit during integration indicates an ideal fixed-boundary instability.
Arguments
h5path: Path to a GPEC HDF5 output file
Keyword arguments
save_path: If provided, save the figure to this path (default:nothing)
Returns
A Plots.jl plot object.
Equilibrium
GeneralizedPerturbedEquilibrium.Analysis.Equilibrium — Module
EquilibriumPost-processing and visualization functions for GPEC equilibrium objects.
GeneralizedPerturbedEquilibrium.Analysis.Equilibrium.plot_flux_surfaces — Method
plot_flux_surfaces(plasma_eq; n_psi=11, n_theta=13)Plot flux surface contours (constant ψ, blue) and field-line angle contours (constant θ, red) in physical (R, Z) space.
Arguments
plasma_eq: AGeneralizedPerturbedEquilibrium.Equilibrium.PlasmaEquilibriumobject
Keyword arguments
n_psi: Number of constant-ψ contours to draw (default: 11)n_theta: Number of constant-θ contours to draw (default: 13)
Returns
A Plots.jl plot object.