Skip to main content

Distinctly useful code collection: contains efficient algorithms for Fast Fourier (and related) transforms, spherical harmonic transforms involving very general spherical grids, gridding/degridding tools for radio interferometry, 4pi spherical convolution operators and much more.

Project description

Distinctly Useful Code Collection (DUCC)

This is a collection of basic programming tools for numerical computation, including Fast Fourier Transforms, Spherical Harmonic Transforms, non-equispaced Fourier transforms, as well as some concrete applications like 4pi convolution on the sphere and gridding/degridding of radio interferometry data.

The code is written in C++17, but provides a simple and comprehensive Python interface.

Requirements

  • Python >= 3.7
  • only when compiling from source: pybind11
  • only when compiling from source: a C++17-capable compiler, e.g.
    • g++ 7 or later
    • clang++
    • MSVC 2019 or later
    • Intel icpx (oneAPI compiler series). (Note that the older icpc compilers are not supported.)

Sources

The latest version of DUCC can be obtained by cloning the repository via

git clone https://gitlab.mpcdf.mpg.de/mtr/ducc.git

Documentation

Online documentation of the most recent Python interface is available at https://mtr.pages.mpcdf.de/ducc.

The C++ interface is documented at https://mtr.pages.mpcdf.de/ducc/cpp. Please note that this interface is not as well documented as the Python one, and that it should not be considered stable.

Installation

DUCC can be installed using a simple pip invocation:

pip3 install --user ducc0

In most cases this will download and install a binary wheel. However, the performance of the installed package may not be optimal, since the wheel has to work on all CPUs of a given architecture (e.g. x86_64) and will therefore probably not use all features present in your local CPU.

It is therefore recommended to install from source if possible, using the command

pip3 install --no-binary ducc0 --user ducc0

NOTE: compilation can take a significant amount of time (several minutes).

Installing multiple versions simultaneously

The interfaces of the DUCC components are expected to evolve over time; whenever an interface changes in a manner that is not backwards compatible, the DUCC version number will increase. As a consequence it might happen that one part of a Python code may use an older version of DUCC while at the same time another part requires a newer version. Since DUCC's version number is included in the module name itself (the module is not called ducc, but rather ducc<X>), this is not a problem, as multiple DUCC versions can be installed simultaneously. The latest patch levels of a given DUCC version will always be available at the HEAD of the git branch with the respective name. In other words, if you need the latest incarnation of DUCC 0, this will be on branch "ducc0" of the git repository, and it will be installed as the package "ducc0". Later versions will be maintained on new branches and will be installed as "ducc1" and "ducc2", so that there will be no conflict with potentially installed older versions.

DUCC components

ducc.fft

This package provides Fast Fourier, trigonometric and Hartley transforms with a simple Python interface. It is an evolution of pocketfft and pypocketfft which are currently used by numpy and scipy.

The central algorithms are derived from Paul Swarztrauber's FFTPACK code.

Features

  • supports fully complex and half-complex (i.e. complex-to-real and real-to-complex) FFTs, discrete sine/cosine transforms and Hartley transforms
  • achieves very high accuracy for all transforms
  • supports multidimensional arrays and selection of the axes to be transformed
  • supports single, double, and long double precision
  • makes use of CPU vector instructions when performing 2D and higher-dimensional transforms
  • supports prime-length transforms without degrading to O(N**2) performance
  • has optional multi-threading support for multidimensional transforms

