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

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.25.0.tar.gz (249.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.25.0-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

ducc0-0.25.0-cp310-cp310-musllinux_1_1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

ducc0-0.25.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ducc0-0.25.0-cp310-cp310-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ducc0-0.25.0-cp310-cp310-macosx_10_14_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

ducc0-0.25.0-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

ducc0-0.25.0-cp39-cp39-musllinux_1_1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

ducc0-0.25.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ducc0-0.25.0-cp39-cp39-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

ducc0-0.25.0-cp39-cp39-macosx_10_14_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

ducc0-0.25.0-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8Windows x86-64

ducc0-0.25.0-cp38-cp38-musllinux_1_1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.8musllinux: musl 1.1+ x86-64

ducc0-0.25.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

ducc0-0.25.0-cp38-cp38-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

ducc0-0.25.0-cp38-cp38-macosx_10_14_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

ducc0-0.25.0-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7mWindows x86-64

ducc0-0.25.0-cp37-cp37m-musllinux_1_1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.7mmusllinux: musl 1.1+ x86-64

ducc0-0.25.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

ducc0-0.25.0-cp37-cp37m-macosx_10_14_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: ducc0-0.25.0.tar.gz
  • Upload date:
  • Size: 249.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for ducc0-0.25.0.tar.gz
Algorithm Hash digest
SHA256 c4fb26747553d0f756884cef38341fab93330ce660bbca25e09f4fc830105779
MD5 61d8ab57610644eda7419950e90dc64e
BLAKE2b-256 e17ca77fbe6592c713b9caca57db5d4d757fd66139c0c5f2b1598ca046835609

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.25.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for ducc0-0.25.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 60933b4e11016e4c952181803527b24f0e5154d8224b1ee36a2b8bdb6a9f9f02
MD5 c7b1b0ab6be67c261cc3c4947ee56bc6
BLAKE2b-256 0d05e48cd8f8e55d5d2ade9fe09cf2db11ecdf2e5e6dcf80690234cea779afdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 731c3cc4d79c45462246852a07fa73088eb84a041542b7048e03a105996d68e2
MD5 dba110e85853a167432dc08f580c9324
BLAKE2b-256 c449d9497eb2c1c7f6ffa7045cc1a31ef48f97fc58df451e352ee1e3a8050031

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0319d24b9254c6695a8c5d09b1e785c067e2c95bc6fa859c23712f1d81028007
MD5 662e6ca822ed2fcda1dce1cc7084b2c0
BLAKE2b-256 041a6c56f44cbcb9ca0f021892c2d47d795dbf1fac463feabb5e8e9114a0a4e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45629cb52c812591e171a6d7e772019c894ea591c90ea015cd0319b4b3364672
MD5 6db144169d162f7d2f3bbe61054b5a6b
BLAKE2b-256 da23e136a8bb227cdb80ae21739330df8b0eb8c6f1b6c2320db0734f87dc8b8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2b09581da3c872e99b782b01e6e68b0552c937272fb8f48f3625a13e766f6496
MD5 7e254d5e45d47822e5c4f7b384b18576
BLAKE2b-256 9ee57fd12d3a0bd1b4c350c7d4b5ecbf4448b4543e5e2b2912783c2a30c87723

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.25.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for ducc0-0.25.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f35c91427d8090d89c6fce0454688d3cc4fb65e7f1dbfb2321cbeef4baaee4cc
MD5 06649cba62a97a36149640c48d772afb
BLAKE2b-256 36a8f308f5887a50c5a44318065cedcc471bff90a54874815fd6f6c37d6832cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 8a8ff827e75dd3a93d80ecaa5f4cd45f03f72c6c7d5e7bd15300eb94d6d68a1f
MD5 4132dcc1ef23baa4e8f036c988ad2fed
BLAKE2b-256 c668a472099f48a63fefa885c2e15cd8dd9e664eabe02d1ce448e80c4123b354

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1496554893a946ed8a957b7b5979ffd174aefd3454b6f18f9da9719e379f5d26
MD5 5441f0ca2e9006f77c2031bbeaaf739a
BLAKE2b-256 ead7868df82cf153a994cea41668243854adbb347d4e7c0a7f6d71db7d6d661e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dfbf0e79ad945871b4183b188f5976c916064ff6f883ca3b6d5bb511a9e026cb
MD5 91ed55b6626066bc225e893601dcdce7
BLAKE2b-256 d23d87f1f00806459f5a7f8081bd7b5778fc2020c2f25cbe50edb1a5c96b69c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d7eed57740bee7ae66196b11cae33c79114845fe115ffbbed822603d60d5c4a2
MD5 00ea260b1e59a2df7e4bb3a3c95383e3
BLAKE2b-256 3e8534571f06e7185602648ff372b28e2c160a8540dc08ccfb96b363118e38e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.25.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for ducc0-0.25.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 136b979496b82df476ea852d95e5d9a10a64aea2f0846af3cf1c3065ae7de40e
MD5 769ee2ca3855c4ed727c0961035f9a59
BLAKE2b-256 e9cb323010622d09e9e158baa050aba227098c90869f232b7de77892b13267df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1f809e23b57e05416b2e5d754038ea5bdf0f3b1e223cb991dbc51ba767da0767
MD5 c25d62d55d7b18403232f7ce84b3da16
BLAKE2b-256 a86b59583f3930e06d3def00d9336a07432be3b4134f60960461f4ef60a675e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 23243f00be60051c1b98557dd5ea9944cc468ee89e1f8d4ff8634f51e1ef543f
MD5 b44457270383499dbb0912f901929486
BLAKE2b-256 b679471ed3b8be1229ac42cdd82e7ff5e281b9c97fa4b4939d884ac192bb4892

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 409d3dfc2bad24596a70e6d46c57c9fd3e100d37d803bcffe96e2f62f600bc79
MD5 4f33bfbce4fca359d279f3067b6be770
BLAKE2b-256 5aa81785c13d8202e9304ff0356fd50ea03cd52564fc047710f25342c5cb111f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 818d7d3590e07cb799ac9c3591119666d3c6d77564f28a8a92e1d0dc6550aa2b
MD5 7dadeb8b6dca54535a65f3a2b7a460b7
BLAKE2b-256 317327f79188d47859ef7e9fc67e600722b2e207a1013d45d9dea00049d193da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.25.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for ducc0-0.25.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 74fb8318e87348c234efcb0735c274c471eb3a9b352850d00d718b4edc6f56b5
MD5 a3523bd985d26392be425d5e30ef130b
BLAKE2b-256 d9ec41e552b62729ef65ec585ab6bed62edfb0e2e1cfbd4cb03c7d07d0672571

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3a89f26b52c5a0d2640e8b37ef1431f75935f6f525ad3870430ca476bd472751
MD5 b63f5daf9c5797eb5cf4e06b26d8d740
BLAKE2b-256 a8196addab79551a9525ad0a556b2072907cdc01866a2bd1a8cfb4675c7e6fc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f1978cf80687a8d11ed03886888a3361b0e1082c790b62da2f756abbf8caa749
MD5 f20787841409d597f251c14f68f3d1d8
BLAKE2b-256 b8418ac9414ced84a49268682061a24c30972934efa0c7e0f31589153806de66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.25.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b8b70e95e2f1588d5eada9e63b717274687e577da766c9c362eb8552b14bfa18
MD5 ffbf3ed03f4381abb1d33f977a4099f7
BLAKE2b-256 830cb67e97356f4f965652ccd84c4e82ecfe02478a26f363048914f98c931524

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