slsim.Deflectors package

Submodules

slsim.Deflectors.all_lens_galaxies module

class slsim.Deflectors.all_lens_galaxies.AllLensGalaxies(red_galaxy_list, blue_galaxy_list, kwargs_cut, kwargs_mass2light, cosmo, sky_area)[source]

Bases: DeflectorBase

Class describing all-type galaxies.

deflector_number()[source]
Returns:

number of deflectors after applied cuts

draw_deflector()[source]
Returns:

dictionary of complete parameterization of a deflector

slsim.Deflectors.all_lens_galaxies.fill_table(galaxy_list)[source]
Parameters:

galaxy_list – ~Astropy.Table instance

Returns:

table with additional columns

slsim.Deflectors.all_lens_galaxies.vel_disp_abundance_matching(galaxy_list, z_max, sky_area, cosmo)[source]

Calculates the velocity dispersion from the steller mass.

Parameters:
  • galaxy_list (Table object) – list of galaxies with stellar masses given

  • z_max – maximum redshift to which the abundance matching with the SDSS velocity dispersion function is valid

  • cosmo – astropy.cosmology instance

  • sky_area (~astropy.units.Quantity) – Sky area over which galaxies are sampled. Must be in units of solid angle.

Returns:

interpolation function f; f(stellar_mass) -> vel_disp

slsim.Deflectors.deflector_base module

class slsim.Deflectors.deflector_base.DeflectorBase(deflector_table, kwargs_cut, cosmo, sky_area)[source]

Bases: ABC

Abstract Base Class to create a deflector object.

All object that inherit from Lensed System must contain the methods it contains.

abstract deflector_number()[source]
Returns:

number of deflectors after applied cuts

abstract draw_deflector()[source]
Returns:

dictionary of complete parameterization of deflector

slsim.Deflectors.elliptical_lens_galaxies module

class slsim.Deflectors.elliptical_lens_galaxies.EllipticalLensGalaxies(galaxy_list, kwargs_cut, kwargs_mass2light, cosmo, sky_area)[source]

Bases: DeflectorBase

Class describing elliptical galaxies.

deflector_number()[source]
Returns:

number of deflectors

draw_deflector()[source]
Returns:

dictionary of complete parameterization of deflector

slsim.Deflectors.elliptical_lens_galaxies.elliptical_projected_eccentricity(ellipticity, **kwargs)[source]

Projected eccentricity of elliptical galaxies as a function of other deflector parameters.

Parameters:
  • ellipticity (float [0,1)) – eccentricity amplitude

  • kwargs (dict) – deflector properties

Returns:

e1_light, e2_light,e1_mass, e2_mass eccentricity components

slsim.Deflectors.elliptical_lens_galaxies.vel_disp_from_m_star(m_star)[source]

Function to calculate the velocity dispersion from the staller mass using empirical relation for elliptical galaxies.

The power-law formula is given by:

\[V_{\mathrm{disp}} = 10^{2.32} \left( \frac{M_{\mathrm{star}}}{10^{11} M_\odot} \right)^{0.24}\]

2.32,0.24 is the parameters from [1] table 2 [1]:Auger, M. W., et al. “The Sloan Lens ACS Survey. X. Stellar, dynamical, and total mass correlations of massive elliptical galaxies.” The Astrophysical Journal 724.1 (2010): 511.

Parameters:

m_star – stellar mass in the unit of solar mass

Returns:

the velocity dispersion (“km/s”)

slsim.Deflectors.velocity_dispersion module

slsim.Deflectors.velocity_dispersion.schechter_vel_disp(redshift, phi_star, alpha, beta, vd_star, vd_min, vd_max, sky_area, cosmology, noise=True)[source]

Sample redshifts and stellar masses from a Schechter mass function.

Sample the redshifts and stellar masses of galaxies following a Schechter mass function with potentially redshift-dependent parameters, limited by maximum and minimum masses m_min, m_max, for a sky area sky_area.

Parameters

redshiftarray_like

Input redshift grid on which the Schechter function parameters are evaluated. Galaxies are sampled over this redshift range.

phi_stararray_like or function

Normalisation of the Schechter function. Can be a single value, an array of values for each redshift, or a function of redshift.

alpha: float

The alpha parameter in the modified Schechter equation.

beta: float

The beta parameter in the modified Schechter equation.

vd_star: float

The characteristic velocity dispersion.

vd_min, vd_max: float

Lower and upper bounds of random variable x. Samples are drawn uniformly from bounds.

sky_area~astropy.units.Quantity

Sky area over which galaxies are sampled. Must be in units of solid angle.

cosmology~astropy.cosmology

astropy.cosmology object to calculate comoving densities.

noisebool, optional

Poisson-sample the number of galaxies. Default is True.

Notes

Effectively calls ~skypy.galaxies.redshift.schechter_smf_redshift and ~skypy.galaxies.stellar_mass.schechter_smf_mass internally and returns the tuple of results.

Returns

redshifts, velocity dispersiontuple of array_like

Redshifts and velocity dispersion of the galaxy sample described by the Schechter velocity dispersion function.

slsim.Deflectors.velocity_dispersion.schechter_vel_disp_redshift(redshift, phi_star, alpha, beta, vd_star, vd_min, vd_max, sky_area, cosmology, noise=True)[source]

Sample redshifts from Schechter function.

Sample the redshifts of velocity dispersion following a Schechter function with potentially redshift-dependent parameters, limited by velocity dispersion vd_max and vd_min, for a sky area sky_area.

