jaxtronomy.LensModel.MultiPlane package¶
Submodules¶
jaxtronomy.LensModel.MultiPlane.decoupled_multi_plane module¶
- class MultiPlaneDecoupled(z_source, lens_model_list, lens_redshift_list, cosmo=None, observed_convention_index=None, ignore_observed_positions=False, z_source_convention=None, z_lens_convention=None, cosmo_interp=False, z_interp_stop=None, num_z_interp=100, profile_kwargs_list=None, distance_ratio_sampling=False, cosmology_sampling=False, cosmology_model='FlatLambdaCDM', x0_interp=None, y0_interp=None, alpha_x_interp_foreground=None, alpha_y_interp_foreground=None, alpha_x_interp_background=None, alpha_y_interp_background=None, z_split=None)[source]¶
Bases:
MultiPlane- __init__(z_source, lens_model_list, lens_redshift_list, cosmo=None, observed_convention_index=None, ignore_observed_positions=False, z_source_convention=None, z_lens_convention=None, cosmo_interp=False, z_interp_stop=None, num_z_interp=100, profile_kwargs_list=None, distance_ratio_sampling=False, cosmology_sampling=False, cosmology_model='FlatLambdaCDM', x0_interp=None, y0_interp=None, alpha_x_interp_foreground=None, alpha_y_interp_foreground=None, alpha_x_interp_background=None, alpha_y_interp_background=None, z_split=None)[source]¶
A class for multiplane lensing in which the deflection angles at certain coordinates are fixed through user-specified interpolation functions. These functions return fixed deflection angles that effectively decouple deflections by a group of deflectors at redshift Z from deflections produced by halos at redshift< Z.
This class breaks the recursive nature of the multi-plane lens equation, and can significantly speed up computations with a large number of line-of-sight halos.
- Parameters:
lens_model_list – list of lens model strings
lens_redshift_list – list of floats with redshifts of the lens models indicated in lens_model_list
z_source_convention – float, redshift of a source to define the reduced deflection angles of the lens models. If None, ‘z_source’ is used.
cosmo – instance of astropy.cosmology
profile_kwargs_list – list of dicts, keyword arguments used to initialize profile classes in the same order of the lens_model_list. If any of the profile_kwargs are None, then that profile will be initialized using default settings.
x0_interp – a function that maps an angular coordinate on the sky to the x coordinate of a physical position [Mpc] at the first lens plane
y0_interp – same as x0_interp, but returns the y coordinate in Mpc
alpha_x_interp_list – a list of functions that take as input angular coordinates (x, y) and returns the x-component of the deflection angle at each coorindate
alpha_y_interp_list – same as alpha_x_interp_list, but returns the y-component of the deflection angle at (x,y)
z_interp_list – a list of redshifts corresponding to the alpha_x_interp_list and alpha_y_interp_list entries
- geo_shapiro_delay(**kwargs)[source]¶
Geometric and Shapiro (gravitational) light travel time relative to a straight path through the coordinate (0,0) Negative sign means earlier arrival time.
- Parameters:
theta_x – angle in x-direction on the image
theta_y – angle in y-direction on the image
kwargs_lens – lens model keyword argument list
check_convention – boolean, if True goes through the lens model list and checks whether the positional conventions are satisfied.
- Returns:
geometric delay, gravitational delay [days]
- ray_shooting_partial_comoving(*args, **kwargs)[source]¶
Ray-tracing through parts of the cone, starting with (x,y) in angular units as seen on the sky without lensing and angles (alpha_x, alpha_y) as seen at redshift z_start and then backwards to redshift z_stop.
- Parameters:
theta_x – angular position on the sky [arcsec]
theta_y – angular position on the sky [arcsec]
alpha_x – ray angle at z_start [arcsec]
alpha_y – ray angle at z_start [arcsec]
z_start – redshift of start of computation
z_stop – redshift where output is computed
kwargs_lens – lens model keyword argument list
include_z_start – bool, if True, includes the computation of the deflection angle at the same redshift as the start of the ray-tracing. ATTENTION: deflection angles at the same redshift as z_stop will be computed always! This can lead to duplications in the computation of deflection angles.
T_ij_start – transverse angular distance between the starting redshift to the first lens plane to follow. If not set, will compute the distance each time this function gets executed.
T_ij_end – transverse angular distance between the last lens plane being computed and z_end. If not set, will compute the distance each time this function gets executed.
check_convention – flag to check the image position convention (leave this alone)
- Returns:
angular position and angles at redshift z_stop
- ray_shooting(theta_x, theta_y, kwargs_lens, *args, **kwargs)[source]¶
Ray-shooting through the lens volume with fixed deflection angles at certain lens planes passed through the alpha_x_interp/alpha_y_interp lists. Starts with (x,y) co-moving distance passed through the x0_interp and y0_interp functions, then starts multi-plane ray-tracing through all subsequent lens planes.
- Parameters:
theta_x – angular coordinate on the sky
theta_y – angular coordinate on the sky
kwargs_lens – keyword arguments for the main deflector
- Returns:
coordinates on the source plane
- alpha(theta_x, theta_y, kwargs_lens, *args, **kwargs)[source]¶
Reduced deflection angle.
- Parameters:
theta_x – angle in x-direction
theta_y – angle in y-direction
kwargs_lens – lens model kwargs
- Returns:
deflection angles in x and y directions
- hessian(theta_x, theta_y, kwargs_lens, diff=1e-08, *args, **kwargs)[source]¶
Computes the hessian components f_xx, f_yy, f_xy from f_x and f_y with numerical differentiation.
- Parameters:
theta_x (numpy array) – x-position (preferentially arcsec)
theta_y (numpy array) – y-position (preferentially arcsec)
kwargs_lens – list of keyword arguments of lens model parameters matching the lens model classes
diff – numerical differential step (float)
- Returns:
f_xx, f_xy, f_yx, f_yy