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.24.0.tar.gz (240.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.24.0-cp310-cp310-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.10Windows x86-64

ducc0-0.24.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.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.14+ x86-64

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

Uploaded CPython 3.9Windows x86-64

ducc0-0.24.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.24.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.14+ x86-64

ducc0-0.24.0-cp38-cp38-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.8Windows x86-64

ducc0-0.24.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.24.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

Uploaded CPython 3.8macOS 10.14+ x86-64

ducc0-0.24.0-cp37-cp37m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.7mWindows x86-64

ducc0-0.24.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.24.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.24.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.24.0.tar.gz.

File metadata

  • Download URL: ducc0-0.24.0.tar.gz
  • Upload date:
  • Size: 240.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.24.0.tar.gz
Algorithm Hash digest
SHA256 609e9f8be8291229966e3586e50f734f1ea4a4b6efae5b52732deea01bab829b
MD5 7dde46c1c589bde8f396f57639100c45
BLAKE2b-256 1f259d6a8ccb62bcb37b9ebdcad35093b9defdf0d01aa098562dd1f919760751

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.24.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.0 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.24.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6442e1059eb29e693bc4d0a50645c3e86f2b6b59fb318097717b5aa895ebb1cc
MD5 ddfd15fa73207b871d7dfb6d5814278f
BLAKE2b-256 2665a728368476e163cacf1dd7dcb7a65bee81fd301723bd0bd254a2b830dd3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 88647205ed2cb6d371fbd128c0c18ead8d5a9bebaf384080a9537c3f471ee4a3
MD5 55ea464b51d8a3ca7c7adfbb9c973cc8
BLAKE2b-256 270382fed7a532c9bfbf73cc62fb3988f401a7201a329a35d5c922421bbba6ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd4cd5c3747f4a9c44579a1b3fc8ba23ac6cbe1a59ad43d456d63649ea2d9063
MD5 d18d276e0128d80b137a16dac3aa5ee3
BLAKE2b-256 df0ef086442a2b1d330063199077c786a05342e5996fe3a9214299b14700741b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2fe9e4e3374b21ad35d09144c43256320259d9124e30f5bcad41cc73f6c986f
MD5 0059a0ab18d310f737e8f9955ea0a751
BLAKE2b-256 f52425813cae50547b86a9a8a4ef2cb3bd453fed67dfb3757a6ae1a2c136be2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b253fa18388a72dbb4a30f52b098b8e7392c4ab0e0f5d7deaacf1695baa6a79f
MD5 535b3e3be5c6013295f7e0f444e9cc3f
BLAKE2b-256 c9bceb066b7409c633fe5abd41b5692df78d815d1fd3b6d12530eae9139369d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.24.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.24.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b8dc7ebc8ad2391070986fed86f012b1f75d55fcf8f35d943ba9a7adfe38d6b7
MD5 2a026834970c5640bc460ca3162867de
BLAKE2b-256 c66cf2b298f740f58f119abdb12716b331605d13b5539505b707cc19706464c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5cc19e284bc973db43f276bba8f3a077299298615916939d118b800b7ae872fd
MD5 f1d2fee0b7f861b72a4dc657114b3bb3
BLAKE2b-256 4ded08e7a0d58ceb0febb6e951b7a5412e0d4400ec5d512f84ca38f2fc83a760

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2ee56a60dc0a165c0f33952415d6e860a0ed10e854cd4e27b411573f650a1cdf
MD5 2f915b04c37b3b85f71cecacdb897d26
BLAKE2b-256 5df45426f8ee056ee4db6acd46b8abe09cf272046e556e8a357f08e22b67c07e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c6f4bcfe0b88cb0224d27be44ac24ceab4f6a79770637d3995c21579e8a84f4e
MD5 0237d43982b705ade015de7306925d92
BLAKE2b-256 b1993bcc09c3e67d7a1e2ac6defb0fdca8282f346fe0e8be41b51b4d456a9baf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 24f23df42e34dff0759763d47017536922f60c2e84153ac5751cd305d2765077
MD5 8bb537fce230fe6bb0b59987cb409bb4
BLAKE2b-256 d530780eb655d484d0ad7bbfdb495e1e0b1a40b866af1903430026a32c938f6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.24.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.0 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.24.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 5f248318f414835f7a4de5cd561918af30f3df72693ccea812e08971e20e98c7
MD5 a2525b6117396b49a87d2c288022c880
BLAKE2b-256 3b0e57d31549ddbdde85e14716e640290e62bc36a1662381bb0240931e99cb52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b7299c27854d494af3375b42d4ad006282d833c17491a0288103a8d7e3e30822
MD5 d638f857b8e6ae11ba5bb5e00bea3046
BLAKE2b-256 ebf5df60842e6be809227621936cd5570bf7316baff4a446d70f83f692d357fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 985cfc48816a6947374045572cc8013ab65c374194b0b708a4138536392f94fa
MD5 b3cf6b9f997ce147ddb1514dfd4a02e5
BLAKE2b-256 d2e31b250be42e36336a92a8ce9dc3b7f0d6797f96be58d2f843da53326d2880

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e9ed7710908236681f9520d4e3bbb5c380e10ea590b55b3c278205bfa157a7b
MD5 95d4a29cb746d1715455e647386e16c8
BLAKE2b-256 f08cb81f0a79cab85f5b2724f477d647ae48ae2853fbb97dd7c978185efbc0e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 32cc9dce064e23b47849ca4c7c221cb70442d97a288e984e31781a1053aed997
MD5 b3f3172891226199ce6c6251bf3bb504
BLAKE2b-256 152d76b25983ff66cbf4c153511f2ec0fa791bf1ca9f52bc101a7f5e5a35b23a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducc0-0.24.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.0 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.24.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6ed0f53836e73410effed50c04a1fd1a0209f948ef22d7dfbc55f4f38041e2b4
MD5 b5c62020d7a8eaf2def261c7c8ad079b
BLAKE2b-256 24c8047a7a4de7bc1037643cade39db723fda9364ed67f8e7fd160d61e25bbcb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 fa14747e9fa576e9102cfb815cb5778a4edaeba8c14cb4dcd38f4469820ffbca
MD5 0cdfb7590fcf75c8813af26355a0fb2b
BLAKE2b-256 ccb7d021750e376dbd7eccc005facc9102fe3188c01431ff6dab57c35b93f711

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e7b6ef1cbcc3a7e8c0eca183b760e17d3dbfd3eb73e95d5d42b9b12d277ee41
MD5 fdddf97204180caa4da0e2d45c14c39d
BLAKE2b-256 eadaa8e2bf050c4a69ac8d338fd4cdda4720538c5e8ed1ec6b7ee3690045f322

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ducc0-0.24.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4947057cd6308d0f357fc8dd6836b3b8c03c43a9667779adc75bf4af1ee63a8b
MD5 0da880cfa5ce92330e90952ce9791062
BLAKE2b-256 3bdc581d6ee54d7e86023e9d243f64a3d2b9c249745fdcd03e202d4402e3852b

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