Skip to main content

SHTOOLS - Spherical Harmonic Tools

Project description

Documentation DOI Paper Join the chat at https://gitter.im/SHTOOLS/SHTOOLS Twitter

SHTOOLS/pysthools is a Fortran-95/Python library that can be used to perform spherical harmonic transforms, multitaper spectral analyses on the sphere, expansions of functions into Slepian bases, and standard operations on global gravitational and magnetic field data.

FEATURES

  • 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.

  • 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,

    • OpenMP compatible and OpenMP thread-safe.

  • Selected applications and routines:

    • global spectral analysis, spherical harmonic rotations, and Wigner 3j symbols,

    • localized multitaper spectral analyses, and expansions in Slepian basis functions,

    • standard gravity and magnetic field calculations, computation of the geoid, and finite-amplitude potential from topography.

  • Integrated support for working with xarray and netcdf data.

  • Publication quality maps using Cartopy or pygmt.

  • SHTOOLS is open source software (3-clause BSD license).

INSTALLATION

pyshtools for Python

Binary install for linux and macOS:

pip install pyshtools
pip install --upgrade pyshtools  # upgrade to a new version

Build from source:

pip install pyshtools --no-binary pyshtools

pyshtools for developers

Linux requirements:

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

macOS requirements:

brew install fftw
# for lapack and blas, link to the system '-framework Accelerate'

To install the develop branch:

pip install git+https://github.com/SHTOOLS/SHTOOLS@develop

Alternatively, clone the shtools repo and then install:

git clone https://github.com/SHTOOLS/SHTOOLS.git
cd shtools
git checkout develop
pip install .  # install into the active python environment lib folder, or
pip install -e .  # install into the SHTOOLS/pyshtools folder and link 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  # for 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.

HOW TO USE

SHTOOLS can be invoked in any Fortran 95 or Python program. The core software is written in Fortran 95, and Python wrappers allow simple access to the fortran-compiled routines. A variety of Python notebooks and example files are included that demonstrate the major features of the library.

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

DEVELOPERS

We work on the develop branch and only push releases to master. Please base all pull requests on develop.

CITATION

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

Project details


Download files

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

Source Distribution

pyshtools-4.6.tar.gz (57.5 MB view details)

Uploaded Source

File details

Details for the file pyshtools-4.6.tar.gz.

File metadata

  • Download URL: pyshtools-4.6.tar.gz
  • Upload date:
  • Size: 57.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.6

File hashes

Hashes for pyshtools-4.6.tar.gz
Algorithm Hash digest
SHA256 c82230c4aeb4d517d55b30a98d3aeb64aabc9c33383c578c262c660efb8c6332
MD5 2e42f7a7c88d59e46fdf90c9f498c4f3
BLAKE2b-256 5cad8c0b5138c3cfd86d2b6641ec0fe7dd0802b7b47427beccc765fc5a0afd0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page