Mode analysis
Briareus.legendre — Method
legendre(l, μ)Legendre polynomial Pₗ(μ).
Briareus.legendre_moments — Method
legendre_moments(values, target, elems; lmax = 8, axis = ẑ, center = 0, level = 3) -> VectorLegendre coefficients aₗ (index l+1) of the azimuthally averaged field, aₗ = (2l+1)/(4π) ∫ f Pₗ(cosθ) dΩ, where θ is measured from axis about center and values[e] is indexed by element (taken constant over each element). aₗ/a₀ is the usual "Pₗ/P₀" asymmetry. legendre_weights precomputes the linear operator.
Briareus.legendre_weights — Method
legendre_weights(target, elems; lmax = 8, axis = ẑ, center = 0, level = 3) -> MatrixMatrix W with legendre_moments(values, …) == W * values[elems]: W[l+1, k] = (2l+1)/Ω ∫ Pₗ(cosθ) dΩ over element elems[k], integrated over 4^level sub-triangles per facet with exact solid angles, and Ω the total solid angle of elems (4π for a closed surface around center). Treating the field as constant on each element makes a uniform field have no l > 0 moments, however the facets tile the sphere.
Briareus.mode_amplitude — Method
mode_amplitude(c, l) -> RealRotation-invariant amplitude of degree l relative to the mean, in the normalization of Legendre moments: √((2l+1) Σₘ (c_lm/c_00)²). It equals |aₗ/a₀| for a field axisymmetric about any axis, so for l = 1 it is the fractional amplitude ε of a dipole drive 1 + ε cos γ, the quantity hot-spot velocity sensitivities refer to.
Briareus.mode_index — Method
mode_index(l, m) -> IntPosition of the real spherical harmonic (l, m) in the flat ordering used by ylm_weights: l² + l + m + 1, i.e. (0,0), (1,-1), (1,0), (1,1), (2,-2), ….
Briareus.mode_power — Method
mode_power(C) -> VectorPer-l amplitude √(Σₘ cₗₘ²) / c₀₀ from ylm_moments, a rotation-invariant nonuniformity measure (index l+1). Equals |aₗ/a₀|/√(2l+1) for an axisymmetric field.
Briareus.relative_mode_power — Method
relative_mode_power(c, l) -> RealΣₘ (c_lm / c_00)² from flat coefficients c (mode_index order): the squared rotation-invariant amplitude of degree l relative to the mean. Smooth (no square root), so suited to objectives; mode_power is its square root. For an axisymmetric field it equals (aₗ/a₀)² / (2l+1).
Briareus.rms_nonuniformity — Method
rms_nonuniformity(values, weights) -> RealWeighted RMS deviation over weighted mean.
Briareus.solid_angle — Function
solid_angle(target, e, center) -> Float64Exact solid angle subtended by element e at center (Van Oosterom–Strackee formula summed over its triangles). Mode decompositions use it as the quadrature weight, so the weights of a closed surface around center sum to exactly 4π.
Briareus.ylm_frame — Method
ylm_frame(axis) -> (ẑ, x̂, ŷ)Right-handed frame for spherical harmonics with the polar axis along axis. For the default axis = ẑ this is the chamber frame, so azimuthal mode phases are relative to +x (NIF: the direction of Switchyard 1).
Briareus.ylm_matrix — Method
ylm_matrix(c, lmax) -> MatrixFlat coefficients (mode_index order) as the (lmax+1) × (2lmax+1) matrix C[l+1, lmax+1+m] used by ylm_moments and mode_power (unused entries zero).
Briareus.ylm_moments — Method
ylm_moments(values, target, elems; lmax = 8, axis = ẑ, center = 0, level = 2) -> MatrixCoefficients of real orthonormal spherical harmonics, c[l+1, l+1+m] for -l ≤ m ≤ l (m > 0: cos mφ, m < 0: sin |m|φ), with the polar axis along axis (field constant on each element, harmonics integrated over each facet; see ylm_weights). Use mode_power for rotation-invariant per-l amplitudes.
Briareus.ylm_weights — Method
ylm_weights(target, elems; lmax = 8, axis = ẑ, center = 0, level = 2) -> MatrixMatrix W with W * values[elems] the coefficients of real orthonormal spherical harmonics in the flat mode_index ordering: Y_l0 = P̄_l0, Y_lm ∝ cos mφ for m > 0 and ∝ sin |m|φ for m < 0, without the Condon–Shortley phase, so Y_11 ∝ +x and Y_1,-1 ∝ +y. Each element's field is taken as constant over the element and the harmonics are integrated over its facets with exact sub-triangle solid angles (4^level per triangle); the covered solid angle is normalized to 4π.