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.8
- only when compiling from source: pybind11
- only when compiling from source: a C++17-capable compiler, e.g.
g++
7 or laterclang++
- MSVC 2019 or later
- Intel
icpx
(oneAPI compiler series). (Note that the oldericpc
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
Licensing terms
- All source code in this package is released under the terms of the GNU General Public License v2 or later.
- Some files (those constituting the FFT component and its internal dependencies) are also licensed under the 3-clause BSD license. These files contain two sets of licensing headers; the user is free to choose under which of those terms they want to use these sources.
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
For best performance, it is recommended to compile DUCC from source, optimizing for the specific CPU on the system. This can be done using the command
pip3 install --no-binary ducc0 --user ducc0
NOTE: compilation requires the appropriate compilers to be installed (see above) and can take a significant amount of time (several minutes).
Alternatively, a simple
pip3 install --user ducc0
will install a pre-compiled binary package, which makes the installation process much quicker and does not require any compilers to be installed on the system. However, the code will most likely perform significantly worse (by a factor of two to three for some functions) than a custom built version.
Additionally, pre-compiled binaries are distributed for the following systems:
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, except for short 1D transforms
- supports prime-length transforms without degrading to O(N**2) performance
- has optional multi-threading support for all transforms except short 1D ones.
Design decisions and performance characteristics
- there is no explicit plan management to be done by the user, making the interface as simple as possible. A small number of plans is cached internally, which does not consume much memory, since the storage requirement for a plan only scales with the square root of the FFT length for large lengths.
- 1D transforms are somewhat 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.nufft
Library for non-uniform FFTs in 1D/2D/3D
(currently only supports transform types 1 and 2).
The goal is to provide similar or better performance and accuracy than
FINUFFT, making use of lessons
learned during the implementation of the wgridder
module (see below).
ducc.sht
This package provides efficient spherical harmonic transforms (SHTs). Its code is derived from libsharp, but has been significantly enhanced.
Noteworthy features
- very efficient support for spherical harmonic synthesis ("alm2map") operations and their adjoint for any grid based on iso-latitude rings with equidistant pixels in each of the rings.
- support for the same operations on entirely arbitrary spherical grids, i.e. without constraints on pixel locations. This is implemented via intermediate iso-latitude grids and non-uniform FFTs.
- 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.
- iterative approximate spherical harmonic analysis on aritrary grids.
- 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 andducc.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 a generalization of 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ducc0-0.32.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f0399f1ef6f5094ff25f8010319e578bb7dfa3680501dcbd9ded60bdda95453 |
|
MD5 | 8ad349e1c3776692b91d3a1b8e6e8ad6 |
|
BLAKE2b-256 | fe692ca7bda2dd4f82a87937bfab02c194d42aeb39b5cdcc3d78efe56282ce2b |
Hashes for ducc0-0.32.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdfba49fc9b5aeee3f350aee7b9f9fea1e04278d3affd9e79c8d824e90381990 |
|
MD5 | 1a6ade0e7f4bf277d0855525baf3780d |
|
BLAKE2b-256 | 65b5a29dd4dfcf6a79383c876147b1d9a587d460df2d8257de036fcc534552b5 |
Hashes for ducc0-0.32.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9330f1f6f1693e31ec6003b28b3674a9a49bfa82054efb6cb8c310185e2bab9 |
|
MD5 | b5f726766dbbdc3ea0eb83b5c5239d31 |
|
BLAKE2b-256 | 2b6b604d23e16cb363ac5576cfca760493ef89935878966a91b1bde9a6630eec |
Hashes for ducc0-0.32.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 136366307ced9504c6228c7f75572e2ba764d411981197f56da1c88b582fb413 |
|
MD5 | 3e9700b4f6e0d9a534955c2439b6f5a9 |
|
BLAKE2b-256 | 54a8849d776196276b710190f4a47a671a167c02c0581a8a9110a6107b677719 |
Hashes for ducc0-0.32.0-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ef7a84810477f061ba9d04f8124fef09d7b0a0f9d3157d0f247b65e28fdf278 |
|
MD5 | 064449353ebdca2b2e558ae07f83ed0d |
|
BLAKE2b-256 | cc5aec0612ca14e5bb848f42190448e543ddfe324a3036425195f2ee9e1dc3b8 |
Hashes for ducc0-0.32.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cbd33652b748d684cd2ec829b16e8fd8c08f3ba62e7991061b9ae3e40d02949 |
|
MD5 | 05dbda454eb64572efc8b0dd7e743179 |
|
BLAKE2b-256 | 4171e77add148eb11092e5121e02ae687607b42cf980349ab416c61034cf9854 |
Hashes for ducc0-0.32.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22ddaa434f2b26e4ccaa3467a6ceaffaca110f1ab507cc8f4a02b5d593d294b7 |
|
MD5 | 215aec8181d83bc9f3c893b4da3fdec2 |
|
BLAKE2b-256 | 3ec9968ddd3c9377bc5508994ffb0117d84be34963b882d6ed0afb969fed846b |
Hashes for ducc0-0.32.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 091870d92518a9f65c7f9e9f2d7f4c1b6a850eda2559454ae999dbab45bcb184 |
|
MD5 | 0820470bb36e42f924fa4d20e7b3d0d9 |
|
BLAKE2b-256 | 4f4eb34c68b4ccf0eefa727e45f4958fb14ceaf675f3722841499506b8916179 |
Hashes for ducc0-0.32.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21a09536958f63cc6e2feb1c1d6f417a58f16a47e1aaacdf9c856ddb911b037e |
|
MD5 | 996d111bbc96fbb5c6a8b43af315d3e4 |
|
BLAKE2b-256 | 5c8ff5234f73c781ad632d354f68cc45a20f3e63b4cf9c6c8884d63ac0ec58e2 |
Hashes for ducc0-0.32.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bb700981ddb732d904a7d2020da70651084201cc449ee8c4cdd341ac3e22a48 |
|
MD5 | 256b35f2602a38a596c5439a4d8ea2b9 |
|
BLAKE2b-256 | 90fe66d58130200504bea1542d63981929defddb4c806f29b00da85fcca3d2ac |
Hashes for ducc0-0.32.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e653c87ec6da6ce4052683105356cbd302edae4f9a9b8eac552673ec94897ae9 |
|
MD5 | 4907fe6aa24377299e2da26dec8daa97 |
|
BLAKE2b-256 | 63147b801d32395d214dbdfe558bbe710a571d0e21ed74b909d5fdf4037ffa25 |
Hashes for ducc0-0.32.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e597bc3c22cd41f0a77065f2b16ee0246cff2fe4fefa83f589ba86baf81ab169 |
|
MD5 | d0fadd7b61b3b14f6cfe8b97feba5d6a |
|
BLAKE2b-256 | 383ac8028dfdb129bc58a14fe34e5730335796efc2f8db6da3393620b2e41784 |
Hashes for ducc0-0.32.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 553fef95dfb5a3edff0deb76fb5008a53e5f751a46c93e1c29ebeb0873c28ef5 |
|
MD5 | 4682e750796ba80d12c3ea49f3a37e53 |
|
BLAKE2b-256 | e9a6535cdd17f743478b40e220ac7abfb8218df5b74add8d87d138ad2fba2a4c |
Hashes for ducc0-0.32.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 343c0ba5eb04145e09217a294e9511516696e55b1e6910e1bc759ed5ab43c26e |
|
MD5 | e50fbb5ab012a7766a1e762a2c1c89ae |
|
BLAKE2b-256 | a7f9a7c08fa8840d2371a15f5ed68df8d1e58040ba19e75cf143b60f2f3bafd5 |
Hashes for ducc0-0.32.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3576f05486ac6186fdd375d3baa819be14e56ee8bae7070bdcab556b3e294923 |
|
MD5 | b782c03336147a14a9b2820b4cfa379a |
|
BLAKE2b-256 | 2dd10b3b3afa3aa09f593eb06e04375a9c6434d9bcfec93981b3d8ce931cfcba |
Hashes for ducc0-0.32.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0460fb219f13c14432a6f3df8e54daf85a65304779b99f8e0f8bba5f521b1fbd |
|
MD5 | 54a2fd461949eac57cc0c863a5b8a721 |
|
BLAKE2b-256 | 3edd538777571fb29f813f92ed5b75c928b84704a9ea86457548c858f13b5d31 |
Hashes for ducc0-0.32.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0946f6fc1d5d1a1ff633c1d7d3480f4a49b0e351db6d638bd9351ebb7410ddd3 |
|
MD5 | 1ce1828a60b03160e30fdebeb0bfc136 |
|
BLAKE2b-256 | b63e5a086079b0e361fae52caa3ff344937af5cba90f78885baa9119483c6530 |
Hashes for ducc0-0.32.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50f04fcf45d2adeffd92567e1fd2c82eeca6db754236c83ccde5575b0df468d3 |
|
MD5 | 35cb540b7e66b6aa64324ef9abf3c100 |
|
BLAKE2b-256 | e4c8d6dfe34eaa12bfc6d25221d9c5d264e0febde1ed1944f12ecc0a3d0f10d3 |
Hashes for ducc0-0.32.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd28464ecaa14c7a01ba625713d7c259958d3a4a0d982de730f4f58e505c7f3 |
|
MD5 | 7eb009f36e3ead4e855741c8f20521bf |
|
BLAKE2b-256 | 667830e45af552da896f6bbcde6d08e723b0e45053347b67454d718751878d6c |
Hashes for ducc0-0.32.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab338d2d5433977a53d38b061b743d4f734c04e5f8202252274b2a0841ad6277 |
|
MD5 | aa35936b6df29696cab0823e2b372f92 |
|
BLAKE2b-256 | 94937b136041b792ed2f0a5939a49c31b59e3a24d42f4ad7a7f18223d70bbf7d |
Hashes for ducc0-0.32.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a5c9957a2d0daa68e402b17fbda7112e8c01a444318f261775e3ec2a43f6f4a |
|
MD5 | ad36338426362d0e9fa4d7ae42690dbc |
|
BLAKE2b-256 | 9c30a8ede330bcfc817e8c5207f5819befba7f1b75700c90f58220c2f031e27b |
Hashes for ducc0-0.32.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c8255492a150656c3ff4812b7af7fd7d9f2953bf05694cc72ac498fd5047430 |
|
MD5 | 8dc4124efa2dd2d5d26ebfa8852a183c |
|
BLAKE2b-256 | ae438b832d4a4bfc37ba6079928b29733a69f3291d010c92823b4ae822b355cb |
Hashes for ducc0-0.32.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c860b89c0fe0682e0604b23d6a9ade15050219b72c754c1116cc3499428b0e9 |
|
MD5 | 1d3c1d0757eed221fd3cb0b7aedbd57b |
|
BLAKE2b-256 | e0db4d7f14f09c43bf68d68ad4ea3b809b32815964ca4d2d40692292cda6965f |
Hashes for ducc0-0.32.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4738226ca50b68e1cdf7af4d02ab4e71f75b8babe3186dc29db6c41f321dccf6 |
|
MD5 | 691272f269af44632852bd27e0389827 |
|
BLAKE2b-256 | c9b12d6afbcb9df031373c9c223e3e98de1eaa4f3fad52fca77f918e38c2cc76 |
Hashes for ducc0-0.32.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1477794db4fc8bcaeb1af5bee129d4ec18da558ebf06e8ec9189f54da8a56b18 |
|
MD5 | 60246773218be841b90e8b1590f8eb9b |
|
BLAKE2b-256 | 3480b9d30536b5f313cb18b66d18c8ad1aea1eec7d531ad5d0d33efce4203986 |