Skip to main content

Python wrapper for CHarm, a C library to work with spherical harmonics up to almost arbitrarily high degrees

Project description

CHarm is a C library to work with spherical harmonics up to almost arbitrarily high degrees. The library is accompanied by a Python wrapper called PyHarm.

Features

  • Supports real-valued fully-normalized surface and solid spherical harmonics (the geodetic norm).

  • Performs FFT-based surface spherical harmonic analysis and solid spherical harmonic synthesis with minimized memory requirements.

  • Stable up to high degrees and orders (tens of thousands and beyond).

  • Available in single, double and quadruple precision.

  • Supports point and mean data values (both analysis and synthesis).

  • Supports synthesis at grids and at scattered points/cells. Grid-wise computations are done by FFT whenever possible. If FFT cannot be applied, the less efficient Chebyshev recurrences are used along the latitude parallels instead.

  • Computes the full first- and second-order gradients at evaluation points (e.g., the gravitational vector and the gravitational tensor).

  • Supports the Gauss–Legendre and Driscoll–Healy quadratures.

  • Integrates solid spherical harmonic expansions (e.g., of the gravitational potential) on band-limited irregular surfaces (e.g., on the Earth’s surface). [1]

  • Computes Fourier coefficients of fully-normalized associated Legendre functions of the first kind up to ultra-high harmonic degrees.

  • Supports SIMD parallelization on the level of a single CPU core (SSE4.1, AVX, AVX2, AVX-512 and NEON).

  • Supports OpenMP parallelization for shared-memory architectures.

  • Supports MPI parallelization for shared- and distributed-memory architectures.

  • Performs discrete FFT by FFTW.

  • Ships with a Python wrapper to enable high-level programming while retaining the efficiency of the C language. The wrapper, called PyHarm, wraps CHarm using ctypes and is fully integrated with numpy.

Installation

  • PyHarm (Python wrapper): On Linux (x86_64), macOS (x86_64, ARM64) and Windows (x86_64), install PyHarm using pip:

    pip install pyharm

    This will install PyHarm together will all the dependencies. These include a pre-compiled CHarm library, which is internally called by PyHarm, some other C libraries (FFTW and OpenMP library) and the Python package NumPy.

  • CHarm (C library): If you are interested in the C API, you have to build CHarm from source. This step is not required if you plan to use the Python interface only.

Further installation details at https://www.charmlib.org/build/html/install.html.

Source code

GitHub: https://github.com/blazej-bucha/charm

Documentation

The documentation of the latest version from the master branch is available at https://www.charmlib.org.

A pre-compiled HTML documentation is also available in docs/build/html. Alternatively, it can be built by executing make html after the configure call (requires --enable-python, --enable-mpi, doxygen and Python modules sphinx, sphinx_book_theme and breathe). Other formats of the documentation, for instance, a PDF file, can be built with cd docs && make latexpdf, etc. To list all available formats, execute cd docs && make help.

Contact

Should you have any comments, questions, bug report or criticism, please feel free to contact the author, Blažej Bucha, at blazej.bucha@stuba.sk. Further products developed by the author can be found at https://www.blazejbucha.com.

Pronunciation

We prefer to pronounce CHarm and PyHarm like the words see harm and pie harm. But it is indeed quite charming to pronounce CHarm like the word charm, especially when the library works like a charm.

Other spherical-harmonic-based libraries

Many other libraries for working with spherical harmonics are available, each having its pros and cons. Explore! A few examples are:

  • SHTOOLS: Fortran95 library with Python API,

  • SHTns: a C library for spherical harmonic transforms,

  • ISPACK: a Fortran library for spherical harmonic transforms,

  • Libsharp: a C99 library for spherical harmonic transforms,

  • healpy: a Python package to handle pixelated data on the sphere building on the HEALPix C++ library,

  • HARMONIC_SYNTH: a Fortran code for spherical harmonic synthesis written by the EGM2008 development team.

  • SPHEREPACK: a Fortran library of spherical harmonic transforms,

  • SHAVEL: a program for the spherical harmonic analysis of a horizontal vector field sampled in an equiangular grid on a sphere

  • ICGEM: Online calculation service for working with Earth and celestial gravitational models,

  • FaVeST: Fast Vector Spherical Harmonic Transforms in MATLAB.

  • SHBundle: Spherical harmonic analysis and synthesis in MATLAB up to high degrees and orders,

  • Spherical Harmonics Manipulator: Spherical harmonic synthesis in sparse points and grids (no longer maintained),

  • GrafLab and isGrafLab: MATLAB-based software packages for spherical harmonic synthesis of gravity field functionals up to high degrees and orders (tens of thousands and well beyond).

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyharm-0.4.4-pp310-pypy310_pp73-win_amd64.whl (968.7 kB view details)

