Transform a function to a spherical Haar wavelet and spherical harmonic basis where each coefficient is given by
This package uses FastSphericalHarmonics.jl to compute the spherical harmonic transform and inverse.
One can transform a function by calling
Fp = sph_haar_transform(f, nmax, ellmax, umax; method=:twopt)where f = f([r,θ,φ]) is the function to transform, nmax = 2^L-1 where L is the number of generations in the Haar transform, ellmax is the maximum ell for the spherical harmonic transform, and umax is the maximum value of u to consider (since the Haar transform is on a closed interval). To perform the inverse,
F = sph_haar_inverse(Fp)One can also precompute the function on a grid,
us, θs, φs = sph_haar_points(nmax,ellmax,umax)
F = evaluate_f(f, us, θs, φs)
Fp = sph_haar_transform(F)To access a specific (n,ell,m) coefficient use
Fp[sph_haar_index(n,ell,m)]