lenstronomy.LightModel package

Subpackages

Submodules

lenstronomy.LightModel.light_model module

class LightModel(light_model_list, deflection_scaling_list=None, source_redshift_list=None, smoothing=0.001, sersic_major_axis=None)[source]

Bases: LinearBasis

Class to handle extended surface brightness profiles (for e.g. source and lens light)

all profiles come with a surface_brightness parameterization (in units per square angle and independent of the pixel scale). The parameter ‘amp’ is the linear scaling parameter of surface brightness. Some functional forms come with a total_flux() definition that provide the integral of the surface brightness for a given set of parameters.

The SimulationAPI module allows to use astronomical magnitudes to be used and translated into the surface brightness conventions of this module given a magnitude zero point.

__init__(light_model_list, deflection_scaling_list=None, source_redshift_list=None, smoothing=0.001, sersic_major_axis=None)[source]
Parameters:
  • light_model_list – list of light models

  • deflection_scaling_list – list of floats indicating a relative scaling of the deflection angle from the reduced angles in the lens model definition (optional, only possible in single lens plane with multiple source planes)

  • source_redshift_list – list of redshifts for the different light models (optional and only used in multi-plane lensing in conjunction with a cosmology model)

  • smoothing – smoothing factor for certain models (deprecated)

  • sersic_major_axis – boolean or None, if True, uses the semi-major axis as the definition of the Sersic half-light radius, if False, uses the product average of semi-major and semi-minor axis. If None, uses the convention in the lenstronomy yaml setting (which by default is =False)

lenstronomy.LightModel.light_param module

class LightParam(light_model_list, kwargs_fixed, kwargs_lower=None, kwargs_upper=None, param_type='light', linear_solver=True)[source]

Bases: object

Class manages the parameters corresponding to the LightModel() module.

Also manages linear parameter handling.

__init__(light_model_list, kwargs_fixed, kwargs_lower=None, kwargs_upper=None, param_type='light', linear_solver=True)[source]
Parameters:
  • light_model_list – list of light models

  • kwargs_fixed – list of keyword arguments corresponding to parameters held fixed during sampling

  • kwargs_lower – list of keyword arguments indicating hard lower limit of the parameter space

  • kwargs_upper – list of keyword arguments indicating hard upper limit of the parameter space

  • param_type – string (optional), adding specifications in the output strings (such as lens light or source light)

  • linear_solver – bool, if True fixes the linear amplitude parameters ‘amp’ (avoid sampling) such that they get overwritten by the linear solver solution.

property param_name_list
get_params(args, i)[source]
Parameters:
  • args – list of floats corresponding ot the arguments being sampled

  • i – int, index of the first argument that is managed/read-out by this class

Returns:

keyword argument list of the light profile, index after reading out the arguments corresponding to this class

set_params(kwargs_list)[source]
Parameters:

kwargs_list – list of keyword arguments of the light profile (free parameter as well as optionally the fixed ones)

Returns:

list of floats corresponding to the free parameters

num_param(latex_style=False)[source]
Parameters:

latex_style – boolena; if True, returns latex strings for plotting

Returns:

int, list of strings with param names

num_param_linear()[source]
Returns:

number of linear basis set coefficients

Module contents