slsim.Lenses package

Submodules

slsim.Lenses.lens_pop module

slsim.Lenses.lens module

slsim.Lenses.lensed_population_base module

class slsim.Lenses.lensed_population_base.LensedPopulationBase(sky_area=None, cosmo=None)[source]

Bases: ABC

Abstract Base Class to create a sample of lensed systems.

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

abstract deflector_number()[source]

Number of potential deflectors (meaning all objects with mass that are being considered to have potential sources behind them)

Returns:

number of potential deflectors

abstract draw_population(**kwargs)[source]

Return full sample list of all lenses within the area.

Returns:

List of LensedSystemBase instances with parameters of the deflectors and source.

Return type:

list

abstract select_lens_at_random()[source]

Draw a random lens within the cuts of the lens and source, with possible additional cut in the lensing configuration.

# as well as option to draw all lenses within the cuts within the area

Returns:

Lens() instance with parameters of the deflector and lens and source light

abstract source_number()[source]

Number of sources that are being considered to be placed in the sky area potentially aligned behind deflectors.

Returns:

number of sources

slsim.Lenses.lensed_system_base module

class slsim.Lenses.lensed_system_base.LensedSystemBase(source_class, deflector_class, los_class=None)[source]

Bases: ABC

Abstract Base class to create a lens system with all lensing properties required to render populations.

abstract deflector_ellipticity()[source]

Ellipticity components for deflector light and mass profile.

Returns:

e1_light, e2_light, e1_mass, e2_mass

abstract deflector_light_model_lenstronomy(band)[source]

Returns lens model instance and parameters in lenstronomy conventions.

Parameters:

band (str) – imaging band

Returns:

lens_light_model_list, kwargs_lens_light

abstract deflector_magnitude(band)[source]

Apparent magnitude of the deflector for a given band (AB mag)

Parameters:

band (string) – imaging band

Returns:

magnitude of deflector in given band

abstract deflector_mass_model_lenstronomy()[source]

Returns lens mass model instance and parameters in lenstronomy conventions.

Returns:

lens_mass_model_list, kwargs_lens_mass

abstract deflector_position()[source]

Center of the deflector position.

Returns:

[x_pox, y_pos] in arc seconds

abstract deflector_redshift()[source]

Deflector redshift.

Returns:

deflector redshift

abstract deflector_velocity_dispersion()[source]
Returns:

velocity dispersion [km/s]

abstract einstein_radius()[source]

Einstein radius.

Returns:

Einstein radius [arc seconds]

abstract extended_source_image_positions()[source]

Returns extended source image positions by solving the lens equation.

Returns:

x-pos, y-pos

abstract extended_source_magnification()[source]

Extended source (or host) magnification.

Returns:

integrated magnification factor of host magnitude

abstract extended_source_magnitude(band, lensed=False)[source]

Apparent magnitude of the extended source for a given band (lensed or unlensed) (assumes that size is the same for different bands)

Parameters:
  • band (string) – imaging band

  • lensed (bool) – if True, returns the lensed magnified magnitude

Returns:

magnitude of source in given band

abstract lenstronomy_kwargs(band=None)[source]
Parameters:

band (string or None) – imaging band, if =None, will result in un-normalized amplitudes

Returns:

lenstronomy model and parameter conventions

abstract los_linear_distortions()[source]

Line-of-sight distortions in shear and convergence.

Returns:

kappa, gamma1, gamma2

abstract point_source_image_positions()[source]

Returns point source image positions by solving the lens equation. In the absence of a point source, this function returns the solution for the center of the extended source.

Returns:

x-pos, y-pos

abstract point_source_magnification()[source]

Macro-model magnification of point sources.

Returns:

signed magnification of point sources in same order as image positions

abstract point_source_magnitude(band, lensed=False)[source]

Point source magnitude, either unlensed (single value) or lensed (array) with macro-model magnifications.

Parameters:
  • band (string) – imaging band

  • lensed (bool) – if True, returns the lensed magnified magnitude

Returns:

point source magnitude

abstract source_light_model_lenstronomy()[source]

Returns source light model instance and parameters in lenstronomy conventions.

Returns:

source_light_model_list, kwargs_source_light

abstract source_redshift_list()[source]

Source redshift.

Returns:

list of each source redshift

slsim.Lenses.selection module

slsim.Lenses.selection.object_cut(galaxy_list, z_min=0, z_max=5, band=None, band_max=40, list_type='astropy_table', object_type='extended')[source]

Selects a subset of a given galaxy list satisfying given criteria.

Parameters:
  • galaxy_list – galaxies prior to selection criteria

  • z_min – minimum redshift of selected sample

  • z_max – maximum redshift of selected sample

  • band – imaging band

  • band_max – maximum magnitude of galaxies in band

  • list_type – format of the source catalog file. Currently, it supports a single astropy table or a list of astropy tables.

  • object_type – string to specify whether catalog contains an extended object or point object. This is necessary because point and extended object have different name for the magnitude.

Returns:

subset of galaxies matching the selection criteria

Module contents