Skip to main content
Github Actions Status Documentation Status PyPI version

Wiggle logo

wiggle stands for the WIGner Gauss-Legendre Estimator. This Python package provides a fast implementation of unbiased angular power spectrum estimation of spin-0 and spin-2 fields on the sphere, most commonly encountered in the context of cosmological data analysis. With an efficient and exact algorithm, this code performs mode-decoupling very fast; in the case of binned spectra, wiggle can be orders of magnitude faster than other approaches (often around one second of compute-time at most).

Wiggle logo

Installing

Make sure your pip tool is up-to-date. To install wiggle, run:

$ pip install pywiggle --user

This will install a pre-compiled binary suitable for your system (only Linux and Mac OS X with Python>=3.9 are supported). After installation, make sure to run a test with:

$ pytest --pyargs pywiggle.tests

If you require more control over your installation, e.g. using Intel compilers, please see the section below on compiling from source.

Compiling from source (advanced / development workflow)

The easiest way to install from source is to use the pip tool, with the --no-binary flag. This will download the source distribution and compile it for you. Don’t forget to make sure you have CXX set if you have any problems.

For all other cases, below are general instructions.

First, download the source distribution or git clone this repository. You can work from master or checkout one of the released version tags (see the Releases section on Github). Then change into the cloned/source directory.

Once downloaded, you can install using pip install . inside the project directory. We use the meson build system, which should be understood by pip (it will build in an isolated environment).

We suggest you then test the installation by running the unit tests. You can do this by running pytest.

To run an editable install, you will need to do so in a way that does not have build isolation (as the backend build system, meson and ninja, actually perform micro-builds on usage in this case):

$ pip install --upgrade pip meson ninja meson-python cython numpy pybind11
$ pip install  --no-build-isolation --editable .

After installation, make sure to run a test with:

$ pytest

Quick Usage

Accurate power spectrum estimation requires you to first convert a pixelated and masked map to its spherical harmonic coefficients. wiggle does not provide tools for SHTs and expects you to have the alm coefficients both for the masked fields and the mask itself already in hand. These can be obtained using a code like healpy in the case of HEALPix maps or a code like pixell in the case of rectangular pixelization maps.

If you are interested in accurate power spectra out to some maximum multipole lmax, we recommend you evaluate SHTs out to lmax for the masked fields, but out to 2 lmax for the mask itself. With these in hand, you can obtain unbiased power spectra as follows, in the case of a spin-0 field for example:

> import pywiggle
> import numpy as np
> import healpy as hp # or use pixell for rectangular pixel maps

> lmax = 4000 # Max multipole out to which you want reliable answers
> bin_edges = np.arange(40,lmax,40) # Choose bin edges
> alms1 = hp.map2alm(map1 * mask, lmax=lmax) # or get these from your favorite way of getting an SHT of masked maps
> alms2 = hp.map2alm(map2 * mask, lmax=lmax) # same as above
> mask_alm = hp.map2alm(mask, lmax=2*lmax)  # Notice that mask alms are needed out to 2*lmax
> ret = pywiggle.get_powers(alms1,alms2, mask_alm1, return_theory_filter=True,lmax=lmax,bin_edges=bin_edges)
> bcls = ret['TT']['Cls'] # The debiased power spectrum for spin-0
> th_filt = ret['TT']['Th'] # Optional binning matrix for precision theory comparisons

The interface to get_powers is flexible enough to allow all auto- and cross- spectra of spin-0 and spin-2 fields. If the input spherical harmonics are (1,nalm) or (nalm,) dimensional, where nalm is the number of spherical harmonic a_lm elements, the field is assumed to be spin-0 and only the TT-like spectrum is returned in the dictionary. If the input spherical harmonics are (2,nalm) dimensional, then the inputs are assumed to be E/B decompositions of a spin-2 field, and EE, EB, BE and BB are returned. If the input spherical harmonics are (3,nalm) dimensional, then the inputs are assumed to be a scalar field along with E/B decompositions of a spin-2 field, and TT, TE, ET, EE, EB, BE and BB are returned.

Here bcls is the mode-decoupled unbiased power spectrum and th_filt is a matrix that can be dotted with a theory spectrum to obtain the binned theory to compare the power spectrum to (e.g. for inference):

> chisquare = get_chisquare(bcls,th_filt @ theory_cls,cinv)

Contributing

If you have write access to this repository, please:

  1. create a new branch

  2. push your changes to that branch

  3. merge or rebase to get in sync with master

  4. submit a pull request on github

