MainDeflector – Main Deflector Rendering Modules

Main Deflector Classes Available

  • PEMD - Class for rendering a main deflector the includes a PEMD profile

  • PEMDShear - Class for rendering a main deflector the includes a PEMD profile and external shear

  • PEMDTShearests - Class for rendering a main deflector the includes a PEMD profile, external shear, and order 2, 3, and 4 multipole.

paltas.MainDeflector.main_deflector_base module

Provide the base class for specifying the main deflector of a lensing system.

This module contains the base class that all the main deflector classes will build from. Because the steps for rendering a main deflector can vary between different models, the required functions are very sparse.

class paltas.MainDeflector.main_deflector_base.MainDeflectorBase(main_deflector_parameters, cosmology_parameters)[source]

Bases: object

Base class for rendering the main halo.

Parameters:
  • main_deflector_parameters (dict) – A dictionary containing the type of los distribution and the value for each of its parameters.

  • cosmology_parameters (str,dict, or colossus.cosmology.Cosmology) – Either a name of colossus cosmology, a dict with ‘cosmology name’: name of colossus cosmology, an instance of colussus cosmology, or a dict with H0 and Om0 ( other parameters will be set to defaults).

check_parameterization(required_params)[source]

Check that all the required parameters are present in the los_parameters.

Parameters:

required_params ([str,...]) – A list of strings containing the required parameters.

draw_main_deflector()[source]

Draws the lenstronomy profile names and kwargs for the components of the main deflector.

Returns:

A tuple of three lists: the first is the profile type for each component of the main deflector, the second is the lenstronomy kwargs for each component, and the third is the redshift for each component.

Return type:

(tuple)

required_parameters = ()
update_parameters(main_deflector_parameters=None, cosmology_parameters=None)[source]

Updated the class parameters

Parameters:
  • los_parameters (dict) – A dictionary containing the type of los distribution and the value for each of its parameters.

  • main_deflector_parameters (dict) – A dictionary containing the type of main deflector and the value for each of its parameters.

  • source_parameters (dict) – A dictionary containing the type of the source and the value for each of its parameters.

  • cosmology_parameters (str,dict, or colossus.cosmology.Cosmology) – Either a name of colossus cosmology, a dict with ‘cosmology name’: name of colossus cosmology, an instance of colussus cosmology, or a dict with H0 and Om0 ( other parameters will be set to defaults).

paltas.MainDeflector.simple_deflectors module

Provide the implementation of a few main deflector profiles that consist of two or fewer components.

This module contains the classes to render main deflectors consisting of simple combinations of lenstronomy profiles.

class paltas.MainDeflector.simple_deflectors.PEMD(main_deflector_parameters, cosmology_parameters)[source]

Bases: MainDeflectorBase

Class for rendering a main deflector the includes a PEMD profile.

Parameters:
  • main_deflector_parameters (dict) – A dictionary containing the type of main deflector and the value for each of its parameters.

  • cosmology_parameters (str,dict, or colossus.cosmology.Cosmology) – Either a name of colossus cosmology, a dict with ‘cosmology name’: name of colossus cosmology, an instance of colussus cosmology, or a dict with H0 and Om0 ( other parameters will be set to defaults).

Notes

Uses the lenstronomy EPL_NUMBA class, which is equivalent to PEMD but is pure python.

Required Parameters

  • gamma - power law slope

  • theta_E - Einstein radius of the profile in units of arcseconds

  • e1 - x-direction ellipticity eccentricity

  • e2 - xy-direction ellipticity eccentricity

  • center_x - x-coordinate lens center in units of arcseconds

  • center_y - y-coordinate lens center in units of arcseconds

  • z_lens - main deflector redshift

draw_main_deflector()[source]

Draws the lenstronomy profile names and kwargs for the components of the main deflector.

Returns:

A tuple of three lists: the first is the profile type for each component of the main deflector, the second is the lenstronomy kwargs for each component, and the third is the redshift for each component.

Return type:

(tuple)

required_parameters = ('gamma', 'theta_E', 'e1', 'e2', 'center_x', 'center_y', 'z_lens')
class paltas.MainDeflector.simple_deflectors.PEMDShear(main_deflector_parameters, cosmology_parameters)[source]

Bases: MainDeflectorBase

Class for rendering a main deflector the includes a PEMD profile and external shear.

