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)
Compute the critical surface density.
- Parameters
- z_lfloat or numpy.ndarray
Redshift of lens.
- z_sfloat or numpy.ndarray
Redshift of source.
- cosmologyastropy.cosmology, optional
Cosmology to assume for calculations. Only used if comoving distances are not passed.
- comovingboolean, optional
Flag for using comoving instead of physical units.
- d_lfloat or numpy.ndarray
Comoving transverse distance to the lens. If not given, it is calculated from the redshift provided.
- d_sfloat or numpy.ndarray
Comoving transverse distance to the source. If not given, it is calculated from the redshift provided.
- Returns
- sigma_critfloat or numpy.ndarray
Critical surface density for each lens-source pair.
- dsigma.physics.effective_critical_surface_density(z_l, z_s, n_s, cosmology, comoving=True)
Compute the effective critical surface density.
- Parameters
- z_lfloat or numpy.ndarray
Redshift of lens.
- z_snumpy.ndarray
Redshifts of sources.
- n_snumpy.ndarray
Fraction of source galaxies in each redshift bin. Does not need to be normalized.
- cosmologyastropy.cosmology
Cosmology to assume for calculations.
- comovingboolean, optional
Flag for using comoving instead of physical unit.
- Returns
- sigma_crit_efffloat or numpy.ndarray
Effective critical surface density for the lens redshift given the source redshift distribution.
- 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)
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
- thetafloat
Angular separation \(\theta\) from the lens sample in radians.
- alpha_lfloat
Local slope of the flux distribution of lenses near the flux limit.
- z_lfloat
Redshift of lens.
- z_sfloat
Redshift of source.
- camb_resultscamb.results.CAMBdata
CAMB results object that contains information on cosmology and the matter power spectrum.
- n_zint, optional
Number of redshift bins used in the integral. Larger numbers will be more accurate.
- n_ellint, optional
Number of \(\ell\) bins used in the integral. Larger numbers will be more accurate.
- bessel_function_zerosint, 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_maxfloat, optional
The maximum wavenumber beyond which the power spectrum is assumed to be 0.
- Returns
- et_lmfloat
Bias in the mean tangential shear due to lens magnification effects.
- dsigma.physics.mpc_per_degree(z, cosmology=FlatLambdaCDM(H0=100.0 km / (Mpc s), Om0=0.3, Tcmb0=0.0 K, Neff=3.04, m_nu=None, Ob0=None), comoving=False)
Estimate the angular scale in Mpc/degree at certain redshift.
- Parameters
- cosmologyastropy.cosmology, optional
Cosmology to assume for calculations.
- zfloat or numpy.ndarray
Redshift of the object.
- comovingboolen
Use comoving distance instead of physical distance when True. Default: False
- Returns
- float or numpy.ndarray
Physical scale in unit of Mpc/degree.
- dsigma.physics.projection_angle(ra_l, dec_l, ra_s, dec_s)
Calculate projection angle between lens and sources.
- Parameters
- ra_l, dec_lfloat or numpy.ndarray
Coordinates of the lens galaxies in degrees.
- ra_s, dec_sfloat or numpy.ndarray
Coordinates of the source galaxies in degrees.
- Returns
- cos_2phi, sin_2phifloat or numpy.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.