Skip to main content

SHTOOLS - Spherical Harmonic Tools

Project description

SHTOOLS LOGO Documentation DOI Paper Binder Chat on matrix Chat at gitter License Mastodon Follow

SHTOOLS/pyshtools is a Fortran-95/Python library that can be used for spherical harmonic transforms, multitaper spectral analyses, expansions of gridded data into Slepian basis functions, standard operations on global gravitational and magnetic field data.

TABLE OF CONTENTS

FEATURES

  • Supports all standard normalizations and phase conventions of the spherical harmonic functions.

  • Effortless conversion between real and complex harmonics, and between different normalization and phase conventions.

  • Use of both regularly sampled geographic grids and grids appropriate for Gauss-Legendre quadrature.

  • Spherical harmonic transforms proven to be accurate up to about degree 2800 for the native Fortran 95 backend and beyond using the DUCC0 backend.

  • Perform localized multitaper spectral analyses, or expand gridded data in terms of localized Slepian basis functions.

  • Support for standard data and file formats, including xarray and netcdf.

  • Import research-grade gravity, topography, and magnetic field datasets with a single command.

  • Creation of publication quality maps using Cartopy and PyGMT.

  • Support multithreaded programming using the OpenMP API.

HOW TO USE

A variety of Python tutorials and guides are available to explain the main library features. To get started, click on the following Python tutorials and run them interactively in Binder:

INSTALLATION

SHTOOLS can be invoked in any Fortran 95 or Python program. The core software is written in Fortran 95, and Python wrappers and dedicated classes allow simple access to the fortran-compiled routines. To install it, run these commands below:

pyshtools (for Python)

Install using conda:
conda install -c conda-forge pyshtools
conda update -c conda-forge pyshtools  # to upgrade a pre-existing installation
Install using pip:
pip install pyshtools
pip install --upgrade pyshtools  # to upgrade a pre-existing installation
pip install pyshtools --no-binary pyshtools  # build from source
pip install git+https://github.com/SHTOOLS/SHTOOLS@develop  # install the develop branch from source
For developers:

Install the system level build requirements:

sudo apt-get install build-essential cmake gfortran  # Debian, Ubuntu and derivatives
sudo dnf group install "C Development Tools and Libraries" "Development Tools"  # Fedora, Centos, RHEL and derivatives
sudo dnf install cmake gcc-fortran  # Fedora, Centos, RHEL and derivatives
xcode-select --install  # macOS

Then clone the shtools repo, install the other dependencies, and install manually in a conda environment:

git clone https://github.com/SHTOOLS/SHTOOLS.git
cd shtools
conda create -n your_env_name python=3.xx  # create a new conda environment, if desired
conda env update -n your_env_name -f environment.yml
conda activate your_env_name  # activate the new conda environment
pip install --no-build-isolation -e .  # install into the shtools folder and link to the active python environment

SHTOOLS (for Fortran 95)

Install using the brew package manager (MacOS, Linux, Windows):
brew install shtools
Install using the macports package manager (MacOS):
sudo port install shtools
Install from source:

Clone or download the this repo, and then execute one (or both) of the following commands in the shtools directory:

make fortran
make fortran-mp  # for OpenMP Fortran routines

Further installation instructions and options can be found in the web documentation.

CONTRIBUTING

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

CONTRIBUTORS

For the full list of contributors, see the AUTHORS file.

LICENSE

This project uses the BSD 3-Clause license, as found in the LICENSE file.

REFERENCES

  • Mark A. Wieczorek and Matthias Meschede (2018). SHTools --- Tools for working with spherical harmonics, Geochemistry, Geophysics, Geosystems, 19, 2574-2592, doi:10.1029/2018GC007529.
  • Mark Wieczorek, et al. (2019). SHTOOLS/SHTOOLS. Zenodo, doi:10.5281/zenodo.3457861

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.12.2.tar.gz (41.6 MB view details)

Uploaded Source

Built Distributions

pyshtools-4.12.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.2-cp312-cp312-macosx_12_0_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12 macOS 12.0+ x86-64

pyshtools-4.12.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.2-cp311-cp311-macosx_12_0_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

pyshtools-4.12.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.2-cp310-cp310-macosx_12_0_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

pyshtools-4.12.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.2-cp39-cp39-macosx_10_16_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9 macOS 10.16+ x86-64

File details

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

File metadata

  • Download URL: pyshtools-4.12.2.tar.gz
  • Upload date:
  • Size: 41.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyshtools-4.12.2.tar.gz
Algorithm Hash digest
SHA256 966f1a1b99af0e87d8e3ceed116d320cda12a3c93771336804cd6b206698d79a
MD5 de12a56e324ffc0d40ebe63a500f5d3b
BLAKE2b-256 09c5b2763ff607de60d8293e0da17f9de9c4037f49b1102d958bf55342d14765

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4299d7f6857d0245215b5f0250ccf1691bc66030d099768c6793774c897f27b
MD5 e8ce618fb9d966876582976ae8cc743c
BLAKE2b-256 cb669c8b2768c8ea4b7afe93f8544c0a5938c9195d69a997693f98e78e465169

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp312-cp312-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 a552b172dfa0d5438de514c9866ba004d197907bf998b1fab2c368cabc0738f5
MD5 e751eddaf81f6a714565528681e47e2b
BLAKE2b-256 ad020f511462fb5abb6dbcc3afb95572b2fb889e4f054d0ba094ae63bbd239a7

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2cfc23214fb584b9a887c56f656840e53388b84b5c8581334b3c1e7ff5cb7d14
MD5 6c06e96114e43d57f5a1f800f561b3e0
BLAKE2b-256 25834be6d6a767f292cdb1e7fb6666abf811f777cb2e767fdc42268a0bbb3fe2

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 d3c2a3cf4eded9f8ffa4af27cda0d7b8d837d823eceeaf777011db168e73a46f
MD5 efff2784b2c56d843408563ef18c4d4f
BLAKE2b-256 e457c8bf5be5de76f8f3cb62b4a633a5ba4d11460c4f4a472e2fec2f09ca3c39

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e8a579ca7a97be77d0f80b9a8a9e372c5be31c7249cf51fbf448f33e561f47d
MD5 6a7b3103e9e06c2c20e17d9ba7b34d5f
BLAKE2b-256 f211107d37533b719e97453225b32ccffa2d37d0e9fceee7d8fce779d423c96e

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 8f6a0409af53a1ee1f984c5f282cda0988faa44e0c38385ee4004555c1cef2f7
MD5 967ee87f52805d1d6c170f7f50561aec
BLAKE2b-256 c6fb950406e45be1e3e2f0dfb755a40a913b15de71d64e8a2d2b452e8a836b41

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf4bfcfb7feb6414ec2c8a876bdc40aac54e69e48b6bec86721cc381caeacd3f
MD5 8edac89ec79c67c752520d5a8e6deade
BLAKE2b-256 57875b6dc206e363a33b0395250d7b32d593e08b10199ab17e079952c7d9cef3

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.2-cp39-cp39-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.2-cp39-cp39-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 27254a7f95f74b9f53eedd2de651afab0fdea4aee57330256f5ba0a03af94b43
MD5 2ff1cb1795926cb3c15dc88dec15a919
BLAKE2b-256 5f0d9ce54e401f542b25ed7d80e6f7c86ad3238c9448ee65bdad401bfda293ef

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