Lens#
- class silmaril.lens.Lens(x_deflections, y_deflections, wcs, redshift, unit='arcsec')#
Bases:
objectClass representing a lensing cluster.
- Parameters:
x_deflections (np.ndarray) – x-component of the deflection angles
y_deflections (np.ndarray) – y-component of the deflection angles
wcs (astropy.wcs.WCS) – WCS object for the deflection angle map
redshift (float) – redshift of the lensing cluster
unit (str, optional) – units of the deflection angles (options are “arcseconds” and “pixels”), defaults to “arcseconds”
- wcs#
WCS object for the deflection angle map
- redshift#
redshift of the lensing cluster
- scale#
pixel scale of the deflection angle map
- x_deflections#
x-component of the deflection angles
- y_deflections#
y-component of the deflection angles
- __init__(x_deflections, y_deflections, wcs, redshift, unit='arcsec')#
Methods
__init__(x_deflections, y_deflections, wcs, ...)caustic(image_plane_grid, source_redshift[, ...])Returns a list of points on the source plane corresponding to the caustic of the lensing cluster.
convergence(grid, source_redshift)Computes the convergence of the lensing cluster on the given grid.
magnification(grid, source_redshift)Computes the magnification of the lensing cluster on the given grid.
magnification_line(grid, source_redshift[, ...])Returns a list of points in the image plane with magnification greater than a given threshold.
trace_grid(grid, source_redshift)Ray trace a grid from the image plane back to the source plane at a given redshift.
trace_points(points, source_redshift)Ray trace a set of points from the image plane back to the source plane at a given redshift.
- caustic(image_plane_grid, source_redshift, threshold=500)#
Returns a list of points on the source plane corresponding to the caustic of the lensing cluster. The caustic is computed by ray tracing the points on the magnification line back to the source plane.
- Parameters:
image_plane_grid (Grid) – image plane grid on which to compute the magnification
source_redshift (float) – redshift of the source
threshold (float, optional) – threshold used to filter magnification values, defaults to 500
- Returns:
list of points on the caustic
- Return type:
numpy.ndarray
- convergence(grid, source_redshift)#
Computes the convergence of the lensing cluster on the given grid.
- Parameters:
grid (Grid) – grid on which to compute the convergence
source_redshift (float) – redshift of the source
- Returns:
2d array of convergence values
- Return type:
numpy.ndarray
- magnification(grid, source_redshift)#
Computes the magnification of the lensing cluster on the given grid.
- Parameters:
grid (Grid) – grid on which to compute the magnification
source_redshift (float) – redshift of the source
- Returns:
2d array of magnification values
- Return type:
numpy.ndarray
- magnification_line(grid, source_redshift, threshold=500)#
Returns a list of points in the image plane with magnification greater than a given threshold.
- Parameters:
grid (Grid) – grid on which to compute the magnification
source_redshift (float) – redshift of the source
threshold (float, optional) – threshold used to filter magnification values, defaults to 500
- Returns:
list of points with magnification greater than threshold
- Return type:
unknown
- trace_grid(grid, source_redshift)#
Ray trace a grid from the image plane back to the source plane at a given redshift.
- Parameters:
grid (Grid) – grid to trace
source_redshift (float) – redshift of the source
- Returns:
traced grid in meshgrid format
- Return type:
tuple(numpy.ndarray,numpy.ndarray)
- trace_points(points, source_redshift)#
Ray trace a set of points from the image plane back to the source plane at a given redshift.
- Parameters:
points (numpy.ndarray) – list of points to trace given in world coordinates as an array of shape (n,2)
source_redshift (float) – redshift of the source
- Returns:
list of traced points
- Return type:
numpy.ndarray