Design decisions and performance characteristics

  • there is no internal caching of plans and twiddle factors, making the interface as simple as possible
  • 1D transforms are significantly slower than those provided by FFTW (if FFTW's plan generation overhead is ignored)
  • multi-D transforms in double precision perform fairly similar to FFTW with FFTW_MEASURE; in single precision ducc.fft can be significantly faster.

ducc.sht

This package provides efficient spherical harmonic trasforms (SHTs). Its code is derived from libsharp, but has been significantly enhanced.

Noteworthy features

  • support for any grid based on iso-latitude rings with equidistant pixels in each of the rings
  • support for accurate spherical harmonic analyis on certain sub-classes of grids (Clenshaw-Curtis, Fejer-1 and McEwen-Wiaux) at band limits beyond those for which quadrature weights exist. For details see this note.
  • substantially improved transformation speed (up to a factor of 2) on the above mentioned grid geometries for high band limits
  • accelerated recurrences as presented in Ishioka (2018)
  • vector instruction support
  • multi-threading support

The code for rotating spherical harmonic coefficients was taken (with some modifications) from Mikael Slevinsky's FastTransforms package.

ducc.healpix

This library provides Python bindings for the most important functionality related to the HEALPix tesselation, except for spherical harmonic transforms, which are covered by ducc.sht.

The design goals are

  • similarity to the interface of the HEALPix C++ library (while respecting some Python peculiarities)
  • simplicity (no optional function parameters)
  • low function calling overhead

ducc.totalconvolve

Library for high-accuracy 4pi convolution on the sphere, which generates a total convolution data cube from a set of sky and beam a_lm and computes interpolated values for a given list of detector pointings. This code has evolved from the original totalconvolver algorithm via the conviqt code.

Algorithmic details:

  • the code uses ducc.sht SHTs and ducc.fft FFTs to compute the data cube
  • shared-memory parallelization is provided via standard C++ threads.
  • for interpolation, the algorithm and kernel described in https://arxiv.org/abs/1808.06736 are used. This allows very efficient interpolation with user-adjustable accuracy.

ducc.wgridder

Library for high-accuracy gridding/degridding of radio interferometry datasets (code paper available at https://arxiv.org/abs/2010.10122). This code has also been integrated into wsclean (https://arxiv.org/abs/1407.1943) as the wgridder component.

Programming aspects

  • shared-memory parallelization via standard C++ threads.
  • kernel computation is performed on the fly, avoiding inaccuracies due to table lookup and reducing overall memory bandwidth

Numerical aspects

  • uses the analytical gridding kernel presented in https://arxiv.org/abs/1808.06736
  • uses the "improved W-stacking method" described in https://arxiv.org/abs/2101.11172
  • in combination these two aspects allow extremely accurate gridding/degridding operations (L2 error compared to explicit DFTs can go below 1e-12) with reasonable resource consumption

ducc.misc

Various unsorted functionality which will hopefully be categorized in the future.

This module contains an efficient algorithm for the computation of abscissas and weights for Gauss-Legendre quadrature. For degrees up to 100, the solutions are computed in the standard iterative fashion; for higher degrees Ignace Bogaert's FastGL algorithm is used.

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

ducc0-0.20.0.tar.gz (207.3 kB view details)

Uploaded Source

Built Distributions

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

ducc0-0.20.0-pp37-pypy37_pp73-win_amd64.whl (783.0 kB view details)

Uploaded PyPyWindows x86-64

ducc0-0.20.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

ducc0-0.20.0-pp37-pypy37_pp73-macosx_10_14_x86_64.whl (1.4 MB view details)

Uploaded PyPymacOS 10.14+ x86-64

ducc0-0.20.0-cp310-cp310-win_amd64.whl (783.8 kB view details)

Uploaded CPython 3.10Windows x86-64

ducc0-0.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ducc0-0.20.0-cp310-cp310-macosx_10_14_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

ducc0-0.20.0-cp39-cp39-win_amd64.whl (778.2 kB view details)

Uploaded CPython 3.9Windows x86-64

ducc0-0.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ducc0-0.20.0-cp39-cp39-macosx_10_14_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

ducc0-0.20.0-cp38-cp38-win_amd64.whl (783.8 kB view details)

Uploaded CPython 3.8Windows x86-64

ducc0-0.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

ducc0-0.20.0-cp38-cp38-macosx_10_14_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

ducc0-0.20.0-cp37-cp37m-win_amd64.whl (780.5 kB view details)

Uploaded CPython 3.7mWindows x86-64

ducc0-0.20.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

ducc0-0.20.0-cp37-cp37m-macosx_10_14_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

Details for the file ducc0-0.20.0.tar.gz.

File metadata

  • Download URL: ducc0-0.20.0.tar.gz
  • Upload date:
  • Size: 207.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0.tar.gz
Algorithm Hash digest
SHA256 97ce2380b044f85022924beb989316ac0474459c4dcca3c8ea9f99a2eaf67107
MD5 06e2ac06e7dd5b83c395b3a7875739d6
BLAKE2b-256 7a218177f0f48c7ac5542237cdcce6d8eb6a9c50ec2d53de0ad8404e48469c3d

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-pp37-pypy37_pp73-win_amd64.whl.

File metadata

  • Download URL: ducc0-0.20.0-pp37-pypy37_pp73-win_amd64.whl
  • Upload date:
  • Size: 783.0 kB
  • Tags: PyPy, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 cf61a0b7e676d12e00c03de58c6468eae3ec20968e075b138e12ea35c34c2d8b
MD5 f8e32f1535e2acf34eeca548399eb3e3
BLAKE2b-256 41dbc82ec599cbd9118261386248a0b2ce94ca60a312fa2b8377d0f28d77d170

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.20.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 32a8bb6d76de390f2037654fa598d1e9c39d92d4a9eb52082c0f694894206e2a
MD5 86018cd822362e68fc26a20c14784363
BLAKE2b-256 84566f12b4f09f8204c0421650a30ed34459fa813bfa1c8882325f6986a5739f

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-pp37-pypy37_pp73-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: ducc0-0.20.0-pp37-pypy37_pp73-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: PyPy, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-pp37-pypy37_pp73-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e34bfd37ca6bca813dd28fe66e04aa42f582786865e4c043ef6c60040c9047ea
MD5 adaa7126810c4cb7375e231bd3a115d1
BLAKE2b-256 80de8249d75f4fe87112e5322ed6d9f9ece27cb43022f0fde7dba6e4eb23db82

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 783.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5078ba4bedf9e3633d2cd64909c1bcfa605452611e8d8a73058c269e734adfdb
MD5 6f65b6092eed4373c5407df1d7becb1f
BLAKE2b-256 b403c86cd8e36d970232e9740e751bfbc6569dc90de905e557cbd6b204784d8a

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e09d0d9a4953800f0ee59a290986101f9138c9a4bd9f0f6f86f036bc1581945c
MD5 04c2bbe878249393cdb0158ff47fff81
BLAKE2b-256 a5072308f4d184b1ddf66e28f6a434d102ba136fd4096adeb1f1023c488eb07a

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp310-cp310-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.10, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 960b65c957b67d472e23ea2bf49fb132b81b88e79bae71353ce49d32ef4eec66
MD5 8eb9d86a2b38bd2677f76821fdec6ca6
BLAKE2b-256 df1910bd024745a6f06eea7f620aac52fdcf4764a1db50cf8d7f5921e4565384

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 778.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d856738e47c0c6e6a256fd15c31eb49c58410a3e1a2b75690d8407fbf679a6cf
MD5 cee1f9d0aeb1e8b2c2901ee97ee1d669
BLAKE2b-256 749a748e66ccb4b4479f1515cfc69db02d01c116382c0946654333bff5d5f391

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d0e3e6f3a06b39d756d96a248a97441ef692513331f8885577f10264148bd5b
MD5 8e1bb9c043f2327229ee3258d3689176
BLAKE2b-256 140e51de74c2ae7f1f4f24031eba149b00be97488b745d8f1a3f683d9ed5f436

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5f96b5ebf36ef15ad6041d273433e42e21295a56a47ea2088d3ef40ee1e40ecf
MD5 8cda98d61c5b4522a2767ff771318974
BLAKE2b-256 e89154ee7be5d30130adaf22bfc095355cf529c3f3936e5754150cb211c09e08

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 783.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 5f938d0ea958b7f95e8e05d0f559d3529b048dc5c05d0b3943b111ad7e90940e
MD5 379d63921196b107e28317900177ba1d
BLAKE2b-256 df43daa8c0ba2208f13db40c60d14a6dc848d59d7944726017a00049bcb81fee

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36637e171af8d1af4f5da1822207273260e5a288286f38e6b1eac5973e2f9a2d
MD5 812b00f324797b3bac38769c843eef9e
BLAKE2b-256 2a9b72d975f7768e8f2b0d33af5fdf990d722b91d4f83ff902a111f3bc5ff62b

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8e0bd882e930d36bec914facdd05e03829c12d3a4f606c8eb041972a88c8aacd
MD5 8895de1bc6a8058502795f9c86294196
BLAKE2b-256 f033d52d27602b50d080c8d34239ba765e6196184aa5b13bde65a87d358cf815

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 780.5 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d1e252c34b4e139a5582230956b1425f19057d71b5762d7384aa52c6aff5e748
MD5 f49d797cab7b4e8315b2129f03386889
BLAKE2b-256 192194ba4c98ceb471cf3e8154c7b4d20f074865cfdec57c26fe554495ebde36

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.20.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b829fccb690765347bdade0c6957a39738935b1866069ff61a85c8204fec5f59
MD5 aedf82e582f2956a9d113311aa140920
BLAKE2b-256 5db9dabb6d6831faaf4fc51b5393f658e35532c289ba258b2e574b23da068874

See more details on using hashes here.

File details

Details for the file ducc0-0.20.0-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: ducc0-0.20.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.20.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a6bac3cdfb15645bf9d1993fb03a9297e3e12a456050cac97af367adb9fc2ac9
MD5 1c0bb9db6e0a469b0515713d3429a483
BLAKE2b-256 3f8a756220ca6bfc87001c8e2ca95785abcc31b94f495faf1a83a4a9120627ca

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