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.

Metadata

Release files for pywiggle 0.1.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywiggle 0.1.26
File Size Uploaded
pywiggle-0.1.26.tar.gz 275.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pywiggle 0.1.26
File
pywiggle-0.1.26-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
pywiggle-0.1.26-cp314-cp314-macosx_13_0_x86_64.whl CPython 3.14 CPython 3.14 macOS 13.0+ x86-64 Details
pywiggle-0.1.26-cp314-cp314-macosx_13_0_arm64.whl CPython 3.14 CPython 3.14 macOS 13.0+ ARM64 Details
pywiggle-0.1.26-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
pywiggle-0.1.26-cp313-cp313-macosx_13_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 13.0+ x86-64 Details
pywiggle-0.1.26-cp313-cp313-macosx_13_0_arm64.whl CPython 3.13 CPython 3.13 macOS 13.0+ ARM64 Details
pywiggle-0.1.26-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
pywiggle-0.1.26-cp312-cp312-macosx_13_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 13.0+ x86-64 Details
pywiggle-0.1.26-cp312-cp312-macosx_13_0_arm64.whl CPython 3.12 CPython 3.12 macOS 13.0+ ARM64 Details
pywiggle-0.1.26-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
pywiggle-0.1.26-cp311-cp311-macosx_13_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 13.0+ x86-64 Details
pywiggle-0.1.26-cp311-cp311-macosx_13_0_arm64.whl CPython 3.11 CPython 3.11 macOS 13.0+ ARM64 Details
pywiggle-0.1.26-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
pywiggle-0.1.26-cp310-cp310-macosx_13_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 13.0+ x86-64 Details
pywiggle-0.1.26-cp310-cp310-macosx_13_0_arm64.whl CPython 3.10 CPython 3.10 macOS 13.0+ ARM64 Details

Total release size: 3.7 MB

Release files / pywiggle-0.1.26.tar.gz

Download URL pywiggle-0.1.26.tar.gz
Size 275.3 kB
Tags Source
SHA-256 checksum
How to use checksums
de0aec538e7e2a9947657e39077c41e6cfe818dee46420be829fa5cfb56868cb
BLAKE2b-256 checksum
How to use checksums
34f28ea61a3d32f46f37c7013d9b14199046c1b05b970ea633d5931b91e66b68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pywiggle-0.1.26-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 315.5 kB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dae39c18ef9f1923e9fd43cd1f61d10299b53d8266a93f7e1a222d3d155ebe2a
BLAKE2b-256 checksum
How to use checksums
cef8d6343f2b713c024b925bf9bedbb92613028c6029312d3a186ac27f1d2438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp314-cp314-macosx_13_0_x86_64.whl

Download URL pywiggle-0.1.26-cp314-cp314-macosx_13_0_x86_64.whl
Size 190.4 kB
Tags CPython 3.14 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
d7b2c63106287349d0e0f2099054352d76a44dbb886ea0b294aa1a95a939ab80
BLAKE2b-256 checksum
How to use checksums
a749a639d647a473202b06d18abb085d02f2be4202824143cdd31c31cf89aef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp314-cp314-macosx_13_0_arm64.whl

Download URL pywiggle-0.1.26-cp314-cp314-macosx_13_0_arm64.whl
Size 186.1 kB
Tags CPython 3.14 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
c2f49f84e094f79f827870617fdf64f789e8c4eb0ddf61ef11a0b37732fffaee
BLAKE2b-256 checksum
How to use checksums
802ea69124f38596185a90e0c3c50cd57bda8daf26cd6e6dce454ac76717c17e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pywiggle-0.1.26-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 315.4 kB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c344bba2753c39707815e7a3c088873f01bc25358d3d6947b93e21ddb429855e
BLAKE2b-256 checksum
How to use checksums
8186ce8d07991821a6ea6346b7e2f6cc9fffddf035e77f40c6ef38d51a6c47ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp313-cp313-macosx_13_0_x86_64.whl

Download URL pywiggle-0.1.26-cp313-cp313-macosx_13_0_x86_64.whl
Size 190.3 kB
Tags CPython 3.13 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
19605dc9998a0d3567d66c4eced0804dd495c759cfc1f5c62ea318b344925632
BLAKE2b-256 checksum
How to use checksums
d681b7f772fee737cf03ef66df2eb6442414ce8ce5857292d06cbf4ec5af9003
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp313-cp313-macosx_13_0_arm64.whl

