Skip to main content

Module lensing

Module lensing 

Source
Expand description

Gravitational lensing.

Structs§

LensingField
2D grid of deflection vectors around a point mass.
LensingRenderer
Renderer for gravitational lensing effects.

Functions§

apply_lensing
Apply gravitational lensing to glyph positions. Deflects each position away from the lens center.
deflection_angle
Deflection angle for a light ray passing a mass M at impact parameter b. alpha = 4GM / (b * c^2)
einstein_radius
Einstein radius: the angular radius of a perfect ring image. theta_E = sqrt(4GM / c^2 * D_ls / (D_l * D_s))
image_positions
Image positions for a point lens. Returns two image angles (theta_+, theta_-). theta_+/- = (beta +/- sqrt(beta^2 + 4*theta_E^2)) / 2
lens_equation
Lens equation: theta - beta = theta_E^2 / theta Returns theta - beta - theta_E^2/theta (should be zero for image positions).
magnification
Magnification of an image at angle theta for Einstein radius theta_E. mu = (theta / theta_E)^4 / ((theta/theta_E)^4 - 1) Equivalently: mu = |theta / beta * d(theta)/d(beta)|
microlensing_lightcurve
Microlensing light curve: amplification as a function of time. Paczynski formula: A(u) = (u^2 + 2) / (u * sqrt(u^2 + 4)) where u = sqrt(u_min^2 + ((t - t0)/t_E)^2)
sis_critical_radius
Compute the critical curve radius for a singular isothermal sphere lens.
total_magnification
Total magnification from both images of a point lens. A_total = (u^2 + 2) / (u * sqrt(u^2 + 4))