A Python example using NumPy and SHTns that performs backward and forward Spherical Harmonic Transforms.
29 sh = shtns.sht(lmax, mmax)
32 nlat, nphi = sh.set_grid()
33 print(sh.nlat, sh.nphi)
49 ylm[sh.idx(1,0)] = 1.0
62 print(y[i_theta, i_phi])
69 dy_dt, dy_dp = sh.synth_grad(ylm)