This module provides routines for performing spherical harmonic expansions and the construction of grids from spherical harmonic coefficients.

Equally sampled (N×N) and equally spaced (N×2N) grids

Function name Description
SHExpandDH Expand an equally sampled or equally spaced map into spherical harmonics using Driscoll and Healy’s (1994) sampling theorem.
MakeGridDH Create a 2D map from a set of spherical harmonic coefficients that conforms with Driscoll and Healy’s (1994) sampling theorem.
SHExpandDHC Expand an equally sampled or equally spaced complex map into complex spherical harmonics using Driscoll and Healy’s (1994) sampling theorem.
MakeGridDHC Create a 2D complex map from a set of complex spherical harmonic coefficients that conforms with Driscoll and Healy’s (1994) sampling theorem.
MakeGradientDH Compute the gradient of a scalar function and return grids of the two horizontal components that conform with Driscoll and Healy’s (1994) sampling theorem.

Gauss-Legendre quadrature grids

Function name Description
SHGLQ Precompute the weights and nodes used in the GLQ-based spherical harmonics routines.
SHExpandGLQ Expand a 2D map sampled on the Gauss-Legendre quadrature nodes into spherical harmonics.
MakeGridGLQ Create a 2D map from a set of spherical harmonic coefficients sampled on a the Gauss-Legendre quadrature nodes.
SHExpandGLQC Expand a 2D complex map sampled on the Gauss-Legendre quadrature nodes into complex spherical harmonics.
MakeGridGLQC Create a 2D complex map from a set of complex spherical harmonic coefficients sampled on a the Gauss-Legendre quadrature nodes.
GLQGridCoord Compute the latitude and longitude coordinates used in Gauss-Legendre quadrature grids.

Least squares inversion

Function name Description
shlsq Determine the spherical harmonic coefficients of an irregularly sampled function using a (weighted) least squares inversion, optionally with a precomputed data kernel matrix.
SHExpandLSQ Determine the spherical harmonic coefficients of an irregularly sampled function using a least squares inversion.
SHExpandLSQ_G Determine the spherical harmonic coefficients of an irregularly sampled function using a least squares inversion with a precomputed data kernel matrix.
SHExpandWLSQ Determine the spherical harmonic coefficients of an irregularly sampled function using a weighted least squares inversion.
SHExpandWLSQ_G Determine the spherical harmonic coefficients of an irregularly sampled function using a weighted least squares inversion with a precomputed data kernel matrix.
LSQ_G Compute the data kernel matrix G that is used when computing spherical harmonic coefficients by least squares inversion.

Other routines

Function name Description
MakeGrid2D Create a 2D cylindrical map with arbitrary grid spacing from a set of spherical harmonic coefficients.
MakeGridPoint Evaluate a real function expressed in real spherical harmonics at a set of points.
MakeGridPointC Evaluate a complex function expressed in complex spherical harmonics at a set of points.
SHMultiply Multiply two functions and determine the spherical harmonic coefficients of the resulting function.
spharm Compute all the spherical harmonic functions up to a maximum degree and order.
spharm_lm Compute the spherical harmonic function for specific degrees l and orders m.
Edit me