Skip to main content

SHTOOLS - Tools for working with spherical harmonics

Project description



Documentation DOI Paper Join the chat at Twitter

SHTOOLS/pysthools is a Fortran-95/Python library that can be used to perform spherical harmonic transforms and reconstructions, rotations of data expressed in spherical harmonics, and multitaper spectral analyses on the sphere.


  • A wide range of supported spherical harmonic functions:
    • real and complex,
    • all standard normalizations (Geodesy 4π, Schmidt semi-normalized, orthonormalized, unnormalized),
    • Condon-Shortley phase factor of (-1)m.
  • Selected applications and routines:
    • global spectral analysis, spherical harmonic rotations, Wigner 3j symbols,
    • localized multitaper spectral analyses, optimal window generation, spherical harmonic coupling matrices,
    • standard gravity and magnetic field calculations, computation of the geoid, finite-amplitude potential from topography.
  • Clean implementation of the spherical harmonic transforms:
    • exact quadrature rules using the sampling theorem of Driscoll and Healy (1994) or Gauss-Legendre quadrature,
    • accurate and fast to approximately degree 2800 (spatial resolution higher than 4 arc minutes),
    • Fortran 95 routines are OpenMP compatible and OpenMP thread-safe.


pyshtools for Python

Binary install for linux/macOS/windows:

pip install pyshtools

Build from source:

pip install pyshtools --no-binary pyshtools

pyshtools for Anaconda Python

Install fftw3 with fortran bindings and then install pyshtools using pip:

conda install -c eumetsat fftw3
pip install pyshtools

pyshtools for Python (developer install)

Linux requirements:

sudo apt-get install libblas-dev liblapack-dev g++ gfortran libfftw3-dev tcsh

macOS requirements:

brew install fftw --with-fortran

To install the develop branch use:

pip install git+

Alternatively, clone the shtools repo

git clone

and then execute one of the following commands in the shtools directory:

pip install .  # installs into the active python environment lib folder
pip install -v -e .  # installs into the SHTOOLS/pyshtools folder and links to the active python environment

Fortran Library

Clone the shtools repo, and then execute one of the following commands in the shtools directory:

make fortran
make fortran-mp  # OpenMP Fortran routines

Or use the brew package manager (macOS):

brew tap shtools/shtools
brew install shtools
brew install shtools --with-openmp # to install shtools with the OpenMP components.

More installation instructions and options can be found in the web documentation and GitHub wiki.


SHTOOLS can be invoked from Fortran 95, Python 2 or Python 3. The base SHTOOLS software is written in Fortran 95, and the Python library allows simple access to all fortran-compiled routines and offers helper routines as well as simple interfaces.

To get started, check out the following Python tutorial notebooks:


SHTOOLS is open source (revised BSD license) and makes use of the freely available Fourier transform package FFTW and the linear algebra packages LAPACK and BLAS.


Mark A. Wieczorek and Matthias Meschede (2018). SHTools — Tools for working with spherical harmonics, Geochemistry, Geophysics, Geosystems, doi:10.1029/2018GC007529.

M. A. Wieczorek, M. Meschede, E. Sales de Andrade, I. Oshchepkov, B. Xu, and A. Walker (2018). SHTOOLS, Zenodo, doi:10.5281/zenodo.592762.

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyshtools-4.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.8 MB) Copy SHA256 hash SHA256 Wheel cp27 May 21, 2018
pyshtools-4.2-cp27-cp27m-manylinux1_x86_64.whl (10.6 MB) Copy SHA256 hash SHA256 Wheel cp27 May 22, 2018
pyshtools-4.2-cp27-cp27mu-manylinux1_x86_64.whl (10.6 MB) Copy SHA256 hash SHA256 Wheel cp27 May 22, 2018
pyshtools-4.2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.8 MB) Copy SHA256 hash SHA256 Wheel cp34 May 21, 2018
pyshtools-4.2-cp34-cp34m-manylinux1_x86_64.whl (10.7 MB) Copy SHA256 hash SHA256 Wheel cp34 May 22, 2018
pyshtools-4.2-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.8 MB) Copy SHA256 hash SHA256 Wheel cp35 May 21, 2018
pyshtools-4.2-cp35-cp35m-manylinux1_x86_64.whl (10.6 MB) Copy SHA256 hash SHA256 Wheel cp35 May 22, 2018
pyshtools-4.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.8 MB) Copy SHA256 hash SHA256 Wheel cp36 May 21, 2018
pyshtools-4.2-cp36-cp36m-manylinux1_x86_64.whl (10.6 MB) Copy SHA256 hash SHA256 Wheel cp36 May 22, 2018
pyshtools-4.2.tar.gz (7.9 MB) Copy SHA256 hash SHA256 Source None May 20, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page