dsf.covariance.ingredients.cov_blocks module

Covariance blocks for projected DeltaSigma observables.

This module provides covariance terms for DeltaSigma data vectors built from galaxy-matter and galaxy-galaxy projected correlations. The functions return auto- and cross-covariance blocks for lensing-style gm measurements, clustering-style gg measurements, and their joint covariance matrix.

The inputs are assumed to describe a single lens/source bin pair or an effective lens-bin average: a matter power spectrum, survey-volume factors, line-of-sight window integrals, noise terms, and the projected-radius binning used by the DeltaSigma data vector.

Optional tapering applies a smooth window to the low- and high-wavenumber edges of the input spectra before projection. This reduces numerical ringing from finite k coverage and makes the Hankel-projected covariance less sensitive to abrupt power-spectrum cutoffs.

dsf.covariance.ingredients.cov_blocks.delta_sigma_gg_covariance(hankel, k, pk, *, galaxy_bias, rho_crit, delta_pi_gg, shot_noise, volume, rp_bin_edges=None, order=2, taper=True, taper_kwargs=None)[source]

Return the auto-covariance of the galaxy-galaxy DeltaSigma-like signal.

This block describes the uncertainty of the clustering-style projected galaxy-density measurement written in DeltaSigma units. It is controlled by the lens galaxy auto-power spectrum, lens shot noise, the line-of-sight depth of the lens bin, and the effective survey volume.

