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.

  • Implements spectral gravity forward modelling of band-limited topographic masses with an arbitrary integration radius and 3D density. [1]

  • Evaluates integrals of 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.

  • For spectral gravity forward modelling with spatially limited integration radius, MPFR is used to enable arbitrary precision arithmetic on floating point numbers.

  • 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, MPFR, GMP and OpenMP libraries) 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, --enable-mpfr, 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.7-pp310-pypy310_pp73-win_amd64.whl (1.5 MB view details)

Uploaded PyPyWindows x86-64

pyharm-0.4.7-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

pyharm-0.4.7-pp310-pypy310_pp73-macosx_11_0_x86_64.whl (2.1 MB view details)

Uploaded PyPymacOS 11.0+ x86-64

pyharm-0.4.7-pp310-pypy310_pp73-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

pyharm-0.4.7-cp313-cp313-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.13Windows x86-64

pyharm-0.4.7-cp313-cp313-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pyharm-0.4.7-cp313-cp313-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyharm-0.4.7-cp313-cp313-macosx_11_0_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyharm-0.4.7-cp313-cp313-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyharm-0.4.7-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

pyharm-0.4.7-cp312-cp312-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pyharm-0.4.7-cp312-cp312-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyharm-0.4.7-cp312-cp312-macosx_11_0_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyharm-0.4.7-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyharm-0.4.7-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

pyharm-0.4.7-cp311-cp311-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pyharm-0.4.7-cp311-cp311-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyharm-0.4.7-cp311-cp311-macosx_11_0_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyharm-0.4.7-cp311-cp311-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyharm-0.4.7-cp310-cp310-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10Windows x86-64

pyharm-0.4.7-cp310-cp310-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pyharm-0.4.7-cp310-cp310-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pyharm-0.4.7-cp310-cp310-macosx_11_0_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

pyharm-0.4.7-cp310-cp310-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 d28ec3ebdc71e7a617da886db7219832fcc2243efc84fae2f6dd9f1e364f246b
MD5 d106f0f795c129084c3a94719a07e8a5
BLAKE2b-256 2003eed241a46e58c90a2177497c079af7576820ff55a809df685ab098e2a2b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 64c76c8079bc83cf6c91687e9c77dab7711af2154e645c817cf4085b18d118f6
MD5 a5c357a8e8d3cf3a9e4cd3c2fac4b643
BLAKE2b-256 054fd2871bf9a5d00933759d699b1d30d14363fb583fdbeb9c4d653fe77d1fe7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-pp310-pypy310_pp73-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b6f302b6e60c0aee91bb0d6d7067bc0dc3d47cc4e0d5a4853b80d5e4dc9d33ef
MD5 7af32ea2a9501e25e8aede6bb5a76a49
BLAKE2b-256 1d390fccbef3f1885a84b29e944028289cb72e54ef89e00c64d8b8f7df0fd774

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 041b47a51005369c8caec0c25b1aac61798fed31d64719963be54396b4874bec
MD5 8775b2f742ca0c7df6de8812ffa2a618
BLAKE2b-256 226e401695a6774dcccec47efcac394ae90bb84e50ac0b4e9d9acf7d82164322

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyharm-0.4.7-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2ffb2b4414b790bbabe97023ad69c07fde8164162441eaedff7924795b2059da
MD5 48e80b881b97fc153cbe546f926ffe38
BLAKE2b-256 ed231e4ce18d6231fe03e4902a4eb9f914d9ea32ed78943326c53af73e86ba0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 362fdbafbc73a867fed8a9a9579113e20ea1b0d7f86a870be8ccb917a11e29cd
MD5 28c2eef4c0c7dcf2f1eec6a7d598a253
BLAKE2b-256 59a474a3a739afc24d797555cb94ed9eb8915e6c9a8d90a825528597664fdd18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a79b5e38b4b843acae0e802fbd98466b80f08c53df03b5fe9fd6ad23ce6332bf
MD5 b5dfb6f8e11c9c3cb8ae316016315944
BLAKE2b-256 7150bc836480f577d5c5a9fd7308f8fbe2ca867e0be959f58330ed6e05320a1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e94dfca53ba04b1c6aa2e93ed9a50fe60ec92922d12623dd3a56aa48bd379cca
MD5 732647ffce65f601427eb2c7030afd07
BLAKE2b-256 b068e0e39074e30c6ffe6dd60a4572a3740640c11cb04a505349760ef39a0f5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dfb406c5541c328bdae407986a3c22258b169c70cfb3981758d63ffe747aa859
MD5 253847bf28e0f36a4d2329cc86b90011
BLAKE2b-256 e14f0ef327924c14c102a68e5f0c2a2507b57620351c8a2c2ad6e3e5c75fdf2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyharm-0.4.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1e89ca33b1c1fead8438c4c02930b7ef280c719839f861b995c179d483c0f659
MD5 1a4b359c827fa3b2d67ffd41323e569e
BLAKE2b-256 46a3bd04a31bae620347778341086d21d8b24dda91bfe494d969a7a6b737587a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e53e0e185dfda5e030efca785cd6146b892d8efe8819f3da4421475718ba7ba2
MD5 050e7ee73fcfaca7eaa3fce2cfdf7bfe
BLAKE2b-256 8e1af668b0021b47988f275881d7edf5c8982bb6240e272532ecfd8b6454a119

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d1b44a00e7f16e7adfe8553c5fdfa91e02b956e0e94dcf18932c41b9720b251c
MD5 543790482082b1217b8917feb5ab20f4
BLAKE2b-256 7d2d2955c11a685837359b9927e3d1dfbf913538d4127e085fc60858a98b437a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 56b81d7b5d606841741b84b7ed40ca246512fd6d63b5475cead9ae6c80b9040b
MD5 bbc5adceded3db74b9018e578912419c
BLAKE2b-256 7733ed33773c3010183c5ac1ed62c5535fac41c51580ad5df4bffa788c9199cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7d9cecd6ef87e5d75698168f7adef9b5e20e5df22f8b533dd8cf82c958bce81
MD5 59654a483c3746772c5e0ca4014f94e3
BLAKE2b-256 155604d5f94e82e989720a154d7a16fcf74cd91c6e189b5cffebbcada33daf2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyharm-0.4.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 294e1b70e70fbb87a36eb15993cf86a63abbcce6bae22c484d8d43f401af62f3
MD5 63dbe78ce47ff6928d46e6f5f5b92b0a
BLAKE2b-256 ae44d4639e181d33bf08fece7b964b938ea3a30751a63570cb0e27771bc64c00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f03dc5ce7074eeb491c7730266b5952f8942395fcbd34b9b5a6c3d48c73c3ef6
MD5 eebdd6c8f6f7813610641232f5280d69
BLAKE2b-256 d1a2f6653fd0828e66b6e84c67432ab8a03ad8c932d8dbe598025202b18fb3ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 93587909ccd1f19e5a305280d578eb8875c384422ab123b98a731955308c858a
MD5 f20ac5adbae8aa189fabfbc6dcb6b852
BLAKE2b-256 94415df0654502c5fb3c822017c62cd8ea30f66aed25a8076b3db868994840fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6777b7752e4478324066a6edfac4d3fe67d705b9dbbe14e8f814af476c40e185
MD5 af2b80959d8f5916d5618030c8917db5
BLAKE2b-256 06c8fdf54bc754883b2879da524124b4fdeba4342d1f93054225807ffe995c7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53e59e673b17b70d525c51c38e9a91bc29e4e57ae8abedba74109eddaa990587
MD5 fd1da4a742dee01afe95d5c056d7df0c
BLAKE2b-256 9e2643aaf27a32af0fbc5bbabd4c5d6948653799d318a871a5db7d11150f0406

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyharm-0.4.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pyharm-0.4.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b9d6cd5910974a8c2c9a60cd48089010e679ca7f30a0923687d9fd0029609fe1
MD5 5c45547af997c9054b164e2fb27f0dd7
BLAKE2b-256 05f7599c13c177b4943ab92691bbc216fde99f8c4e4ed36a9d4c953b60db6a29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 48c7bafb28ae9d1c90fd27d799fac749b7790178c244d598b75b3cfe044767e3
MD5 4505b9e3505b1419b7767ac4e20daafa
BLAKE2b-256 6c27664bd00d6bf6e8216f9b57478b94c296ee57aa566fa6fb265188f67db2ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 49eb47df602a43853ba40b896ffee263237db726ead520767f2f0acc4c28bd6a
MD5 0570f97ae25f214e2379785ea8e15a7e
BLAKE2b-256 ec3aada2a9195853a1322c1082440c146d6113c4abbfbbe66b8928f11423b882

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 39370ff0126cd317bd180c839128511eee697fc5d792c91f8a5362dbc9ba47c4
MD5 4d5686508c7378ee2d8b9b144b8575a7
BLAKE2b-256 644b23971bdf56edbd7cce650c067a256a45214b7aaa9300c50113d6b134840f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyharm-0.4.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cefbd0776a3c53ca934c3f94053ec91a4afd77c47d0e208072f18ce7da5020e7
MD5 351b2615df40f7f7595b59ea72de0203
BLAKE2b-256 2d7accd04920d1860137ba3f5452dc68f4f600e46e2ab71efe72a92b40eef044

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