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.

Reason this release was yanked:

bug in Hartley transform, fixed in 0.21.1

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.21.0.tar.gz (202.0 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.21.0-cp310-cp310-win_amd64.whl (797.8 kB view details)

Uploaded CPython 3.10Windows x86-64

ducc0-0.21.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ducc0-0.21.0-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.14+ x86-64

ducc0-0.21.0-cp39-cp39-win_amd64.whl (808.0 kB view details)

Uploaded CPython 3.9Windows x86-64

ducc0-0.21.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ducc0-0.21.0-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.14+ x86-64

ducc0-0.21.0-cp38-cp38-win_amd64.whl (797.5 kB view details)

Uploaded CPython 3.8Windows x86-64

ducc0-0.21.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

ducc0-0.21.0-cp38-cp38-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

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

Uploaded CPython 3.8macOS 10.14+ x86-64

ducc0-0.21.0-cp37-cp37m-win_amd64.whl (794.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

ducc0-0.21.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

ducc0-0.21.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.21.0.tar.gz.

File metadata

  • Download URL: ducc0-0.21.0.tar.gz
  • Upload date:
  • Size: 202.0 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.7

File hashes

Hashes for ducc0-0.21.0.tar.gz
Algorithm Hash digest
SHA256 6b9d64e547edf231437c8356b203d6d3e2da2d23212b4576991c895788c8eef7
MD5 6fba03142dfddc2a506339d45281eeb9
BLAKE2b-256 04b882b65a6e297f00e67c7e88c84551f00cb122403a6b530b7a3c469538ac70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 797.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.7

File hashes

Hashes for ducc0-0.21.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a3b45f80a9ad88b2c0e00772c15d0c37f7f66f15973602d6daa226af2356000b
MD5 200c9cbdf18307eb8c2e8dc55f9a5bb2
BLAKE2b-256 36d74b51bda01d4886d628f9cab6650091796d51a27f87f7c86ef9f2059d082d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.21.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fb82ccd08c9988d17619c395a2a935e302bbca7860dbe7b1436a22362e3f416
MD5 1a93e2f90967cc3cd89e32f9d3f9ff64
BLAKE2b-256 731b00c218a7686080ed23ee0badd0fcce35ce29e67f6893d82774b1af1fb403

See more details on using hashes here.

File details

Details for the file ducc0-0.21.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ducc0-0.21.0-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10, macOS 11.0+ ARM64
  • 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.7

File hashes

Hashes for ducc0-0.21.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f83418a3d168c83e1413aef52552facb13745aa6cb23580d6a5312684b23b333
MD5 d43e7ed9d27c68c7c83f0dc8dd602920
BLAKE2b-256 7c36e808012cba0441e6900589e75223bd6d3feb293fa55db482fb6723458f65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.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.7

File hashes

Hashes for ducc0-0.21.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1c4ff973560b6a2e00db3be6f822eca1fce4436043599ba2af8647ae8eb2ba3b
MD5 de52f8bc6b505eb66e8be7642aa1a03f
BLAKE2b-256 9941be84255732bc2308ff0bac7e7d29ef5589ff135c907fd615b02cfd37b26d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 808.0 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.7

File hashes

Hashes for ducc0-0.21.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ec66012d0c5b92b71151488177600c4743338b776b26b0429e7c067b2712d062
MD5 0bc2f243a2e4d36ecbd663a67b762323
BLAKE2b-256 a7efd2badfabc877f9057e155966115dec953c52b740603d9173e98f9c891fcb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.21.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95d718bc02fcbc79013a0e1c7929b9b960f9ec3fffb345e92a36b92e11ae27ef
MD5 7d6f2238af5ad85080c329b841d4709f
BLAKE2b-256 caa8c6953b907207b2b6f242f0b211a6d41961d520dc465c864f6c358a1afa7f

See more details on using hashes here.

File details

Details for the file ducc0-0.21.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ducc0-0.21.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • 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.7

File hashes

Hashes for ducc0-0.21.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ef8f38f6985b672540b0f43ab9b29e62ef764615fd4490835b0fdf24d8d08beb
MD5 e310a2acbb0c10f34810aaf550e48798
BLAKE2b-256 9c05b1421ef0c68283973a2f6203785831e7245a9d7cb68eceb197433f250131

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.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.7

File hashes

Hashes for ducc0-0.21.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b908c3d550a08b836d1f6d28f817af3084b8433c49e39c2a7b35fadfe05dfac5
MD5 983cd8b0684bb89eef64cd87f3fbba09
BLAKE2b-256 b2fc9d3f65cb6ab8624605a6d205928180accfa1f8604123b19f86f3a147581f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 797.5 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.7

File hashes

Hashes for ducc0-0.21.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 45453562b80a6b8ee3457cf9e6a04e4d9172604520b2c132f55add16be6b528d
MD5 8aa33659ef1eb8c317c78ed0f5d49c82
BLAKE2b-256 dd4806b814f6bdf98e0fadd80580ec5fdab0295cd1e511e41eadb48374c7e10a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.21.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0fef319221315a9ac6fd0a1e588e519d80f05d004638cdc28b89a6edebd57f8e
MD5 d0478773d7bbda85c5a32fba89ac68b4
BLAKE2b-256 6037c71f3f6256c90a72758a5be0c9daf0d56bbed018b1fef832f9f04fe37900

See more details on using hashes here.

File details

Details for the file ducc0-0.21.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ducc0-0.21.0-cp38-cp38-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8, macOS 11.0+ ARM64
  • 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.7

File hashes

Hashes for ducc0-0.21.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b11464c7a6ee41808aa5f0cf697e237ff4450a833b445696dddc148230e1c5c
MD5 051ffd99d57e3650d0f4593f1b29d60f
BLAKE2b-256 028fc5147bed1a2a8f9177d6efb8516d1d5c4e95f1904df9ae92e4cb2b2da805

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.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.7

File hashes

Hashes for ducc0-0.21.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 350e9af653f7b9042b9a993c82af28cd6822b67a47e27a4053f7fe3be7e048d8
MD5 20e31f333a7a9452a5c211072636f577
BLAKE2b-256 e8bdaf365cdb9d538b710368a061bd176586cd70b898d34944b2d5f866795013

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 794.8 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.7

File hashes

Hashes for ducc0-0.21.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 32bdde702f86416491ef88a4202c793d2b221015d102095f373d02a25cc762cb
MD5 ce922c886fa006030449eb770348672a
BLAKE2b-256 615be04eb5a67d0a88a06403a6c1f14c52e3aae3b5bdddbccd300c85e379e488

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.21.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ddc8af3d466619eb6d449531cb95c1a604f0c129d4048d1769b6a9a69a0a08d0
MD5 c1f925692ad270f93ffb73721c4f46ec
BLAKE2b-256 766764dc438f30361e63cd31732ce530c2921b55b132464a64f57d3f88d9215d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.21.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.7

File hashes

Hashes for ducc0-0.21.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 11a872f521e1476354f8ca6d7dff36cfa8f3773155d67c6dcc8c4cb25162d3d4
MD5 207e3955ea7dec492e3c86e0aca6e8b4
BLAKE2b-256 d807187806502c2f9e3284a9dcb6d78e78401c70e9642b9f130200eccfec3933

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