slsim.Deflectors.DeflectorPopulation package

Submodules

slsim.Deflectors.DeflectorPopulation.all_lens_galaxies module

class slsim.Deflectors.DeflectorPopulation.all_lens_galaxies.AllLensGalaxies(red_galaxy_list, blue_galaxy_list, kwargs_cut, kwargs_mass2light, cosmo, sky_area, gamma_pl=None, catalog_type='skypy')[source]

Bases: DeflectorsBase

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.DeflectorPopulation.all_lens_galaxies.fill_table(galaxy_list)[source]
Parameters:

galaxy_list – ~Astropy.Table instance

Returns:

table with additional columns

slsim.Deflectors.DeflectorPopulation.cluster_deflectors module

class slsim.Deflectors.DeflectorPopulation.cluster_deflectors.ClusterDeflectors(cluster_list, members_list, galaxy_list, kwargs_cut, kwargs_mass2light, cosmo, sky_area, catalog_type='skypy', richness_fn='Abdullah2022', kwargs_draw_members=None, assign_galaxy_redshift=False, cored_profile=False)[source]

Bases: DeflectorsBase

Class describing cluster lens model with a NFW profile for the dark matter halo and EPL profile for the subhalos (cluster members). It makes use of a group/cluster catalog and a group/cluster member catalog (e.g. redMaPPer).

This class is called by setting deflector_type == “cluster-catalog” in LensPop.

static assign_similar_galaxy(members_list, galaxy_list, cosmo=None, bands=('g', 'r', 'i', 'z', 'Y'), max_gals=10000, assign_galaxy_redshift=False)[source]

Assigns a similar galaxy to each member of a group/cluster member catalog by comparing their magnitudes and redshifts.

Parameters:
  • members_list (astropy.table.Table) – astropy table with columns ‘mag_{band}’, ‘z’

  • galaxy_list (astropy.table.Table) – astropy table with columns ‘mag_{band}’, ‘z’

  • cosmo (astropy.cosmology) – astropy.cosmology instance

  • bands (list) – list of bands to compare

  • max_gals (int) – maximum number of galaxies to compare to

  • assign_galaxy_redshift (bool) – if True, assign the redshift of the galaxy to the member galaxy instead of the cluster redshift

Returns:

astropy table with the same number of rows as members_list and columns from both members_list and galaxy_list

Return type:

astropy.table.Table

deflector_number()[source]
Returns:

number of deflectors

draw_cluster(index)[source]
Parameters:

index (int) – index of cluster in catalog

Returns:

dictionary of NFW parameters for the cluster halo

draw_deflector(index=None)[source]
Parameters:
  • index (int or None) – index of deflector, if not provided, draw randomly from all deflectors

  • cored (True for cored, False for cuspy profile) – Boolean flag for cored density profile

Returns:

dictionary of complete parameterization of deflector

draw_members(cluster_id, center_scatter=0.2, max_dist=80, bcg_band='r')[source]
Parameters:
  • cluster_id (int) – identifier of the cluster

  • center_scatter (float) – scatter in center of the BCG in arcsec

  • max_dist (float) – maximum distance from the BCG in arcsec

bcg_band: band to use to identify the BCG :type bcg_band: str :return: astropy table with EPL+Sersic parameters of each member

get_deflector(cluster_id, cored=False)[source]
Parameters:
  • cluster_id (int) – identifier of the cluster

  • cored (True for cored, False for cuspy profile) – Boolean flag for cored density profile

Returns:

dictionary of complete parameterization of deflector for the given cluster_id

static preprocess_clusters(cluster_list)[source]
preprocess_members(cluster_list, members_list, galaxy_list, assign_galaxy_redshift=False)[source]
set_cosmo()[source]

Set the cosmology in colossus to match the astropy.cosmology instance.

slsim.Deflectors.DeflectorPopulation.compound_lens_halos_galaxies module

class slsim.Deflectors.DeflectorPopulation.compound_lens_halos_galaxies.CompoundLensHalosGalaxies(halo_galaxy_list, kwargs_cut, kwargs_mass2light, cosmo, sky_area)[source]

Bases: DeflectorsBase

Class describing compound lens model in which the mass distribution of individual lens objects is described by a superposition of dark matter and stellar components.

This class is called by setting deflector_type == “halo-models” in LensPop.

deflector_number()[source]
Returns:

number of deflectors

draw_deflector()[source]
Returns:

dictionary of complete parameterization of deflector

slsim.Deflectors.DeflectorPopulation.deflectors_base module

class slsim.Deflectors.DeflectorPopulation.deflectors_base.DeflectorsBase(deflector_table, kwargs_cut, cosmo, sky_area, gamma_pl=None, deflector_type='EPL_SERSIC')[source]

Bases: ABC

Abstract Base Class to create a class that accesses a set of deflectors.

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

abstractmethod deflector_number()[source]
Returns:

number of deflectors after applied cuts

abstractmethod draw_deflector()[source]
Returns:

dictionary of complete parameterization of deflector

slsim.Deflectors.DeflectorPopulation.elliptical_lens_galaxies module

class slsim.Deflectors.DeflectorPopulation.elliptical_lens_galaxies.EllipticalLensGalaxies(galaxy_list, kwargs_cut, kwargs_mass2light, cosmo, sky_area, gamma_pl=None, catalog_type='skypy')[source]

Bases: DeflectorsBase

Class describing elliptical galaxies.

deflector_number()[source]
Returns:

number of deflectors

draw_deflector()[source]
Returns:

dictionary of complete parameterization of deflector

slsim.Deflectors.DeflectorPopulation.elliptical_lens_galaxies.elliptical_projected_eccentricity(ellipticity, light2mass_e_scaling=1, light2mass_e_scatter=0.1, **kwargs)[source]

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

Parameters:
  • ellipticity (float [0,1)) – eccentricity amplitude (1-q^2)/(1+q^2)

  • light2mass_e_scaling – scaling factor of mass eccentricity / light eccentricity

  • light2mass_e_scatter – scatter in light and mass eccentricities from the scaling relation

  • light2mass_angle_scatter – scatter in orientation angle between light and mass eccentricity

  • kwargs (dict) – deflector properties

Returns:

e1_light, e2_light, e1_mass, e2_mass eccentricity components

Module contents