Parameters:
  • hankel (HankelTransform) – Hankel transform object used to project Fourier-space covariance terms into projected-radius space.

  • k (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Wavenumber grid in h / Mpc.

  • pk (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Lens-averaged matter power spectrum evaluated on k.

  • galaxy_bias (float) – Linear galaxy bias of the lens sample.

  • rho_crit (float) – Critical density factor used to express the projected clustering covariance in DeltaSigma-like units.

  • delta_pi_gg (float) – Line-of-sight width or window factor for the galaxy-galaxy covariance block.

  • shot_noise (float) – Lens shot-noise contribution.

  • volume (float) – Effective survey volume for the lens bin.

  • rp_bin_edges (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...] | None) – Optional projected-radius bin edges for the final covariance.

  • order (int) – Bessel order associated with the projected statistic.

  • taper (bool) – Whether to smoothly suppress the edges of the input k range before projection. This reduces artificial oscillations in projected-radius space caused by the finite Fourier-space range.

  • taper_kwargs (dict | None) – Optional taper window settings. Accepted keys are low_k_lower, low_k_upper, large_k_lower, and large_k_upper. If not provided, default windows are chosen from the first and last values of k.

Returns:

Projected radii and the gg x gg DeltaSigma covariance matrix.

Return type:

tuple[ndarray, ndarray]

dsf.covariance.ingredients.cov_blocks.delta_sigma_gm_covariance(hankel, k, pk, *, galaxy_bias, omega_m, rho_crit, delta_pi_gm_squared_window, sigma_crit_squared_average, shape_noise, shot_noise, volume, rp_bin_edges=None, order=2, taper=True, taper_kwargs=None, gkgk_taper=False, gkgk_taper_kwargs=None)[source]

Return the auto-covariance of the galaxy-matter DeltaSigma signal.

This block describes the uncertainty of a DeltaSigma measurement from lens galaxy positions and source galaxy shapes. It combines the covariance from lens-density and shear fluctuations with the covariance from their shared matter fluctuations, including lens shot noise, source shape noise, survey volume, and squared line-of-sight window weighting.

Parameters:
  • hankel (HankelTransform) – Hankel transform object used to project Fourier-space covariance terms into projected-radius space.

  • k (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Wavenumber grid in h / Mpc.

  • pk (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Lens-averaged matter power spectrum evaluated on k.

  • galaxy_bias (float) – Linear galaxy bias of the lens sample.

  • omega_m (float) – Present-day matter density parameter.

  • rho_crit (float) – Critical density factor used to convert matter fluctuations into DeltaSigma units.

  • delta_pi_gm_squared_window (float) – Squared line-of-sight window factor for the galaxy-matter auto-covariance.

  • sigma_crit_squared_average (float) – Effective average of \(\Sigma_c^2\) for the lens-source bin pair.

  • shape_noise (float) – Source shape-noise contribution.

  • shot_noise (float) – Lens shot-noise contribution.

  • volume (float) – Effective survey volume for the lens bin.

  • rp_bin_edges (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...] | None) – Optional projected-radius bin edges for the final covariance. If omitted, the covariance is returned on the Hankel radial grid.

  • order (int) – Bessel order associated with the projected DeltaSigma statistic.

  • taper (bool) – Whether to taper the lens-density and shear-fluctuation term before projection.

  • taper_kwargs (dict | None) – Optional taper settings for the lens-density and shear-fluctuation term.

  • gkgk_taper (bool) – Whether to taper the shared matter-fluctuation term before projection.

  • gkgk_taper_kwargs (dict | None) – Optional taper settings for the shared matter-fluctuation term.

Returns:

Projected radii and the gm x gm DeltaSigma covariance matrix.

Return type:

tuple[ndarray, ndarray]

dsf.covariance.ingredients.cov_blocks.delta_sigma_gm_gg_cross_covariance(hankel, k, pk, *, galaxy_bias, omega_m, rho_crit, delta_pi_gm_gg, shot_noise, volume, rp_bin_edges=None, order=2, taper=True, taper_kwargs=None)[source]

Return the cross-covariance between galaxy-matter and galaxy-galaxy signals.

This block describes how fluctuations in the lensing-style DeltaSigma measurement covary with fluctuations in the projected galaxy-density measurement. It couples the galaxy-matter and galaxy-galaxy power-spectrum terms through the shared lens density field and the relevant line-of-sight window overlap.

Parameters:
  • hankel (HankelTransform) – Hankel transform object used to project Fourier-space covariance terms into projected-radius space.

  • k (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Wavenumber grid in h / Mpc.

  • pk (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Lens-averaged matter power spectrum evaluated on k.

  • galaxy_bias (float) – Linear galaxy bias of the lens sample.

  • omega_m (float) – Present-day matter density parameter.

  • rho_crit (float) – Critical density factor used to convert matter fluctuations into DeltaSigma units.

  • delta_pi_gm_gg (float) – Line-of-sight overlap factor between the gm and gg covariance terms.

  • shot_noise (float) – Lens shot-noise contribution.

  • volume (float) – Effective survey volume for the lens bin.

  • rp_bin_edges (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...] | None) – Optional projected-radius bin edges for the final covariance.

  • order (int) – Bessel order associated with the projected statistic.

  • taper (bool) – Whether to smoothly suppress the edges of the input k range before projection. This reduces artificial oscillations in projected-radius space caused by the finite Fourier-space range.

  • taper_kwargs (dict | None) – Optional taper window settings. Accepted keys are low_k_lower, low_k_upper, large_k_lower, and large_k_upper. If not provided, default windows are chosen from the first and last values of k.

Returns:

Projected radii and the gm x gg DeltaSigma cross-covariance matrix.

Return type:

tuple[ndarray, ndarray]

dsf.covariance.ingredients.cov_blocks.joint_delta_sigma_covariance(cov_gm_gm, cov_gg_gg, cov_gm_gg)[source]

Return the joint covariance matrix for gm and gg DeltaSigma data.

The output matrix is ordered with the galaxy-matter DeltaSigma data vector first and the galaxy-galaxy DeltaSigma-like data vector second. The off-diagonal blocks contain the cross-covariance between the two projected observables.

Parameters:
  • cov_gm_gm (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Auto-covariance block for the galaxy-matter DeltaSigma signal.

  • cov_gg_gg (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Auto-covariance block for the galaxy-galaxy DeltaSigma-like signal.

  • cov_gm_gg (ndarray[tuple[Any, ...], dtype[float64]] | list[float] | tuple[float, ...]) – Cross-covariance block between the gm and gg signals.

Returns:

Joint block covariance matrix ordered as [DeltaSigma_gm, DeltaSigma_gg].

Return type:

ndarray