Examples¶
All example scripts are in the examples/ directory of the repository.
Run them from the project root:
python examples/example_balmer_lineprofile.py
Balmer series — LineProfile class¶
Script: examples/example_balmer_lineprofile.py
Computes Hα through Hε at DIII-D edge conditions (B = 12 T,
\(N_e = 10^{20}\) m-3, \(T_e = 5\) eV) using the
LineProfile class. Each panel shows:
Transverse (90°) and parallel (0°) broadened profiles
Discrete stick spectrum at zero microfield (\(F = 0\))
The wavelength window is set by converting ±1 nm around each line center to an energy grid.
Hα stick spectrum and broadened profile¶
Script: examples/example_halpha.py
Side-by-side comparison of the discrete transition stick spectrum (compute_discrete)
and the static Stark-Zeeman broadened profile at B = 5 T, 100 T, and 1000 T,
showing the transition from the Paschen-Back regime to the strong-field limit.
Transition anatomy¶
Script: examples/example_transitions.py
Explores the discrete transitions of Ly-α (n=2→1) and Hβ (n=4→2) as a function of B, grouping transitions by polarization and plotting their positions and strengths as a function of microfield \(F_z\).
Reproducing Figure 1 from Ferri et al. (2022)¶
Script: examples/reproduce_fig1.py
Reproduces the full Balmer series profiles (Hα–Hε) weighted by Case B
Balmer decrements, at B = 1000 T, \(N_e = 10^{23}\) m-3,
\(T_e = 5\) eV. Demonstrates convergence with respect to num_f
and num_mu.
Satellite features at B = 1000 T¶
Script: examples/diag_halpha_satellites.py
Searches for the \(\pm 2\mu_B B\) Stark-Zeeman satellite features in Hα at B = 1000 T. Shows that:
Hβ (n=4→2): the satellite is a resolved peak at ~2 % of the main σ+ intensity because \(n=4\) has degenerate \(|4d, m_l{=}2\rangle\) and \(|4f, m_l{=}2\rangle\) states that amplify Stark mixing.
Hα (n=3→2): no resolved peak appears — the satellite amplitude (~0.07 %) is buried in the Lorentzian tail.
Script: examples/diag_satellite_comparison.py
Direct Hα vs. Hβ comparison over a ±200 meV window, showing both the \(\pm\mu_B B\) main peaks and the \(\pm 2\mu_B B\) satellite positions.
Quadratic Zeeman polarization wings¶
Script: examples/reproduce_halpha_wings.py
Demonstrates the polarization-wing effect at B = 500 T and B = 1000 T:
at high field the quadratic Zeeman term shifts the 3p(\(m_l = \pm 1\))
→ 2s transitions away from the main Hα cluster, creating distinct “wings”
that only appear in quadratic_zeeman=True profiles.
Lyman-α at high B¶
Scripts: examples/test_lyman_alpha.py,
examples/test_lyman_alpha_500T.py,
examples/test_lyman_alpha_1000T.py
Lyman-α (n=2→1) for C VI (Z=6) at 100 T, 500 T, and 1000 T, exploring the transition from the intermediate-field to the Paschen-Back regime.