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.25.tar.gz (274.9 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.25-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.25-cp314-cp314-macosx_13_0_x86_64.whl (187.7 kB view details)

Uploaded CPython 3.14macOS 13.0+ x86-64

pywiggle-0.1.25-cp314-cp314-macosx_13_0_arm64.whl (184.1 kB view details)

Uploaded CPython 3.14macOS 13.0+ ARM64

pywiggle-0.1.25-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.25-cp313-cp313-macosx_13_0_x86_64.whl (187.5 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

pywiggle-0.1.25-cp313-cp313-macosx_13_0_arm64.whl (184.0 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

pywiggle-0.1.25-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.25-cp312-cp312-macosx_13_0_x86_64.whl (187.4 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pywiggle-0.1.25-cp312-cp312-macosx_13_0_arm64.whl (183.9 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

pywiggle-0.1.25-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.25-cp311-cp311-macosx_13_0_x86_64.whl (185.5 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pywiggle-0.1.25-cp311-cp311-macosx_13_0_arm64.whl (181.7 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

pywiggle-0.1.25-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.25-cp310-cp310-macosx_13_0_x86_64.whl (184.1 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pywiggle-0.1.25-cp310-cp310-macosx_13_0_arm64.whl (180.4 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

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

File metadata

  • Download URL: pywiggle-0.1.25.tar.gz
  • Upload date:
  • Size: 274.9 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.25.tar.gz
Algorithm Hash digest
SHA256 2790d6d75a0e877e424117c5185710ed84175d24ac80cff7eb54941f7e732478
MD5 6b38efc5bac2f0ba9e25ef8fdd0ecb2d
BLAKE2b-256 2932b54f2121aa5f930e124eb85091f9b8988727ed5b1e841a1cc744a913c54f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ade60372b422906d2e6062518dc921f1be09f156d1294fe85d8bfde3d87fce51
MD5 3b6b80d15d65b29750c3f53ab2f0548e
BLAKE2b-256 557b80a02a7487a3996758b1c84d23108bb0c532100586a9ac9c3513675275f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp314-cp314-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1fed74377e0e25229d5a958313454de6cd31d9b480ac497cd267f2e2d4c4721e
MD5 3cf0e27cde85a0b939255e8c76782cd7
BLAKE2b-256 40aabbec2e79f85c47f77f228521786cf5676765e89109fa5f6b1b24ed35843e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp314-cp314-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 616ac82a535edfddebcf11cbbd168e4cdd6f11c67957cca3050a82dc37c3e7d9
MD5 9446d72a067db27a86931e07d9589164
BLAKE2b-256 140f3a37e4ebb2d6869ba9a8d4d7761826264a82fc016992b5ca528c068b8d8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b8cde02938b9b34a29015498dd49c498f5cc445092cccb3b1d69efdfe31096d5
MD5 4235543d9b8801bfa51d649d47f5e460
BLAKE2b-256 54ebab86a42ca80e30ae30632f52cd00e9e7d33190771a0926ad61b12db4f2c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f22d2e4237c8aadfa2c8e363096ff3bd470438ecd1838680d23f03f7771d0716
MD5 ed81b4fa8786494fbc51d6c853f20c0b
BLAKE2b-256 fdc2e30e628d38b5eefbe7dc54cb8ac4fa93c0184a5953291ded5d3b8ae7e838

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ca652aa940e40fdd0a716ed2cd2ec8d7a7f288abc19bf9f7284f95c3b6f89b91
MD5 10a5f837a9e5502d510c4b6771ec22bf
BLAKE2b-256 9ddf3f1a0fbf0bfd324657dd41a15ef929cf8cc777c7b67e512afa12f9af71da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c2ab59706d704406d8be2e83af980f7b8787ff580ee6f2656376d8a6f90ea4cb
MD5 9cf33585300fd7513c44dcb43c66138d
BLAKE2b-256 76073cc2039db83f12cecb231d94e313f30874bd9c0b7f0a739a94d7d68519ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 af18bbe7a81563dde5a579b90b1d20a95494f60b92c042c2538b060ab8e6b24b
MD5 dac4ec2e20530b991724dfab35cfbb9a
BLAKE2b-256 38e7dac34a7976a0acc6b1f21567187f7d1944c6f7de53aeaedaff4724cd0726

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 1f809ef89a5b9bfe801dc2e6e03cd33df629ec045f682f99a9e8dc578577af5a
MD5 cb01574d6edb254740082121abac0ace
BLAKE2b-256 33f3596a3fe390aa88a348e2618b7f995ab95a73edd6596dd11623a35edb094d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb1be0d4a8e98199f2f6e3e2b796d711c3ab906dfa15a2cf6f9372a15b6a85cb
MD5 57f7c5f1896808cf1fb609325b898687
BLAKE2b-256 b58a6c176e4239b3b61da88829ad0086aff8ad2691e90b57871b14cccad4d9aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 47c68235ce92def25527900e5a090abe9af61f3ce2c8068e4e5e57ae5758517e
MD5 37fc46491646e7c76939611a2cad3695
BLAKE2b-256 39aa1dee43ce3e5ae55eeb00cc4464400c5832437841dade43d2bbce04cf7780

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 cc54818890971510042b7057a7a8f14b6bb8073d2242f1c30d9e1a287fd711ec
MD5 617b3a9c63f430ded39ac8d3b039a507
BLAKE2b-256 2ed86258fb36e898a8be1690489773bc73644bfd2c4151c424cc53fb25b1759d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1609823d7bee5cc82e691f82b1fdaaf4d8ed1942852cf995994e9fea31663be5
MD5 a37cd4dcf8c430edc024f64ec28ba5d4
BLAKE2b-256 3c6e45cedd06c621905fbd13c153435d1e24ab4a3f5eb4123c4011f146d5cba3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 80a6ff6a2720ec8039109a02cd2a2ad25486b7b17070db721284a0e4fc707e08
MD5 2bcc888d505e7ecbd2b633d42ad0c7bc
BLAKE2b-256 380f4fcd0656346a75b4c4d2be9cee9ef0e2a6a9b61d5f437b8b716d4d3e7a53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pywiggle-0.1.25-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 b296f65139f192ecee6341298b1492648ccdd36c0d6f0ec34f23027cebec3843
MD5 97a171ec2b11cf06842f1ebd26d8a88c
BLAKE2b-256 c9cd6cd6ad61eb8e33618acb7789ff4af2616dc7fa7ca235de996ca378cc2f30

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