Uploaded PyPyWindows x86-64

pyharm-0.4.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

pyharm-0.4.4-pp310-pypy310_pp73-macosx_11_0_x86_64.whl (1.5 MB view details)

Uploaded PyPymacOS 11.0+ x86-64

pyharm-0.4.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

pyharm-0.4.4-cp313-cp313-win_amd64.whl (949.3 kB view details)

Uploaded CPython 3.13Windows x86-64

pyharm-0.4.4-cp313-cp313-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pyharm-0.4.4-cp313-cp313-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyharm-0.4.4-cp313-cp313-macosx_11_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyharm-0.4.4-cp313-cp313-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyharm-0.4.4-cp312-cp312-win_amd64.whl (949.3 kB view details)

Uploaded CPython 3.12Windows x86-64

pyharm-0.4.4-cp312-cp312-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pyharm-0.4.4-cp312-cp312-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyharm-0.4.4-cp312-cp312-macosx_11_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyharm-0.4.4-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyharm-0.4.4-cp311-cp311-win_amd64.whl (949.3 kB view details)

Uploaded CPython 3.11Windows x86-64

pyharm-0.4.4-cp311-cp311-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pyharm-0.4.4-cp311-cp311-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyharm-0.4.4-cp311-cp311-macosx_11_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyharm-0.4.4-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyharm-0.4.4-cp310-cp310-win_amd64.whl (949.3 kB view details)

Uploaded CPython 3.10Windows x86-64

pyharm-0.4.4-cp310-cp310-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pyharm-0.4.4-cp310-cp310-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pyharm-0.4.4-cp310-cp310-macosx_11_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

