spherical

Source: spherical/__init__.py

Evaluating Wigner 𝔇 matrices, spin-weighted spherical harmonics, and related. This module contains code for evaluating the Wigner 3j symbols, the Wigner 𝔇 matrices, scalar spherical harmonics, and spin-weighted spherical harmonics. The implementations are in terms of recursions, which allow the calculations to be very accurate and stable to high indices. Whereas straightforward implementation of the usual formulas for these objects quickly leads to instabilities and overflow at ℓ values as low as 29, this implementation allows accurate computation beyond ℓ values of 1000. The code is wrapped by numba where possible, allowing the results to be delivered at speeds approaching or exceeding speeds attained by pure C code. Two useful classes are also provided to encapsulate functions decomposed in mode weights or by their values on spherical grids.