If you do not have write access, create a fork of this repository and proceed as described above.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywiggle-0.1.23.tar.gz (274.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pywiggle-0.1.23-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (312.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pywiggle-0.1.23-cp314-cp314-macosx_13_0_x86_64.whl (450.0 kB view details)

Uploaded CPython 3.14macOS 13.0+ x86-64

pywiggle-0.1.23-cp314-cp314-macosx_13_0_arm64.whl (407.6 kB view details)

Uploaded CPython 3.14macOS 13.0+ ARM64

pywiggle-0.1.23-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (312.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pywiggle-0.1.23-cp313-cp313-macosx_13_0_x86_64.whl (449.8 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

pywiggle-0.1.23-cp313-cp313-macosx_13_0_arm64.whl (407.5 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

pywiggle-0.1.23-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (312.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pywiggle-0.1.23-cp312-cp312-macosx_13_0_x86_64.whl (449.8 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pywiggle-0.1.23-cp312-cp312-macosx_13_0_arm64.whl (407.4 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

pywiggle-0.1.23-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (310.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pywiggle-0.1.23-cp311-cp311-macosx_13_0_x86_64.whl (447.9 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pywiggle-0.1.23-cp311-cp311-macosx_13_0_arm64.whl (405.3 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

pywiggle-0.1.23-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (309.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pywiggle-0.1.23-cp310-cp310-macosx_13_0_x86_64.whl (446.6 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pywiggle-0.1.23-cp310-cp310-macosx_13_0_arm64.whl (404.0 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

Details for the file pywiggle-0.1.23.tar.gz.

File metadata

  • Download URL: pywiggle-0.1.23.tar.gz
  • Upload date:
  • Size: 274.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pywiggle-0.1.23.tar.gz
Algorithm Hash digest
SHA256 9ebb077115eea5e60a28a6868ae879af39774c0e061661df428a4051271129a7
MD5 e2c779d1fedbca03bd0b6b9265aa17d8
BLAKE2b-256 fb39952ae7d6b70336b7b0bb9bbb5a74a68375829cf1750c0dba0de27497966d

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b1e7bd786885da9894cddda106634b069c58ce600eebe1ec10dd1fb578b1979
MD5 703ab92680dbb465f5ad978159b7bf0c
BLAKE2b-256 4c94448e174807491c825938d2109528b413c85ef645ca7b763c7fa4d94e9101

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp314-cp314-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp314-cp314-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c2eb7e6f5311e7f8e3e26c86909dce437ea3e66a3c69cf41b2b38ef232d80589
MD5 7c6b6a45cc44aef82e36b8eee61c8d70
BLAKE2b-256 01d3697a630e265dc21df8f94aa253b78b9ece8273aaf1787994a871383a4648

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp314-cp314-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp314-cp314-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 b40de4e7e0e6b11e0949f7eee4ab56df045e4483b7bcea777e27e0177fd24138
MD5 e53354d76c0eef5b43e80f1bb3b2fd78
BLAKE2b-256 e13931fa28a1c494159d3b5cbdf23d905bc145535521ad2b898ec48b74c3f152

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a39a376635f6c953417b980e8ee8589958dc265218117e738bfda5bb752a5f7d
MD5 4d70c9da60589f27025e1fe325df5431
BLAKE2b-256 88bcef2d8e96f05a34ff62af3996dc3c8a02affb3c491e08db3f5f8322f28c63

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 698884ebfa6cf322860ea14d0df1c9f5e2622f20ba4a10fbb09bd7f0cadec58f
MD5 d14bcaf27c1340c9c0b80455f0b0c908
BLAKE2b-256 deb40a524e64ff758ead20aea239a5cd19a91296fa6ce94494a06a142126c8de

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 17c8fc3ef7f844a211fd1d3cb885a9beeb29442bef348aeae2add421ec22f02e
MD5 d0e992280d076f562dec502d2097baa0
BLAKE2b-256 126b05b05fb3cf62832a90dd0b3df69c6c286f351466f46e726649a688685894

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 080034cf14c600c27e743e0143d31c9d8c7061a77ea330a6e59313b69a641d17
MD5 2552e202711c945df8f274fe6011c14a
BLAKE2b-256 cc177c20944afcd0b6ebbb4ffcd080801fad10e3012c76f4adad2fb6750ebab2

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 880ec06fbe4efee1a821128f4fba2fa7a5434f81829998173fc9f9fc4cc5c4ef
MD5 cae9c743f1953e80acb8e9931e9a0964
BLAKE2b-256 80408fb0b682b8c0b8295e51e1c51c86241a5873cd613eb000aea5d85f3b02ec

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 9c3ba245c6bc467516b5dd61e79014f8845b31259479fabd15d2bd171ec25deb
MD5 d1ba3baeb0dca5c06641cbbff71cced2
BLAKE2b-256 ea99d744969632c6f05b5a1bc7b927b37ffbb43b0687eb977c5c9d9251f828a3

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 552599340a6af0c8183b6367916724e18f73e233a5aa6080a3e7382704326bd8
MD5 d1cc97e9c9aefa73980d99f5951c4467
BLAKE2b-256 af5c01c2133634c3115563e01e0f25eb9c04c1a4c6f53ee91d7364737c29fe8f

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 db5ca82eb1c5c14bf99562b5d0297e7109ec54861eb554e15086e322ad6a2e17
MD5 f2178f88cd3f2083746cf633c85cab68
BLAKE2b-256 51a0959d56cb0194a2d045ab5c956796ae03f1fc86836235a59539e1f1e516a6

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 4dc40f22bfa116c8196f3d89cb259da6be8960050bbaf8bb9ca52cae9e860be3
MD5 a374d9e33c04b38fcbe9ed6edd446b1b
BLAKE2b-256 f841ac1be3d12734e1f500955a3bdc8472627afaf9b07f7faa72d091785450b7

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 80effc80c432621d3784dcde6ed2982333883c8578594866548f324ed0f5fd44
MD5 23644aa43ba914180c1467ae3d39c8c3
BLAKE2b-256 1629302ed6a732fc273fc58e9bd8c539786d738607d071398f4229cf356774fe

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 979723b9e34110b427a2b3719bc035218d603e6b404eb921e306dae161834eac
MD5 74550f6c1ca142298b1b3a4f5fcbbf3d
BLAKE2b-256 9de7f2a41a6750dd2b87d6b67627556fe2f4417fc42e38beafcc9dcfa27eaa0e

See more details on using hashes here.

File details

Details for the file pywiggle-0.1.23-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pywiggle-0.1.23-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 11015b599ba6aba92d9e514bf6828907649b6dd02f896a5c882cfc757f88c2bd
MD5 30cedc732793987cda31071ada9b8e5b
BLAKE2b-256 657b8dcaa93ed362730901fa6b8abd06253a559f1c089fd854cca5ae037054c8

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 Sentry Error logging StatusPage Status page