dsf.covariance.ingredients.geometry module

Geometry ingredients for Delta Sigma covariance calculations.

This module converts tomographic redshift-bin metadata and cosmology into the geometry quantities needed by the Delta Sigma covariance blocks.

Bin edges and redshift distributions are supplied by the tomography layer. This module then computes cosmology-dependent distances, line-of-sight depths, survey volumes, effective distances, and lens number densities.

dsf.covariance.ingredients.geometry.delta_pi_from_window(pi, window, *, squared)[source]

Return a line-of-sight window integral.

Parameters:
  • pi (NDArray[float64]) – Line-of-sight separation grid in Mpc / h.

  • window (NDArray[float64]) – Dimensionless window evaluated on pi.

  • squared (bool) – Whether to integrate the squared window.

Returns:

Integrated line-of-sight window factor in Mpc / h.

Return type:

float

dsf.covariance.ingredients.geometry.delta_pi_gg_from_edges(cosmo, *, z_min, z_max)[source]

Return the line-of-sight width of a lens redshift bin.

Parameters:
  • cosmo (Cosmology) – CCL cosmology object.

  • z_min (float) – Lower lens-bin redshift edge.

  • z_max (float) – Upper lens-bin redshift edge.

Returns:

Comoving line-of-sight width in Mpc / h.

Return type:

float

dsf.covariance.ingredients.geometry.delta_pi_gm_factors(cosmo, *, z_lens, nz_lens, z_source, nz_source, z_min, z_max, z_center, pi=None, gm_window=None)[source]

Return line-of-sight factors for Delta Sigma gm covariance blocks.

Parameters:
  • cosmo (Cosmology) – CCL cosmology object.

  • z_lens (NDArray[float64]) – Lens redshift grid.

  • nz_lens (NDArray[float64]) – Normalized lens redshift distribution.

  • z_source (NDArray[float64]) – Source redshift grid.

  • nz_source (NDArray[float64]) – Normalized source redshift distribution.

  • z_min (float) – Lower lens-bin redshift edge.

  • z_max (float) – Upper lens-bin redshift edge.

  • z_center (float) – Effective or central lens redshift.

  • pi (NDArray[float64] | None) – Optional line-of-sight separation grid in Mpc / h.

  • gm_window (NDArray[float64] | None) – Optional galaxy-matter lensing window evaluated on pi.

Returns:

The gm x gm and gm x gg line-of-sight factors in Mpc / h.

Return type:

tuple[float, float]

dsf.covariance.ingredients.geometry.delta_pi_gm_from_window(pi, window)[source]

Return the squared line-of-sight window factor for gm x gm.

Parameters:
  • pi (NDArray[float64]) – Line-of-sight separation grid in Mpc / h.

  • window (NDArray[float64]) – Dimensionless lensing window evaluated on pi.

Returns:

Squared-window line-of-sight factor in Mpc / h.

Return type:

float

dsf.covariance.ingredients.geometry.delta_pi_gm_gg_from_window(pi, window, *, pi_min, pi_max)[source]

Return the line-of-sight overlap factor for gm x gg.

Parameters:
  • pi (NDArray[float64]) – Line-of-sight separation grid in Mpc / h.

  • window (NDArray[float64]) – Dimensionless lensing window evaluated on pi.

  • pi_min (float) – Lower line-of-sight limit in Mpc / h.

  • pi_max (float) – Upper line-of-sight limit in Mpc / h.

Returns:

Cross-window line-of-sight factor in Mpc / h.

Return type:

float

dsf.covariance.ingredients.geometry.effective_comoving_distance(cosmo, z, nz)[source]

Return the effective comoving distance of a tomographic sample.

Parameters:
  • cosmo (Cosmology) – CCL cosmology object.

  • z (NDArray[float64]) – Redshift grid.

  • nz (NDArray[float64]) – Normalized redshift distribution evaluated on z.

Returns:

Mean comoving radial distance in Mpc / h.

Return type:

float

dsf.covariance.ingredients.geometry.gm_lensing_window(cosmo, *, z_lens, nz_lens, z_source, nz_source, pi=None, pi_min=0.1, pi_max=3000.0, n_pi=4000, z_interp_max=None, n_z_interp=10000)[source]

Return the galaxy-matter lensing line-of-sight window.

The returned window is the dimensionless W(Pi) factor used for the gm x gm and gm x gg Delta Sigma covariance line-of-sight integrals. It follows the same structure as the legacy calculation: average Sigma_crit^{-1} over source redshifts at displaced lens positions, average that quantity over the lens redshift distribution, and multiply by the effective Sigma_crit normalization for the lens-source pair.

Parameters:
  • cosmo (Cosmology) – CCL cosmology object.

  • z_lens (NDArray[float64]) – Lens redshift grid.

  • nz_lens (NDArray[float64]) – Normalized lens redshift distribution.

  • z_source (NDArray[float64]) – Source redshift grid.

  • nz_source (NDArray[float64]) – Normalized source redshift distribution.

  • pi (NDArray[float64] | None) – Optional line-of-sight separation grid in Mpc / h. If not supplied, a symmetric logarithmic grid from -pi_max to pi_max is built.

  • pi_min (float) – Minimum positive line-of-sight separation used when building the default grid.

  • pi_max (float) – Maximum positive line-of-sight separation used when building the default grid.

  • n_pi (int) – Number of positive grid points used when building the default grid.

  • z_interp_max (float | None) – Optional maximum redshift used for the distance-redshift interpolation.

  • n_z_interp (int) – Number of redshift points used for the interpolation.

Returns:

Tuple containing the line-of-sight grid in Mpc / h and the dimensionless lensing window evaluated on that grid.

Return type:

tuple[ndarray, ndarray]

dsf.covariance.ingredients.geometry.lens_number_density_3d_from_angular_density(cosmo, *, n_lens_arcmin2, z_min, z_max, area_deg2)[source]

Return the three-dimensional lens number density for a redshift bin.

Parameters:
  • cosmo (Cosmology) – CCL cosmology object.

  • n_lens_arcmin2 (float) – Angular number density of lenses in arcmin^-2.

  • z_min (float) – Lower lens-bin redshift edge.

  • z_max (float) – Upper lens-bin redshift edge.

  • area_deg2 (float) – Survey area in square degrees.

Returns:

Comoving lens number density in (h / Mpc)^3.

Return type:

float

dsf.covariance.ingredients.geometry.pi_limits_from_lens_edges(cosmo, *, z_min, z_max, z_center)[source]

Return line-of-sight limits relative to a central lens redshift.

Parameters:
  • cosmo (Cosmology) – CCL cosmology object.

  • z_min (float) – Lower lens-bin redshift edge.

  • z_max (float) – Upper lens-bin redshift edge.

  • z_center (float) – Effective or central lens redshift.

Returns:

Lower and upper line-of-sight limits in Mpc / h.

Return type:

tuple[float, float]

dsf.covariance.ingredients.geometry.survey_volume_from_edges(cosmo, *, z_min, z_max, area_deg2)[source]

Return the comoving survey volume of a redshift shell.

Parameters:
  • cosmo (Cosmology) – CCL cosmology object.

  • z_min (float) – Lower redshift edge.

  • z_max (float) – Upper redshift edge.

  • area_deg2 (float) – Survey area in square degrees.

Returns:

Comoving shell volume in (Mpc / h)^3.

Return type:

float