Download URL pywiggle-0.1.26-cp313-cp313-macosx_13_0_arm64.whl
Size 186.0 kB
Tags CPython 3.13 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
ed5bad350580a00df8e55a195236507ce0cc62e6f8fb02fedbb7c3a89e3e460c
BLAKE2b-256 checksum
How to use checksums
d4eb0add14c37fdaff2947aa04b2901524a972f5992d29c17141fdbfda42c1b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pywiggle-0.1.26-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 315.3 kB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3c9631fe1d746a6e945cd999cbffd03fa4ef85f71d65cc017f5b9f0839f148c4
BLAKE2b-256 checksum
How to use checksums
9712f328b1d9f18bbcaced034b9265ded61f924b205a2eae859d0db10c5d6799
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp312-cp312-macosx_13_0_x86_64.whl

Download URL pywiggle-0.1.26-cp312-cp312-macosx_13_0_x86_64.whl
Size 190.3 kB
Tags CPython 3.12 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
64a6bfcfdc643bddf8f131ec96ad1a14ec640afc95ae413cefcf0cbc81d322a6
BLAKE2b-256 checksum
How to use checksums
cac145c905ccb0f4273f6b3fcf13e355ca61d1f468875bc6329f138274047945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp312-cp312-macosx_13_0_arm64.whl

Download URL pywiggle-0.1.26-cp312-cp312-macosx_13_0_arm64.whl
Size 185.9 kB
Tags CPython 3.12 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
955237d5539f3133a2e21e418c018b284fa1ca64ec1fdf3a1f8058018adcbebc
BLAKE2b-256 checksum
How to use checksums
9c91f2de964fbbe0f145e2287a1cc4abd80de672e136f2bf360c5e81f93bbfca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pywiggle-0.1.26-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 312.7 kB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6637303733142d18a3ccef4b5dcf01e99a0ba4642cb3910c66d85280a2f5552d
BLAKE2b-256 checksum
How to use checksums
667f9d5116292c8408f1233adf46148902618f7d01fa9000a2497f2e8edf6fec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp311-cp311-macosx_13_0_x86_64.whl

Download URL pywiggle-0.1.26-cp311-cp311-macosx_13_0_x86_64.whl
Size 188.4 kB
Tags CPython 3.11 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
81946fbda35f99c68d5b3bcb3e64b12bedf46f14c1e53e7870277af0e2315fc2
BLAKE2b-256 checksum
How to use checksums
b0aac97dde4057e6f7711fca0073f8f56593a8a0d5895636547f7cf82c2d8d32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp311-cp311-macosx_13_0_arm64.whl

Download URL pywiggle-0.1.26-cp311-cp311-macosx_13_0_arm64.whl
Size 183.6 kB
Tags CPython 3.11 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
f37c5e6b985f75d820b93dce3ebfd9ba85915caae25cec987f4c78da312b4ef6
BLAKE2b-256 checksum
How to use checksums
629c649a21565ac6fb9589451c1abfee633a47bbf3869a93b1f86c4f0bf67dbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pywiggle-0.1.26-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 311.8 kB
Tags CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
58bcdd4a0f5723f44718defe84ce539e5adb4d5a2e68abfae9c9a10b223bf732
BLAKE2b-256 checksum
How to use checksums
1fcd2ea704d6832e3bafb282a9f1e407ce9388e8f99dba6fee5add5e23672ce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp310-cp310-macosx_13_0_x86_64.whl

Download URL pywiggle-0.1.26-cp310-cp310-macosx_13_0_x86_64.whl
Size 187.0 kB
Tags CPython 3.10 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
b917798c0a2b975782982f8356a792ca80fb8aa3988aaeb495c087737b639776
BLAKE2b-256 checksum
How to use checksums
f81c92e9972ee7e18ec6783cb24fc0eb939b393e784de8577c7d7ce7908ce3cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pywiggle-0.1.26-cp310-cp310-macosx_13_0_arm64.whl

Download URL pywiggle-0.1.26-cp310-cp310-macosx_13_0_arm64.whl
Size 182.3 kB
Tags CPython 3.10 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
838ea89d0b1aeb669aa05576acc71dcb569503cc81b69894ff1cfc91e27f7b31
BLAKE2b-256 checksum
How to use checksums
5ddc90ba62f06870eaacfc35dbbb0a30111737987b7fd97090e14f1efa5c7132
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.26 This release

16 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page