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.
- d_l
floatornumpy.ndarray Comoving transverse distance to the lens. If not given, it is calculated from the redshift provided.
- d_s
floatornumpy.ndarray Comoving transverse distance to the source. If not given, it is calculated from the redshift provided.
- z_l
- Returns:
- sigma_crit
floatornumpy.ndarray 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 unit.
- z_l
- Returns:
- sigma_crit_eff
floatornumpy.ndarray Effective critical surface density for the lens redshift given the source redshift distribution.
- sigma_crit_eff
- dsigma.physics.lens_magnification_shear_bias(theta, alpha_l, z_l, z_s, camb_results, n_z=10, n_ell=200, 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
floatorastropy.units.quantity.Quantity Angular separation \(\theta\) from the lens sample. If not quantity is given, the separation is assumed to be in radians.
- alpha_l
float Local slope of the flux distribution of lenses near the flux limit.
- z_l
float Redshift of lens.
- z_s
float Redshift of source.
- camb_results
camb.results.CAMBdata CAMB results object that contains information on cosmology and the matter power spectrum.
- n_z
int,optional Number of redshift bins used in the integral. Larger numbers will be more accurate.
- n_ell
int,optional Number of \(\ell\) bins used in the integral. Larger numbers will be more accurate.
- 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.
- k_max
float,optional The maximum wavenumber beyond which the power spectrum is assumed to be 0.
- theta
- Returns:
- et_lm
float Bias in the mean tangential shear due to lens magnification effects.
- et_lm
- dsigma.physics.mpc_per_degree(z, cosmology=None, comoving=False)[source]¶
Estimate the angular scale in Mpc/degree at certain redshift.
- Parameters:
- cosmology
astropy.cosmologyorNone,optional Cosmology to assume for calculations. If
None, usedsigma.default_cosmology. Default isNone.- z
floatornumpy.ndarray Redshift of the object.
- cosmology
astropy.cosmology,optional Cosmology to assume for calculations.
- comovingbool,
optional Use comoving distance instead of physical distance when True. Default is
False.
- cosmology
- Returns:
floatornumpy.ndarrayPhysical scale in unit of Mpc/degree.
- dsigma.physics.projection_angle(ra_l, dec_l, ra_s, dec_s)[source]¶
Calculate projection angle between lens and sources.
- Parameters:
- ra_l, dec_l
floatornumpy.ndarray Coordinates of the lens galaxies in degrees.
- ra_s, dec_s
floatornumpy.ndarray Coordinates of the source galaxies in degrees.
- ra_l, dec_l
- Returns:
- cos_2phi, sin_2phi
floatornumpy.ndarray The \(\cos\) and \(\sin\) of \(2 \phi\), where \(\phi\) is the angle measured from right ascension direction to a line connecting the lens and source galaxies.
- cos_2phi, sin_2phi