lfkit.photometry.lf_redshift_density module#

Luminosity-function redshift-density utilities.

This module provides helpers for converting a luminosity function callable into an LF-integrated redshift-density curve.

The core operation is

n_lf(z) = int phi(M, z) dM

over the observable absolute magnitude range implied by an apparent magnitude limit. A second helper multiplies this LF-integrated density by a user-supplied redshift or volume weight.

The cosmology-dependent distance and volume pieces are supplied as callables. This keeps the interface independent of CCL, Astropy, or any other cosmology backend, which is useful for downstream packages such as Binny.

Magnitude corrections are supplied as scalar or array-like values evaluated on the same redshift grid.

lfkit.photometry.lf_redshift_density.lf_integrated_number_density(z, lf, *, m_lim, m_bright, n_m=512, luminosity_distance_mpc_fn, k_correction=None, evolution_correction=None)[source]#

Return LF-integrated number density as a function of redshift.

This computes

\[n_{\mathrm{LF}}(z) = \int_{M_{\mathrm{bright}}}^{M_{\mathrm{lim}}(z)} \phi(M, z)\,dM,\]

where M_lim(z) is the absolute magnitude limit implied by the apparent magnitude cut m_lim.

The magnitude conversion follows

\[M_{\mathrm{lim}}(z) = m_{\mathrm{lim}} - \mu(z) - K(z) + E(z),\]

where mu is the distance modulus, K is the k-correction, and E is the evolution correction.

Parameters:
  • z (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Redshift value or array-like of redshift values.

  • lf (Callable[[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]], ndarray[tuple[Any, ...], dtype[float64]]]) – Luminosity-function callable with signature lf(M, z).

  • m_lim (float) – Apparent magnitude limit of the catalog.

  • m_bright (float) – Bright absolute magnitude integration bound.

  • n_m (int) – Number of magnitude-grid points used for the integral.

  • luminosity_distance_mpc_fn (Callable[[ndarray[tuple[Any, ...], dtype[float64]]], ndarray[tuple[Any, ...], dtype[float64]]]) – Callable returning luminosity distance in Mpc as a function of redshift.

  • k_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional scalar or array-like k-correction values.

  • evolution_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional scalar or array-like evolution-correction values.

Returns:

NumPy array of LF-integrated number densities evaluated at z.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

lfkit.photometry.lf_redshift_density.lf_weighted_redshift_density(z, lf, *, m_lim, m_bright, n_m=512, luminosity_distance_mpc_fn, volume_weight_fn, k_correction=None, evolution_correction=None, normalize=True)[source]#

Return an LF-weighted redshift-density curve.

This computes

\[n(z) \propto W(z) \int_{M_{\mathrm{bright}}}^{M_{\mathrm{lim}}(z)} \phi(M, z)\,dM,\]

where W(z) is supplied by volume_weight_fn.

Parameters:
  • z (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Redshift value or array-like of redshift values.

  • lf (Callable[[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]], ndarray[tuple[Any, ...], dtype[float64]]]) – Luminosity-function callable with signature lf(M, z).

  • m_lim (float) – Apparent magnitude limit of the catalog.

  • m_bright (float) – Bright absolute magnitude integration bound.

  • n_m (int) – Number of magnitude-grid points used for the integral.

  • luminosity_distance_mpc_fn (Callable[[ndarray[tuple[Any, ...], dtype[float64]]], ndarray[tuple[Any, ...], dtype[float64]]]) – Callable returning luminosity distance in Mpc as a function of redshift.

  • volume_weight_fn (Callable[[ndarray[tuple[Any, ...], dtype[float64]]], ndarray[tuple[Any, ...], dtype[float64]]]) – Callable returning the redshift or volume weight.

  • k_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional scalar or array-like k-correction values.

  • evolution_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional scalar or array-like evolution-correction values.

  • normalize (bool) – If True, normalize the returned curve to integrate to one over z.

Returns:

NumPy array of LF-weighted redshift-density values.

Return type:

ndarray[tuple[Any, …], dtype[float64]]