slsim package

Subpackages

Submodules

slsim.image_simulation module

slsim.lens module

slsim.lens_pop module

slsim.lensed_population_base module

class slsim.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.lensed_system_base module

class slsim.lensed_system_base.LensedSystemBase(source_dict, deflector_dict, cosmo, test_area=12.566370614359172, variability_model=None, kwargs_variability=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()[source]

Returns lens model instance and parameters in lenstronomy conventions.

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_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 image_positions()[source]

Returns image positions by solving the lens equation, these are either the centers of the extended source, or the point sources in case of (added) point- like sources, such as quasars or SNe.

Returns:

x-pos, y-pos

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_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_position()[source]

Source position, either the center of the extended source or the point source. If not present from the cataloge, it is drawn uniform within the circle of the test area centered on the lens.

Returns:

[x_pos, y_pos] in arc seconds

abstract source_redshift()[source]

Source redshift.

Returns:

source redshift

slsim.lsst_science_pipeline module

slsim.selection module

slsim.selection.deflector_cut(galaxy_list, z_min=0, z_max=5, band=None, band_max=40, list_type='astropy_table')[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.

Returns:

subset of galaxies matching the selection criteria

slsim.slsim module

Main module.

Module contents

Top-level package for slsim.