Power spectra
Warning
This module is in active development. Results and APIs have not been validated against literature reference data and may change without notice. Do not use for scientific analysis.
Angular power spectrum C_ℓ via healpy pseudo-Cl estimator.
- sum_stat.powspec.angular_cl.cl_angular(gal, nside, ell_bins, mask=None, use_master_correction=False)[source]
Angular power spectrum C_ℓ of a galaxy overdensity map.
The galaxy catalogue is pixelised onto a HEALPix map at resolution
nside, converted to an overdensity field δ = n/n̄ − 1 (weighted by galaxy weights), and the pseudo-Cl is estimated viahealpy.anafast. Shot noise is subtracted analytically.- Parameters:
gal (GalaxyCatalogue) – Galaxy catalogue (ra, dec, weight required).
nside (int) – HEALPix resolution (power of 2, e.g. 512 or 1024).
ell_bins (ndarray, shape (n_bins+1,)) – Multipole bin edges (integers).
mask (ndarray, shape (n_pix,), optional) – HEALPix binary or apodised mask. Defaults to a mask derived from occupied pixels.
use_master_correction (bool) – Apply an analytical MASTER correction for the mask (approximate).
- Returns:
ell_eff (ndarray, shape (n_bins,)) – Effective multipole per bin (simple mean).
cl (ndarray, shape (n_bins,)) – Angular power spectrum [sr].
nl (ndarray, shape (n_bins,)) – Shot noise power spectrum [sr].
cov (ndarray, shape (n_bins, n_bins)) – Gaussian covariance of C_ℓ (diagonal, approximate).
Performance
———–
~500 ms/call (N_gal=1e5, nside=512, CPU x86-64)
- Parameters:
gal (GalaxyCatalogue)
nside (int)
ell_bins (ndarray)
mask (ndarray | None)
use_master_correction (bool)
- Return type:
3D power spectrum P(k) and multipoles P_ℓ(k).
Uses a direct FFT estimator with FKP weighting when a random catalogue is available, or a simple Fourier transform for periodic-box catalogues.
- sum_stat.powspec.pk3d.pk3d(gal, cosmo, k_bins, rand=None, n_grid=256, box_size=None)[source]
3D power spectrum P(k) from a galaxy catalogue.
Uses a direct FFT approach. When
randis provided, FKP optimal weights are approximated. For periodic boxes setrand=Noneand providebox_size.- Parameters:
gal (GalaxyCatalogue) – Galaxy catalogue.
cosmo (FlatLambdaCDM) – Cosmology for redshift-distance conversion.
k_bins (ndarray, shape (n_k+1,)) – Wavenumber bin edges [h/Mpc].
rand (GalaxyCatalogue, optional) – Random catalogue for shot-noise subtraction. If None, uses Poisson shot noise (1/n̄).
n_grid (int) – FFT grid size per dimension.
box_size (float, optional) – Box side length [Mpc]. Estimated from the catalogue extent if None.
- Returns:
k_centres (ndarray, shape (n_k,)) – Wavenumber bin centres [h/Mpc].
pk (ndarray, shape (n_k,)) – Power spectrum [Mpc/h]^3.
n_modes (ndarray, shape (n_k,)) – Number of Fourier modes per bin.
Performance
———–
~2 s/call (N_gal=1e4, n_grid=128, n_k=20, CPU x86-64)
- Parameters:
gal (GalaxyCatalogue)
cosmo (FlatLambdaCDM)
k_bins (ndarray)
rand (GalaxyCatalogue | None)
n_grid (int)
box_size (float | None)
- Return type:
- sum_stat.powspec.pk3d.pk_multipoles(gal, cosmo, k_bins, rand=None, ells=(0, 2, 4), n_grid=256, box_size=None, n_mu_bins=100)[source]
Power spectrum multipoles P_ℓ(k) via Legendre decomposition.
Computes P(k, μ) on a 2D grid and decomposes into Legendre multipoles using the same JAX kernel as the 2PCF multipoles.
- Parameters:
gal (GalaxyCatalogue) – Galaxy catalogue.
cosmo (FlatLambdaCDM) – Cosmology for redshift-distance conversion.
k_bins (ndarray, shape (n_k+1,)) – Wavenumber bin edges [h/Mpc].
rand (GalaxyCatalogue, optional) – Random catalogue for shot-noise subtraction.
ells (tuple of int) – Multipole orders, default (0, 2, 4).
n_grid (int) – FFT grid size per dimension.
box_size (float, optional) – Box side length [Mpc].
n_mu_bins (int) – Number of μ = k_∥/k bins.
- Returns:
k_centres (ndarray, shape (n_k,)) – Wavenumber bin centres [h/Mpc].
pk_dict (dict[int, ndarray]) – Keys are ell; values shape (n_k,) [Mpc/h]^3.
Performance
———–
~5 s/call (N_gal=1e4, n_grid=128, n_k=20, n_mu=50, CPU x86-64)
- Parameters:
gal (GalaxyCatalogue)
cosmo (FlatLambdaCDM)
k_bins (ndarray)
rand (GalaxyCatalogue | None)
n_grid (int)
box_size (float | None)
n_mu_bins (int)
- Return type: