sw_periodic_to_pw

Function sw_periodic_to_pw 

Source
pub fn sw_periodic_to_pw(
    mode: Mode,
    vector: [Complex; 3],
    pol: u8,
    area: f64,
    helicity: bool,
) -> Result<Complex>
Expand description

Amplitude of the plane wave vector that the spherical multipole mode of a 2D array with unit-cell area radiates. The sign of kz (of its imaginary part for a complex kz) picks the side.

Upstream: treams.sw.periodic_to_pw. Differences: treams replaces kz = 0 by 1e-20 (1 + i). Here kz is recomputed as sqrt(k^2 - kx^2 - ky^2). When that is exactly zero, the call gives an error. When rounding leaves a tiny kz, the amplitude is large, about 1 / kz.