Parameters

redshiftarray_like

Input redshift grid on which the Schechter function parameters are evaluated. Galaxies are sampled over this redshift range.

phi_stararray_like or function

Normalisation of the Schechter function. Can be a single value, an array of values for each redshift, or a function of redshift.

alpha: float

The alpha parameter in the modified Schechter equation.

beta: float

The beta parameter in the modified Schechter equation.

vd_star: float

The characteristic velocity dispersion.

vd_min, vd_max: float

Lower and upper bounds of random variable x. Samples are drawn uniformly from bounds.

sky_area~astropy.units.Quantity

Sky area over which galaxies are sampled. Must be in units of solid angle.

cosmologyCosmology

Cosmology object to calculate comoving densities.

noisebool, optional

Poisson-sample the number of galaxies. Default is True.

Returns

velocity_dispersion: array_like

Velocity dispersion drawn from Schechter function.

Notes

The probability distribution function \(p(\\sigma)\) for velocity dispersion \(\sigma\) can be described by a Schechter function (see eq. (4) in [2])

\[\begin{split}\\phi = \\phi_* \\left(\\frac{\\sigma}{\\sigma_*}\\right)^\\alpha \\exp\\left[-\\left( \\frac{\\sigma}{\\sigma_*} \\right)^\\beta\\right] \\frac{\\beta}{\\Gamma(\\alpha/\\beta)} \\frac{1}{\\sigma} \\mathrm{d} \\sigma \\;.\end{split}\]

where \(\\Gamma\) is the gamma function, \(\\sigma_*\) is the characteristic velocity dispersion, \(\\phi_*\) is number density and \(\\alpha\) and \(\beta\) are free parameters.

References

slsim.Deflectors.velocity_dispersion.schechter_velocity_dispersion_function(alpha, beta, vd_star, vd_min, vd_max, size=None, resolution=1000)[source]
Sample velocity dispersion of elliptical galaxies in the local universe following

a Schecter function.

alpha: float

The alpha parameter in the modified Schechter equation.

beta: float

The beta parameter in the modified Schechter equation.

vd_star: float

The characteristic velocity dispersion.

vd_min, vd_max: float

Lower and upper bounds of random variable x. Samples are drawn uniformly from bounds.

resolution: int

Resolution of the inverse transform sampling spline. Default is 100.

size: int

Number of samples returned. Default is 1.

velocity_dispersion: array_like

Velocity dispersion drawn from Schechter function.

The probability distribution function \(p(\sigma)\) for velocity dispersion \(\sigma\) can be described by a Schechter function (see eq. (4) in [3])

\[\phi = \phi_* \left(\frac{\sigma}{\sigma_*}\right)^\alpha \exp\left[-\left( \frac{\sigma}{\sigma_*} \right)^\beta\right] \frac{\beta}{\Gamma(\alpha/\beta)} \]
rac{1}{sigma} mathrm{d}

sigma ;.

where \(\Gamma\) is the gamma function, \(\sigma_*\) is the characteristic velocity dispersion, \(\phi_*\) is number density of all spiral galaxies and \(\alpha\) and \(\beta\) are free parameters.

slsim.Deflectors.velocity_dispersion.vel_disp_composite_model(r, m_star, rs_star, m_halo, c_halo, cosmo)[source]

Computes the luminosity weighted velocity dispersion for a deflector with a stellar Hernquist profile and a NFW halo profile, assuming isotropic anisotropy.

Parameters:
  • r – radius of the luminosity-weighted velocity dispersion [arcsec]

  • m_star – stellar mass [M_sun]

  • rs_star – stellar half light radius [physical kpc]

  • m_halo – Halo mass [physical M_sun]

  • c_halo – halo concentration

  • cosmo (cosmology class) – cosmology

Returns:

velocity dispersion [km/s]

slsim.Deflectors.velocity_dispersion.vel_disp_sdss(sky_area, redshift, vd_min, vd_max, cosmology, noise=True)[source]

Velocity dispersion function in a cone matched by SDSS measurements.

sky_area~astropy.units.Quantity

Sky area over which galaxies are sampled. Must be in units of solid angle.

redshiftnumpy.array

Input redshift grid on which the Schechter function parameters are evaluated. Galaxies are sampled over this redshift range.

vd_min, vd_max: int

Lower and upper bounds of random variable x (velocity dispersion). Samples are drawn uniformly from bounds.

cosmologyastropy.cosmology

astropy.cosmology object to calculate comoving densities.

noisebool, optional

Poisson-sample the number of galaxies. Default is True.

redshifts, velocity dispersiontuple of array_like

Redshifts and velocity dispersion of the galaxy sample described by the Schechter velocity dispersion function.

The probability distribution function \(p(\sigma)\) for velocity dispersion \(\sigma\) can be described by a Schechter function (see eq. (4) in [1])

\[\phi = \phi_* \left(\frac{\sigma}{\sigma_*}\right)^\alpha \exp\left[-\left( \frac{\sigma}{\sigma_*} \right)^\beta\right] \frac{\beta}{\Gamma(\alpha/\beta)} \]
rac{1}{sigma}

mathrm{d}sigma ;.

where \(\Gamma\) is the gamma function, \(\sigma_*\) is the characteristic velocity dispersion, \(\phi_*\) is number density and \(\alpha\) and \(\beta\) are free parameters.

Module contents