jaxtronomy.LightModel package¶
Subpackages¶
- jaxtronomy.LightModel.Profiles package
- Submodules
- jaxtronomy.LightModel.Profiles.core_sersic module
- jaxtronomy.LightModel.Profiles.gaussian module
- jaxtronomy.LightModel.Profiles.sersic module
- jaxtronomy.LightModel.Profiles.sersic_ellipse module
- jaxtronomy.LightModel.Profiles.shapelets module
- Module contents
Submodules¶
jaxtronomy.LightModel.light_model module¶
- class LightModel(light_model_list, deflection_scaling_list=None, source_redshift_list=None, profile_kwargs_list=None)[source]¶
Bases:
LinearBasisClass 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, profile_kwargs_list=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)
profile_kwargs_list – list of dicts, keyword arguments used to initialize light model profile classes in the same order of the light_model_list. If any of the profile_kwargs are None, then that profile will be initialized using default settings.
jaxtronomy.LightModel.light_model_base module¶
- class LightModelBase(light_model_list, profile_kwargs_list=None)[source]¶
Bases:
objectClass to handle source and lens light models.
- __init__(light_model_list, profile_kwargs_list=None)[source]¶
- Parameters:
light_model_list – list of light models
profile_kwargs_list – list of dicts, keyword arguments used to initialize light model profile classes in the same order of the light_model_list. If any of the profile_kwargs are None, then that profile will be initialized using default settings.
- surface_brightness(x, y, kwargs_list, k=None)[source]¶
- Parameters:
x (set or single 1d numpy array) – coordinate in units of arcsec relative to the center of the image
y (set or single 1d numpy array) – coordinate in units of arcsec relative to the center of the image
kwargs_list – keyword argument list of light profile
k – integer or tuple of integers for selecting subsets of light profiles
- total_flux(kwargs_list, norm=False, k=None)[source]¶
Computes the total flux of each individual light profile. This allows to estimate the total flux as well as lenstronomy amp to magnitude conversions. Not all models are supported. The units are linked to the data to be modelled with associated noise properties (default is count/s).
- Parameters:
kwargs_list – list of keyword arguments corresponding to the light profiles. The ‘amp’ parameter can be missing.
norm – bool, if True, computes the flux for amp=1
k – int or tuple of ints, if set, only evaluates the specific light model
- Returns:
list of (total) flux values attributed to each profile
- property param_name_list¶
Returns the list of all parameter names. Should be used outside of JIT.
- Returns:
list of lists of strings (for each light model separately)
- property param_name_list_latex¶
Returns the list of all parameter names in LateX style. Should be used outside of JIT.
- Returns:
list of lists of strings (for each light model separately)
- check_parameters(kwargs_list)[source]¶
Checks whether the parameter list is consistent with the parameters required by the light model. Should be used outside of JIT.
- Parameters:
kwargs_list – keyword argument list as parameterised models
- Returns:
None or raise ValueError with error message of what parameter is not supported.
jaxtronomy.LightModel.linear_basis module¶
- class LinearBasis(**kwargs)[source]¶
Bases:
LightModelBaseClass to handle source and lens light models.
- functions_split(x, y, kwargs_list, k=None)[source]¶
Split model in different components.
- Parameters:
x – coordinate in units of arcsec relative to the center of the image
y – coordinate in units of arcsec relative to the center of the image
kwargs_list – keyword argument list of light profile
k – integer or tuple of integers for selecting subsets of light profiles
- num_param_linear(kwargs_list, list_return=False)[source]¶
Returns the the number of linear components per model.
- Parameters:
kwargs_list – list of keyword arguments of the light profiles
list_return – bool, if True returns list of individual number of parameters
- Returns:
number of linear basis set coefficients
- num_param_linear_list(kwargs_list)[source]¶
Returns the list (in order of the light profiles) of the number of linear components per model.
- Parameters:
kwargs_list – list of keyword arguments of the light profiles
- Returns:
number of linear basis set coefficients
- update_linear(param, i, kwargs_list)[source]¶
- Parameters:
param – array of linear amplitude coefficients in the order of the linear minimization of the ImSim module
i – index of first coefficient to start reading out the linear parameters associated with the model components of this class
kwargs_list – list of keyword arguments of the model components
- Returns:
kwargs list with over-written or added ‘amp’ parameters according to the coefficients in param
- add_fixed_linear(kwargs_fixed_list)[source]¶
- Parameters:
kwargs_fixed_list – list of fixed keyword arguments
- Returns:
updated kwargs_fixed_list with additional linear parameters being fixed.
- linear_param_from_kwargs(kwargs_list)[source]¶
Inverse function of update_linear() returning the linear amplitude list for the keyword argument list.
- Parameters:
kwargs_list (list of keyword arguments) – model parameters including the linear amplitude parameters
- Returns:
list of linear amplitude parameters
- Return type:
list
- check_positive_flux_profile(kwargs_list)[source]¶
Check whether linear amplitude parameter are non-negative for specified list of lens models that have a physical amplitude interpretation.
- Parameters:
kwargs_list – light model parameter keyword argument list
- Returns:
bool, if True, no specified model has negative flux