Parameters:
  • main_deflector_parameters (dict) – A dictionary containing the type of main deflector and the value for each of its parameters.

  • cosmology_parameters (str,dict, or colossus.cosmology.Cosmology) – Either a name of colossus cosmology, a dict with ‘cosmology name’: name of colossus cosmology, an instance of colussus cosmology, or a dict with H0 and Om0 ( other parameters will be set to defaults).

Notes

Uses the lenstronomy EPL class, which is equivalent to PEMD but is pure python.

Required Parameters

  • gamma - power law slope

  • theta_E - Einstein radius of the profile in units of arcseconds

  • e1 - x-direction ellipticity eccentricity

  • e2 - xy-direction ellipticity eccentricity

  • center_x - x-coordinate lens center in units of arcseconds

  • center_y - y-coordinate lens center in units of arcseconds

  • gamma1 - x-direction shear

  • gamma2 - xy-direction shear

  • ra_0 - ra origin of shear in units of arcseconds

  • dec_0 - dec origin of shear in units of arcseconds

  • z_lens - main deflector redshift

draw_main_deflector()[source]

Draws the lenstronomy profile names and kwargs for the components of the main deflector.

Returns:

A tuple of three lists: the first is the profile type for each component of the main deflector, the second is the lenstronomy kwargs for each component, and the third is the redshift for each component.

Return type:

(tuple)

required_parameters = ('gamma', 'theta_E', 'e1', 'e2', 'center_x', 'center_y', 'gamma1', 'gamma2', 'ra_0', 'dec_0', 'z_lens')
class paltas.MainDeflector.simple_deflectors.PEMDShearFourMultipole(main_deflector_parameters, cosmology_parameters)[source]

Bases: PEMDShear

Class for rendering a main deflector the includes a PEMD profile, external shear, and order 2, 3, and 4 multipole.

Parameters:
  • main_deflector_parameters (dict) – A dictionary containing the type of main deflector and the value for each of its parameters.

  • cosmology_parameters (str,dict, or colossus.cosmology.Cosmology) – Either a name of colossus cosmology, a dict with ‘cosmology name’: name of colossus cosmology, an instance of colussus cosmology, or a dict with H0 and Om0 ( other parameters will be set to defaults).

Notes

Uses the lenstronomy EPL class, which is equivalent to PEMD but is pure python.

Required Parameters

  • gamma - power law slope

  • theta_E - Einstein radius of the profile in units of arcseconds

  • e1 - x-direction ellipticity eccentricity

  • e2 - xy-direction ellipticity eccentricity

  • center_x - x-coordinate lens center in units of arcseconds

  • center_y - y-coordinate lens center in units of arcseconds

  • gamma1 - x-direction shear

  • gamma2 - xy-direction shear

  • ra_0 - ra origin of shear in units of arcseconds

  • dec_0 - dec origin of shear in units of arcseconds

  • z_lens - main deflector redshift

  • mult2_a - multipole strength for order 2 multpole

  • mult2_phi - multipole order 2 orientation in radians

  • mult2_center_x - x-coordinate multipole order 2 center in units of arcseconds

  • mult2_center_y - y-coordinate multipole order 2 center in units of arcseconds

  • mult3_a - multipole strength for order 2 multpole

  • mult3_phi - multipole order 2 orientation in radians

  • mult3_center_x - x-coordinate multipole order 2 center in units of arcseconds

  • mult3_center_y - y-coordinate multipole order 2 center in units of arcseconds

  • mult4_a - multipole strength for order 2 multpole

  • mult4_phi - multipole order 2 orientation in radians

  • mult4_center_x - x-coordinate multipole order 2 center in units of arcseconds

  • mult4_center_y - y-coordinate multipole order 2 center in units of arcseconds

draw_main_deflector()[source]

Draws the lenstronomy profile names and kwargs for the components of the main deflector.

Returns:

A tuple of three lists: the first is the profile type for each component of the main deflector, the second is the lenstronomy kwargs for each component, and the third is the redshift for each component.

Return type:

(tuple)

required_parameters = ('gamma', 'theta_E', 'e1', 'e2', 'center_x', 'center_y', 'gamma1', 'gamma2', 'ra_0', 'dec_0', 'z_lens', 'mult2_a', 'mult2_phi', 'mult2_center_x', 'mult2_center_y', 'mult3_a', 'mult3_phi', 'mult3_center_x', 'mult3_center_y', 'mult4_a', 'mult4_phi', 'mult4_center_x', 'mult4_center_y')