autolens.Tracer

class autolens.Tracer(planes, cosmology, profiling_dict: Optional[Dict[KT, VT]] = None)
__init__(planes, cosmology, profiling_dict: Optional[Dict[KT, VT]] = None)

Ray-tracer for a lens system with any number of planes.

The redshift of these planes are specified by the redshits of the galaxies; there is a unique plane redshift for every unique galaxy redshift (galaxies with identical redshifts are put in the same plane).

To perform multi-plane ray-tracing, a cosmology must be supplied so that deflection-angles can be rescaled according to the lens-geometry of the multi-plane system. All galaxies input to the tracer must therefore have redshifts.

This tracer has only one grid (see gridStack) which is used for ray-tracing.

Parameters:
  • galaxies ([Galaxy]) – The list of galaxies in the ray-tracing calculation.
  • image_plane_grid (grid_stacks.GridStack) – The image-plane grid which is traced. (includes the grid, sub-grid, blurring-grid, etc.).
  • border (masks.GridBorder) – The border of the grid, which is used to relocate demagnified traced pixels to the source-plane borders.
  • cosmology (astropy.cosmology) – The cosmology of the ray-tracing calculation.

Methods

__init__(planes, cosmology, profiling_dict, …) Ray-tracer for a lens system with any number of planes.
area_within_tangential_critical_curve_from(grid)
blurred_image_2d_via_convolver_from(grid, …) Extract the 1D image and 1D blurring image of every plane and blur each with the PSF using a convolver (see imaging.convolution).
blurred_image_2d_via_psf_from(grid, psf, …) Extract the 1D image and 1D blurring image of every plane and blur each with the PSF using a psf (see imaging.convolution).
blurred_images_of_planes_via_convolver_from(…) Extract the 1D image and 1D blurring image of every plane and blur each with the PSF using a convolver (see imaging.convolution).
blurred_images_of_planes_via_psf_from(grid, …) Extract the 1D image and 1D blurring image of every plane and blur each with the PSF using a psf (see imaging.convolution).
caustics_from(grid[, pixel_scale])
convergence_1d_from(grid)
convergence_2d_from(grid)
convergence_func(grid_radius)
convergence_via_hessian_from(grid[, buffer])
convergence_via_jacobian_from(grid[, jacobian])
convolve_via_convolver(image, …)
critical_curves_from(grid[, pixel_scale])
deflection_magnitudes_from(grid)
deflections_2d_from(grid)
deflections_2d_via_potential_2d_from(grid)
deflections_between_planes_from(grid[, …])
deflections_of_planes_summed_from(grid)
einstein_mass_angular_from(grid[, pixel_scale])
einstein_radius_from(grid[, pixel_scale])
extract_attribute(cls, attr_name) Returns an attribute of a class in the tracer as a ValueIrregular or Grid2DIrregular object.
extract_attributes_of_galaxies(cls, attr_name) Returns an attribute of a class in the tracer as a list of ValueIrregular or Grid2DIrregular objects, where the indexes of the list correspond to the tracer’s galaxies.
extract_attributes_of_planes(cls, attr_name) Returns an attribute of a class in the tracer as a list of ValueIrregular or Grid2DIrregular objects, where the indexes of the list correspond to the tracer’s planes.
extract_plane_index_of_profile(profile_name) Returns the plane index of a LightProfile`, MassProfile or Point from the Tracer using the name of that component.
extract_profile(profile_name) Returns a LightProfile, MassProfile or Point from the Tracer using the name of that component.
from_galaxies(galaxies[, cosmology, H0, …])
galaxy_blurred_image_dict_via_convolver_from(…) A dictionary associating galaxies with their corresponding model images
galaxy_image_dict_from(grid) A dictionary associating galaxies with their corresponding model images
galaxy_profile_visibilities_dict_via_transformer_from(…) A dictionary associating galaxies with their corresponding model images
grid_at_redshift_from(grid, redshift) For an input grid of (y,x) arc-second image-plane coordinates, ray-trace the coordinates to any redshift in the strong lens configuration.
hessian_from(grid[, buffer, deflections_func])
hyper_noise_map_from(noise_map)
hyper_noise_maps_of_planes_from(noise_map)
image_2d_from(grid)
image_2d_of_planes_from(grid)
inversion_imaging_from(grid, image, …[, …])
inversion_interferometer_from(grid, …[, …])
jacobian_from(grid)
load(file_path[, filename])
magnification_2d_from(grid)
magnification_via_hessian_from(grid[, …])
mapper_list_from(grid[, …])
mass_integral(x) Routine to integrate an elliptical light profiles - set axis ratio to 1 to compute the luminosity within a circle
padded_image_2d_from(grid, psf_shape_2d)
plane_with_galaxy(galaxy)
potential_1d_from(grid)
potential_2d_from(grid)
potential_func(u, y, x)
profile_visibilities_of_planes_via_transformer_from(…)
profile_visibilities_via_transformer_from(…)
radial_caustic_from(grid[, pixel_scale])
radial_critical_curve_from(grid[, pixel_scale])
radial_eigen_value_from(grid[, jacobian])
save(file_path[, filename]) Save the tracer by serializing it with pickle.
set_snr_of_snr_light_profiles(grid, …)
shear_via_hessian_from(grid[, buffer])
shear_via_jacobian_from(grid[, jacobian])
shear_yx_via_hessian_from(grid[, buffer])
shear_yx_via_jacobian_from(grid[, jacobian])
sliced_tracer_from(lens_galaxies, …[, …]) Ray-tracer for a lens system with any number of planes.
sparse_image_plane_grid_list_of_planes_from(grid) Specific pixelizations, like the VoronoiMagnification, begin by determining what will become its the source-pixel centres by calculating them in the image-plane.
tangential_caustic_from(grid[, pixel_scale])
tangential_critical_curve_from(grid[, …])
tangential_eigen_value_from(grid[, jacobian])
traced_grids_of_inversion_from(grid)
traced_grids_of_planes_from(grid[, …])
traced_sparse_grids_list_of_planes_from(grid) Ray-trace the sparse image plane grid used to define the source-pixel centres by calculating the deflection angles at (y,x) coordinate on the grid from the galaxy mass profiles and then ray-trace them from the image-plane to the source plane.
unmasked_blurred_image_2d_via_psf_from(grid, psf)
unmasked_blurred_image_of_planes_and_galaxies_via_psf_from(…)
unmasked_blurred_image_of_planes_via_psf_from(…)

Attributes

all_planes_have_redshifts
angle
centre
contribution_map
contribution_maps_of_planes
flux_hack This is a placeholder to get flux modeling working for Nan Li before I do this proeprly.
galaxies
has_hyper_galaxy
has_light_profile
has_mass_profile
has_pixelization
has_regularization
hyper_galaxy_image_list_of_planes
image_plane
mass_profiles
mass_profiles_of_planes
pixelization_list
pixelization_list_of_planes
plane_indexes_with_pixelizations
planes_with_light_profile
planes_with_mass_profile
point_dict
point_plane_index_dict
regularization_list
regularization_list_of_planes
source_plane
total_planes
upper_plane_index_with_light_profile
flux_hack

This is a placeholder to get flux modeling working for Nan Li before I do this proeprly. with dictionaries.

classmethod sliced_tracer_from(lens_galaxies, line_of_sight_galaxies, source_galaxies, planes_between_lenses, cosmology=FlatLambdaCDM(name="Planck15", H0=67.7 km / (Mpc s), Om0=0.307, Tcmb0=2.725 K, Neff=3.05, m_nu=[0. 0. 0.06] eV, Ob0=0.0486))

Ray-tracer for a lens system with any number of planes.

The redshift of these planes are specified by the input parameters lens_redshifts and slices_between_main_planes. Every galaxy is placed in its closest plane in redshift-space.

To perform multi-plane ray-tracing, a cosmology must be supplied so that deflection-angles can be rescaled according to the lens-geometry of the multi-plane system. All galaxies input to the tracer must therefore have redshifts.

This tracer has only one grid (see gridStack) which is used for ray-tracing.

Parameters:
  • lens_galaxies ([Galaxy]) – The list of galaxies in the ray-tracing calculation.
  • image_plane_grid (grid_stacks.GridStack) – The image-plane grid which is traced. (includes the grid, sub-grid, blurring-grid, etc.).
  • planes_between_lenses ([int]) – The number of slices between each main plane. The first entry in this list determines the number of slices between Earth (redshift 0.0) and main plane 0, the next between main planes 0 and 1, etc.
  • border (masks.GridBorder) – The border of the grid, which is used to relocate demagnified traced pixels to the source-plane borders.
  • cosmology (astropy.cosmology) – The cosmology of the ray-tracing calculation.