SHtools - Spherical Harmonics Toolbox

Toolbox for manipulating and plotting vectors of spherical harmonic coefficients
4.5K Downloads
Updated 13 Jun 2007

View License

This small and basic set of routines has resulted from my need to create and manipulate real spherical harmonic coefficients in the context of geomagnetic applications. These coefficients are saved as vectors, since vector manipulation in Matlab is well-developed. The toolbox supports accessing a coefficient that corresponds to specific degree l and order m (where negative m corresponds to sin(m*phi) and positive m corresponds to cos(m*phi) terms); mapping the vector to a matrix and back; mapping to a grid using Schmidt semi-normalized spherical harmonics, and basic plotting.

Vectors consisting of several 'sections' of independent sets of coefficients are also to some degree supported (in my case they correspond to parametrization of different layers of the Earth).

Also contains a set of functions to integrate it with the publicly available DOTM library by F. J. Simons. In order to use SHRotateVec (rotation of spherical harmonic coefficients) please also install his library
http://geoweb.princeton.edu/people/simons/software.html

Name inspired by Fortran SHTOOLS software http://www.ipgp.jussieu.fr/~wieczor/SHTOOLS/SHTOOLS.html

Cite As

Anna Kelbert (2024). SHtools - Spherical Harmonics Toolbox (https://www.mathworks.com/matlabcentral/fileexchange/15279-shtools-spherical-harmonics-toolbox), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0