chaotic_pfc.analysis.sweep_plotting_3d¶
sweep_plotting_3d.py¶
Plotly-based 3-D visualisation of a stack of Kaiser β-sweeps.
Aggregates a directory of per-β .npz checkpoints (produced by
chaotic-pfc run sweep beta-sweep) into a single 3-D volume
λ_max(N_z, ω_c, β) and renders it as an interactive surface stack.
Plotly is an optional dependency declared under the viz3d extra:
install with pip install -e .[viz3d]. Importing this module without
Plotly installed will raise an actionable ImportError.
Functions
|
Load every per-β sweep under |
|
Render a stack of λ_max surfaces, one per β. |
- chaotic_pfc.analysis.sweep_plotting_3d.aggregate_beta_sweeps(data_dir)[source]¶
Load every per-β sweep under
data_dirinto a single volume.- Parameters:
data_dir (str | Path) – Root directory containing one sub-directory per β, each with a
variables_lyapunov.npzfile (matches the layout produced byrun sweep beta-sweep).- Returns:
h_volume (ndarray, shape (Nbeta, Ncoef, Ncut)) – λ_max indexed by (β, order, cutoff).
betas (ndarray, shape (Nbeta,)) – β values, sorted ascending.
orders (ndarray)
cutoffs (ndarray)
- Return type:
tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]]
Notes
Sweeps with incompatible grids (e.g. bandstop vs lowpass, which use different order ranges) are grouped separately. The function returns the largest group and logs a warning when sweeps are skipped.
- chaotic_pfc.analysis.sweep_plotting_3d.plot_3d_beta_volume(h_volume, betas, orders, cutoffs, save_path=None)[source]¶
Render a stack of λ_max surfaces, one per β.
Each β contributes a 2-D heat-coloured surface placed at altitude
z = βover the (N_z, ω_c) plane. The user can rotate, zoom and pick the slice they want in the browser.- Parameters:
h_volume (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Output of
aggregate_beta_sweeps(), shape(Nbeta, Ncoef, Ncut).betas (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Coordinate arrays.
orders (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Coordinate arrays.
cutoffs (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Coordinate arrays.
save_path (str | Path | None) – Optional
.htmlpath. If given, the figure is also written to disk viawrite_html.
- Return type:
plotly.graph_objects.Figure