dsigma.physics module¶
Physics functions for the dsigma pipeline.
- dsigma.physics.critical_surface_density(z_l, z_s, cosmology=None, comoving=True, d_l=None, d_s=None)[source]¶
Compute the critical surface density.
- Parameters:
- z_l
floatornumpy.ndarray Redshift of lens.
- z_s
floatornumpy.ndarray Redshift of source.
- cosmology
astropy.cosmologyorNone,optional Cosmology to assume for calculations. Only used if comoving distances are not passed. If
None, usedsigma.default_cosmology. Default isNone.- comovingbool,
optional Flag for using comoving instead of physical units. Default is
True.- d_l
astropy.units.quantity.Quantity,optional Comoving transverse distance to the lens. If not given, it is calculated from the redshift provided. Default is
None.- d_s
astropy.units.quantity.Quantity,optional Comoving transverse distance to the source. If not given, it is calculated from the redshift provided. Default is
None.
- z_l
- Returns:
- sigma_crit
astropy.units.quantity.Quantity Critical surface density for each lens-source pair.
- sigma_crit
- dsigma.physics.effective_critical_surface_density(z_l, z_s, n_s, cosmology=None, comoving=True)[source]¶
Compute the effective critical surface density.
- Parameters:
- z_l
floatornumpy.ndarray Redshift of lens.
- z_s
numpy.ndarray Redshifts of sources.
- n_s
numpy.ndarray Fraction of source galaxies in each redshift bin. Does not need to be normalized.
- cosmology
astropy.cosmologyorNone,optional Cosmology to assume for calculations. If
None, usedsigma.default_cosmology. Default isNone.- comovingbool,
optional Flag for using comoving instead of physical units. Default is
True.
- z_l
- Returns:
- sigma_crit_eff
astropy.units.quantity.Quantity Effective critical surface density for the lens redshift given the source redshift distribution. Has the same length as z_l.
- sigma_crit_eff
- dsigma.physics.lens_magnification_shear_bias(theta, alpha_l, z_l, z_s, cosmology=None, sigma_8=0.82, n_s=0.96, n_z=10, n_ell=1000, bessel_function_zeros=100, k_max=1000.0)[source]¶
Compute the lens magnification bias to the mean tangential shear.
This function is based on equations (13) and (14) in Unruh et al. (2020).
- Parameters:
- theta
float,numpy.ndarrayorastropy.units.quantity.Quantity Angular separation \(\theta\) from the lens sample. If it has no unit, assume the value is given in radians.
- alpha_l
float Local slope of the flux distribution of lenses near the flux limit.
- z_l
floatornumpy.ndarray Redshift of lens. Can also be a array if
thetais an array.- z_s
floatornumpy.ndarray Redshift of source. Can also be a array if
thetais an array.- cosmology
astropy.cosmologyorNone,optional Cosmology to assume for calculations. If
None, usedsigma.default_cosmology. Default isNone.- sigma_8
float,optional Scale of fluctuations at \(8 h^{-1} \, \mathrm{Mpc}\). Default is 0.82.
- n_s
float,optional Primordial power spectrum index. Default is 0.96.
- n_z
int,optional Number of redshift bins used in the integral. Larger numbers will be more accurate. Default is 10.
- n_ell
int,optional Number of \(\ell\) bins used in the integral. Larger numbers will be more accurate. Default is 1000.
- bessel_function_zeros
int,optional The calculation involves an integral over the second order Bessel function \(J_2 (\ell \theta)\) from \(\ell = 0\) to \(\ell = \infty\). In practice, this function replaces the upper bound with the bessel_function_zeros-th zero point of the Bessel function. Larger number should lead to more accurate results. However, in practice, this also requires larger n_ell. Particularly, n_ell should never fall below bessel_function_zeros. Default is 100.
- k_max
float,optional The maximum wavenumber (in \(\mathrm{Mpc}^{-1}\)) beyond which the power spectrum is assumed to be 0. Default is 100.
- theta
- Returns:
- gt
floatornumpy.ndarray Bias in the mean tangential shear due to lens magnification effects.
- gt
- dsigma.physics.mpc_per_degree(z, cosmology=None, comoving=False)[source]¶
Calculate the conversion factor between angular and physical scales.
- Parameters:
- z
floatornumpy.ndarray Redshift of the object.
- cosmology
astropy.cosmologyorNone,optional Cosmology to use for calculation. If
None, usedsigma.default_cosmology. Default isNone.- comovingbool,
optional Use comoving distance instead of physical distance when
True. Default isFalse.
- z
- Returns:
- factor
astropy.units.quantity.Quantity Conversion factor.
- factor