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

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

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).

DUCC0 has been packaged for Alpine linux and can be installed with

apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing py3-ducc0

on the Alpine edge distribution.

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 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 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.23.0.tar.gz (211.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.23.0-cp310-cp310-win_amd64.whl (821.5 kB view details)

Uploaded CPython 3.10Windows x86-64

ducc0-0.23.0-cp310-cp310-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

ducc0-0.23.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.23.0-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ducc0-0.23.0-cp310-cp310-macosx_10_14_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

ducc0-0.23.0-cp39-cp39-win_amd64.whl (832.1 kB view details)

Uploaded CPython 3.9Windows x86-64

ducc0-0.23.0-cp39-cp39-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

ducc0-0.23.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.23.0-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

ducc0-0.23.0-cp39-cp39-macosx_10_14_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

ducc0-0.23.0-cp38-cp38-win_amd64.whl (821.5 kB view details)

Uploaded CPython 3.8Windows x86-64

ducc0-0.23.0-cp38-cp38-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8musllinux: musl 1.1+ x86-64

ducc0-0.23.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.23.0-cp38-cp38-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

ducc0-0.23.0-cp38-cp38-macosx_10_14_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

ducc0-0.23.0-cp37-cp37m-win_amd64.whl (820.1 kB view details)

Uploaded CPython 3.7mWindows x86-64

ducc0-0.23.0-cp37-cp37m-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.7mmusllinux: musl 1.1+ x86-64

ducc0-0.23.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.23.0-cp37-cp37m-macosx_10_14_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: ducc0-0.23.0.tar.gz
  • Upload date:
  • Size: 211.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for ducc0-0.23.0.tar.gz
Algorithm Hash digest
SHA256 33844bd0dfa4ce1a43810c70a21b9d6254f7d55c7f5a28126a587145c6fcbba1
MD5 e9d76f7989ee61fc3d35c7c33df4134b
BLAKE2b-256 71a9c6d60497c7053025776059c67bbbdcbae810fc570ecf77be8b49fceb613b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.23.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 821.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for ducc0-0.23.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 df6a670569c64cf333eaf8792b0e54fe1cd29b1737d73174dd5aedfd56ddc51e
MD5 b1d1947e837d4f270a00439992a8d299
BLAKE2b-256 c3088ca9acbafc9e2b7666f262d4c024e43ef71c29556a9711d034d5c387e855

See more details on using hashes here.

File details

Details for the file ducc0-0.23.0-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.23.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 f901c1bb6d2bf24b0ccf9e0e6a364bb9e1441d7b294b667fff78e4b8eaed5ffc
MD5 517b955ce075f39645d1422fd609bf05
BLAKE2b-256 530c605caa6c7f150aba0ca500fa0a325c686eb0a393ffab588e2bb08ca43df1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6133d38a1a41f52d26720ccfde1fb92e7e542388ee9632a5dc62a6eb0b234726
MD5 aa5e03f066c6e3191881b62d6e168c5a
BLAKE2b-256 4550b08b0a6a1b4ed5b92b78e145350531ea877d4fdc974bebd102b2f3b6ef0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a6024a053b3a5b3d6313595d52e96d721cb942f46c9db1b9304c3d664feb546
MD5 6ef5b6314baf40de91cbb0b828faff17
BLAKE2b-256 6ee8461485469a6ea564efcf23fac271fee3d0f718d8066df6b1949b024214e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8c67c7c7d7088b2f473cb9b29e5f7e32df453a35aa869018693a3c2c4003f0c7
MD5 6ca438de77a1ce91424c6e270a61e730
BLAKE2b-256 b21264ab4200f307ef08660a671e887646cccead7fe68acaa0b233403a70c6ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.23.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 832.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for ducc0-0.23.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bc7932187e1d521bd3a7b4e990bdddfba04669910366f331bcc65d4b798f4fd9
MD5 54ca5e2c2965b5b420ff9f94f4991e8e
BLAKE2b-256 34058642d0cfd96784a340f365f5c1dbfb5266fe853162a6e7f735d44c6bdfae

See more details on using hashes here.

File details

Details for the file ducc0-0.23.0-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.23.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 208dfb9d34f6228e6d8a899827de93f88fd835dbdcfe16ddc80087deffc45550
MD5 08cd686a9385a1aea637a25ef1715239
BLAKE2b-256 ad4b2bc405196cdc488e56e7f8e7e9551ae3bef918f2e1860fd3f9a7069f639a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1cfa392c09d98aae6e6aa8035fe7b3ce07811fcc9cc9921cee9ca91d3eb68eae
MD5 f6b216dd260160d49398f2fb6674d7eb
BLAKE2b-256 ff49021dff083afc156cd147d8496f97f41d0ca4e68eb7169d9b4be020588130

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b2c10935ffc13cc7d1c0f7267530be7960a8a5fe40a7ab3b478b002ebe88191f
MD5 b11744881f6e409eecbe6a2fd07da530
BLAKE2b-256 87b4573626ff3ee8692ea966609929a6ae38ba5490de937833a0580d84246f69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9aad402e6c169202fabb9cc830bf8de19e8e99b5a42250c772cc8c3112b119fd
MD5 2e507935169de0da9018c981020c7285
BLAKE2b-256 b546ccc908753b21c351fcd558fa5783aa2a670a9e0ac4d9de3055a9c1ec7908

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.23.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 821.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for ducc0-0.23.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4e3c1cf87bbccf988a638c1dc89bbf9923ab576f43eae29fadd92cbd8ffe81fc
MD5 790cc4ee2d6abd0f2dd21a6524871309
BLAKE2b-256 30e75b156670486b9a545c6f94029e9e3fad298815711930023651bda0b49ded

See more details on using hashes here.

File details

Details for the file ducc0-0.23.0-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.23.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1cd9c569f5ddc59754b96150bcc3a5e30ea7b1d30b18bbf0dbfc90ca3c024258
MD5 c3b4a685734229d89af66e9a0123998f
BLAKE2b-256 b2e8c6ea9b1a70bd7ea7f7f8f73eb9bb6ea4c0ffed42d17c7793cf9a9ce38dd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 345874be875f2fab157c362b8bfa3895a25d2ed6644b0fb9dded615ed3dd79ee
MD5 cb1fc6fb51ff8cd35a37f6ec90b095b3
BLAKE2b-256 828de37c057b47c3b62274798fcf66a79ce773bccd6993b501cb8a474e12f150

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf2563ecbab1ea773bc81356984f69949b647bfaf29e71d108e560382dea4c69
MD5 159be1c5b384015b03851c6faaa9be00
BLAKE2b-256 713bf0181793f539c0e35e3a275dc8ceb4685d85ffab1f0f336764e26d6bcbb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d2d6cba7f4bdf456da060054e6800a90d2e126450d53d8db8463ed2808f3fc1a
MD5 a383647d39874ba8fe92a7e90ab5e54d
BLAKE2b-256 47cbfbae1e12ffad844b3361484b46b418c9b2d07cff99f4d73cc0e9db42a8a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.23.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 820.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for ducc0-0.23.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 96b2bee0a769ec0f85aea6ea06f939aebef35d75e8a960c26c736be3a132b7f9
MD5 16d190089cf4e04735b0f3be3abf4130
BLAKE2b-256 48052f2e0db5bf913617caa8c05f3628082119d2714fbae1b976daa3319909c2

See more details on using hashes here.

File details

Details for the file ducc0-0.23.0-cp37-cp37m-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ducc0-0.23.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 58220f1af59821a15ad32139c50c7b4e8fe3c42459b602cd8c83b8f294a04c48
MD5 2f46c3200c814c4119f44bedcd6bd8c6
BLAKE2b-256 18bd3e78bd5bf49658853abcb9db74b3d07ba80fcd9a0c845a765765d3d9c1da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 015df2084d084f32b11a357f2b2a87bafbab409aab5c14d0ac95fed7c07255ab
MD5 b9ef76152ec1e2cf80f0928bc4e7a7c2
BLAKE2b-256 b352bd41aed5dbecee7b46fa71283dc7b52178cfe931805d61cb383084ddeff8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.23.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1ac2ff1020bddbc220870433ac5159667f06147a5de2560158390159506e70af
MD5 ba9dc9d4e0e8138f91f1f8aa837236e5
BLAKE2b-256 0d37db57b2598d2e110efce1337a521841583481d01fa0c792f063e84f512c02

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