bfieldtools.sphtools.SphBasis

class bfieldtools.sphtools.SphBasis(Np)

Constructs an object that describes unit sphere. Can be used to compute inner products and function sph spectra on the sphere.

TODO: mu0 might be missing!!!

Initialises the sphbasis object.

Parameters
Np: int

Mumber of points along theta and phi in spherical coordinates

Returns
self: sphbasis object
initqp(self)

Initialises quadrature points on the sphere.

Default points are McLaren(10) so that we avoid singularities.

innerproduct(self, fun1, fun2)

Inner product of vector functions fun1 and fun2. Defined as integration over a surface of unit sphere <C,D> = int C dot D dOmega. Quadrature rule defined in qp is used.

Parameters
fun1: Nx3 array

vector function 1

fun2: Nx3 array

vector function 2

Returns
dotp: int

inner product of fun1 and fun2

avsphspectra(self, fun, lmax)

Calculate the l,m-spectra (over r**l-terms) of vector function defined in quadrature points using the inner product.

Parameters
fun: Nx3 array

vector function computed at quadrature points self.sqp

lmax: int

maximum degree l for which the spectra is computed

Returns
coeffs: lmax*(lmax+2)x1 arrays

spectral coefficients

bvsphspectra(self, fun, lmax)

Calculate the l,m-spectra (over r**(-l)-terms) of vector function defined in quadrature points using the inner product.

Parameters
fun: Nx3 array

vector function computed at quadrature points self.sqp

lmax: int

maximum degree l for which the spectra is computed

Returns
coeffs: lmax*(lmax+2)x1 arrays

spectral coefficients