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

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 is 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.19.0.tar.gz (205.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.19.0-pp37-pypy37_pp73-win_amd64.whl (838.6 kB view details)

Uploaded PyPyWindows x86-64

ducc0-0.19.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

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

Uploaded PyPymacOS 10.14+ x86-64

ducc0-0.19.0-cp310-cp310-win_amd64.whl (840.0 kB view details)

Uploaded CPython 3.10Windows x86-64

ducc0-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 10.14+ x86-64

ducc0-0.19.0-cp39-cp39-win_amd64.whl (849.4 kB view details)

Uploaded CPython 3.9Windows x86-64

ducc0-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9macOS 10.14+ x86-64

ducc0-0.19.0-cp38-cp38-win_amd64.whl (839.7 kB view details)

Uploaded CPython 3.8Windows x86-64

ducc0-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8macOS 10.14+ x86-64

ducc0-0.19.0-cp37-cp37m-win_amd64.whl (839.4 kB view details)

Uploaded CPython 3.7mWindows x86-64

ducc0-0.19.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

ducc0-0.19.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.19.0.tar.gz.

File metadata

  • Download URL: ducc0-0.19.0.tar.gz
  • Upload date:
  • Size: 205.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0.tar.gz
Algorithm Hash digest
SHA256 e25b54b7372d688772b6c45682f592537458254f3434d8fff9e501d3092398b8
MD5 5459bd3ed5572df3a59372329a6ede10
BLAKE2b-256 c32f9d06265d608a63fc04975482212e7cab6bcbe519bcaa3a741e9ce5562568

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ducc0-0.19.0-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 1c40ab9920409df2d9e00db2653febcfa275c4611345afa6fdb6830c1892a0c8
MD5 e79a0a1cb4e2468e0ec1b13dd4275d31
BLAKE2b-256 a50dae704b65c502edbe9462fe0df97ac5240874f97bbbe7c611a4bc31399adc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.19.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e422a2b1d81532cc162f59229af56b158dbaaa23be0984ac1e229ebba8f73f99
MD5 a921e160ef5fc017c40dff4297f06cf8
BLAKE2b-256 8a110b8400b6637d2da991eb7654ab68afc25695bfc7c052c160ed305240df06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.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.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-pp37-pypy37_pp73-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9fe3c742fb53b9831a81394d276061b276059b018cad2f6b17ef393ff319c7a1
MD5 6a058606a87d550602b5d98ad032ecb3
BLAKE2b-256 db194251f99485c96afc82a6f5c84550e833f2680ff8e396757a6b1d4f3de0da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 840.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cc909bd9b3ba97678eec3b09ca60f0fdce46c0f97bbf8786ce08cc16a263e1cd
MD5 0039cbdc2d6b027b028531d158260887
BLAKE2b-256 91dae4125b5c1de1b5e14b17e89d756f3742617fbc0aeafd0373aeedc329d82b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00e59909bfb8249a8d906bcedb34b01376624482db1439a56372b60524c0d64a
MD5 a6d398ecd58bbc6167b4355d00d0e968
BLAKE2b-256 4f3719ca0f84c26bcaddd768ad3a70f283a79dcf54daa18cb74b46b1148e257a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.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.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b47e5497385b6a2d11e4e4f61aa9a40753a63b7650ccc3e2a052c1b01441b373
MD5 d1b13ed14f7a961d73cdd32470fa7d89
BLAKE2b-256 957fdff6d7c00d23649a788c50f58ddd3cf3489abe3317f42cbbd5e1f23e34d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 849.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4761b1635484b97f77ee8475eabe4b99636e1dbfd9264fc33a9a8755e748b737
MD5 58408d22e5ffbec1d1fa02d45483736f
BLAKE2b-256 e0a581ac3d469f77cd14a642735396ba866401cc4d0c4b6e17be9d4157e40a1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e3d458d5bdf5519c92553780f41a649584a35d2450f578ff5a4840c7b276e3a2
MD5 761eab66d73d3e1b0d287cd02f05d81b
BLAKE2b-256 d69f0a67badd3f5e522bda07db73adbe7f156ec595a51dc75bdc54e7b94d67d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.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.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b06a3868b03c25569edf2fbc48d85fcd486a8cda4b6d5f9ddbd054f9122b9aa7
MD5 dc2fc0d9f8c4b13272bbb01c6b044fdd
BLAKE2b-256 dcabf5f3e7e44ba52c0c9d1e31efb2bbeb0832c9ff635a84baa6635646e84d66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 839.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 32b36b40f129e02876b9e1a9566ce23f9d1cc8def88267b2fb56b8db2a0e2482
MD5 3656cfd5686ca7914095ebf70521dc0a
BLAKE2b-256 81d5ab4a03ee023c59b3318cecd9afe9d30fabb4f8b7d01f84172db0306147e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 404d0cf42899a0702c831e8e8a545607a5f5070de4c942a0055d769c49625431
MD5 96c7ce5d6f3636eac5442f4d2675aee6
BLAKE2b-256 23e92d8215a75173db2c07f833de2a2c522e1890da2729ae9615bf31f1e5688a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.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.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 075dfa0002f4b05ae21239435075e6a1f60ffd6bf07c1deaf318f3432bd2fd24
MD5 45daef19145a81628985a043d1af94ed
BLAKE2b-256 9efc58775a26b7eded093936497d1154b0e59964b469c4234c792050b801483f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ducc0-0.19.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 bc21390e5c2bb0cc5a1c06c92ceb1e47b3c87803ae798af2613423f6016c4443
MD5 214acf5c3094027f187f9e9ec8b6acee
BLAKE2b-256 6f0afc2bf37a678c92202096fd723f90cf9146aff1a8f122d91f826c68b7f50e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.19.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c41dfd2a11330bdc7948d2f95e2127884baf4fa7e31ed96fe3515b9df6de60fb
MD5 9e58c4c693919d22b65a5d17186d40d2
BLAKE2b-256 87245bc4a355523ca41034f29d22dd77a6a8322107bdb6c168eeb8cf680632ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.19.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.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for ducc0-0.19.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 01febd6b0f4e69907cecfef01ec73141c392847c58c6345545ff1c8ec68334b5
MD5 647f26c8d06d4130af31f92d9df488fd
BLAKE2b-256 c38a20d073ea4ba1a4e1f3bf23748b7ca5bf454a41e4abf3fec7276f9611cbd6

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