pyharm-0.4.4-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file pyharm-0.4.4-pp310-pypy310_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 47aa51bbe7d506a46a59b06e92eb7d83970ccb8d14bb99f6561d98b901e6fd01
MD5 52d4861dddecb50dd9d20adcadc60b73
BLAKE2b-256 74d1b96b6df34087c0155adfcdbdc5841f0cb8c18e047900e7e0b86c6867cea6

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 31ce86e7f1f6f2aecdc20d3fe1a5bf9d2332e79f1619400014d0205616748ce7
MD5 08dfca9538797420a40b74c0ad3f0f1f
BLAKE2b-256 ea9fbe7a20df801a95f16f0b51d03277493543d5083bc642b125fc82faf934c7

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-pp310-pypy310_pp73-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-pp310-pypy310_pp73-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7133331529f747f6b661774c97cec24df2cc4f18fc4f6a2a163aee34170f3dfd
MD5 6d9814fb0c58e62b226fba32e8c0672c
BLAKE2b-256 43e11c952a4adc5496ebaac2270f2b6f75bdb3f50f75fc4f92ce6183e5147516

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55ce661bc62867b7f1a31262ff2b994c2965921d8d91c4e021ca43a5f2237a2b
MD5 8e29410f826eb05a3a1fddd69379566d
BLAKE2b-256 10470eadb4f0bf0822dc402c9453ae88e182aab008e0a7fe90c4c699cca773f6

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyharm-0.4.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 949.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f38049454a831d189807dd243d1d897cc6d0866712d540e991df68fb572c5578
MD5 2835852b0ef9f4f616846503e5b1789a
BLAKE2b-256 04f2450c07975f5fd54119281a2460bc0d581c9a006b4678cb63f43a26a39856

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 52c3f69b79cff5072665c40a3fa974f59a54eec8d54eb78513996e25a6b24277
MD5 0df58279b8cd51a1e79facf8646db4c8
BLAKE2b-256 afc37314738a00a4d7c262169152fe7a5f2cee84bcc7e4421b598840f35de13c

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f723f1061f93b6a71db6345e909579ed23879367fd42a9ca07ed8587696d61c7
MD5 77cf042e1f6f47f07005a24a20df29a9
BLAKE2b-256 7f2932cbda4aa78eda63c395b656ce3aaa96c43d9373888c90a836c3c960b027

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp313-cp313-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 824956039ae409cc0862aff230394cf9ac89cc0599aff0083d5c79d667554430
MD5 f8256f37c8f9a458ef299b1b49f9fd3c
BLAKE2b-256 7d3045f9cfa8ee52435010ed7a9c842535d0474553c5e12dfaeafb29c41d3aef

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc25e53cb192550ebfc6f30e15bd830582ed279762c7ca1fec79445cd5641584
MD5 d5813de251ead41cf81a2bfc5f8f1611
BLAKE2b-256 adf0396868f4f9ec0318f44b43c88acfde1742cced26a0bad6f055447ebd8783

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyharm-0.4.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 949.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cc8f7aad4a2b047cbdad3ff9694c37e2c5e669a386181b5f0ab79ede480c8160
MD5 80e031a93ef58fdf320655cca9b8a0c2
BLAKE2b-256 7c16876d6d2f4564cb7380cf72b0656170e234d06a6e475acb9b8a92bd908380

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b283aa42edea1bf9fbd9e8dc2f62e9d6c54ab3e22b47a7527da5ab0c8e2a1951
MD5 1eda46e0563957223ae9c993d27b1f2d
BLAKE2b-256 567080c749bd949b34dc6f3567e5d05b22ebd7f778fbc1eb4c3735d35f892d6f

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 42a239b9f28b4232670bd0961526ac6af79b65d12f940391b1460e87a5c3f518
MD5 5442cdfaaadd447dd1cd57257a70156e
BLAKE2b-256 6da9d8041afeadfad78cfe7d7d8d46cfca3e02bf21047daccc0da2e750885bfd

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9788ce7cf01f17d117b7c957f196fd7ef97519e8e3943b78134ffa4bcfe840fa
MD5 36dcc6385de81f4cff10984ef82d5aae
BLAKE2b-256 770685bf740cb27d2634e532efdf49a8c14cca282f3a08e3afdcabf117d684c4

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a76cf3a03e160b4f5248df1ff6213fa2355d15afa57942b7475291790a8154c
MD5 78d97c600aac552e8ccfec6260e92d50
BLAKE2b-256 7ef86731b3afbbf072e5d9214df2cc38c744dbbd4d2d7de1b2e2258f8bdae2d9

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyharm-0.4.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 949.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e9097b062834415dcdbbc9ee5527846881e83a0583a0306ef44a64fe496dc41b
MD5 5607359ce73f127ba7d4ba0141fb7dd8
BLAKE2b-256 1aa667218b937bc7df006ff479cc6e91a9e99fe52e094e8586324337acf01930

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 96ed1bc4341c3348564aec9f3d8096021d135458e02a813f13953f547316ffe5
MD5 d04e775bbb0e6d03905e291b1e1a53aa
BLAKE2b-256 d988c15af199f1e9e7fc117221704d0e5a621e596c88d1c24335d8a903d76c4b

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b443a493ecff55f6a65a5cbfdd32df03100561ee5f8266ba41292376e5058c5a
MD5 b1dee2e118c24503424ea0215b1bf6d5
BLAKE2b-256 eca386c93f8ca515f22ab2d0c13b17b2c8824ac0c29504087446784db7535b04

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fc15abcc9a4834248001b9cf60f9214c06db424b5c261a24998b71a2209171de
MD5 99bfeb0dea066b0bbd9b3b122b92255c
BLAKE2b-256 01cc06c4c2bc3e810260c2535b86764a9d1021ea216ec7037afe41135aedd101

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d7c9fde8a1fb6f92ba3895abafe1a9bab8909fb5fbc8d8079a6483424b46047b
MD5 ec8ee6a4bd794308f830acec60e08590
BLAKE2b-256 9d2449ba884b47e937df3baa4f07a46e517cf7119c6ff9204150141a2fbee807

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyharm-0.4.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 949.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c360e26fcf497c0c980b890de05955e9daeab9490f41005d9a65b9e27aa39ec1
MD5 5a5fcd6edb30eed65ea8484de2b5ce02
BLAKE2b-256 b55c012dfa2b40a4b306d8e5cd998fadfde7bd7f059ab59b6c2e921c7572b4b1

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a37a43372d1ef3ea2c9d443f9ab7dcdf7d76e40e2a96fdb9b2e9eba4cf812203
MD5 7b081e2ff401f4a0cf72bce19062d4ed
BLAKE2b-256 5286d179ba9a41e28785a8ed3ba5fdddd3fb16d4a2008639012ce10985bbdf9a

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 221eb35f92edcf8dff6db5abf059dcd7fcac49957bcceb61f2b45d1301329bc4
MD5 3a01b2ba62c69996883063c002024402
BLAKE2b-256 6f7ccf34296a9dad7092ac20fc8749783660abcb1b70b2727aeefc9e103fcc59

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 bf6e3568f250f26ea4c2f50c03f173adb45b83df597ac53eb5b11816bc5371c9
MD5 332880eb9ce69d60925c310029505446
BLAKE2b-256 2b370a3ec7e346a5ae088e52a55ba05343395d1057b72b221b9832396da87042

See more details on using hashes here.

File details

Details for the file pyharm-0.4.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyharm-0.4.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2cc7b1db643f38dd3ff187382db108b26ffb5ae89d965a49b210796f06bd2509
MD5 21d2cc337cd9384d60f47550f6f96406
BLAKE2b-256 32cb8427a1d712556027ea6d48df31b4c57d4e9c78f5211aa382df9ff35b0b0a

See more details on using hashes here.

Supported by

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