Skip to content

Point source¤

caustics.point_source ¤

mag_point_source(w, nlenses = 2, roots_itmax = 2500, roots_compensated = False, **params) ¤

Compute the magnification of a point source for a system with nlenses lenses. If nlenses is 2 (binary lens) or 3 (triple lens), the coordinate system is set up such that the the origin is at the center of mass of the first two lenses which are both located on the real line. The location of the first lens is \(-sq/(1 + q)\) and the second lens is at \(s/(1 + q)\). The optional third lens is located at an arbitrary position in the complex plane \(r_3e^{-i\psi}\). For a single lens lens the magnification is computed analytically. For binary and triple lenses computing the magnification involves solving for the roots of a complex polynomial with degree (nlenses**2 + 1) using the Elrich-Aberth algorithm.

If nlenses is 2 only the parameters s and q should be specified. If nlenses is 3, the parameters s, q, q3, r3 and psi should be specified.

Parameters:

Name Type Description Default
w array_like

Source position in the complex plane.

required
nlenses int

Number of lenses in the system.

2
s float

Separation between the two lenses. The first lens is located at \(-sq/(1 + q)\) and the second lens is at \(s/(1 + q)\) on the real line.

required
q float

Mass ratio defined as \(m_2/m_1\).

required
q3 float

Mass ratio defined as \(m_3/m_1\).

required
r3 float

Magnitude of the complex position of the third lens.

required
psi float

Phase angle of the complex position of the third lens.

required
roots_itmax int

Number of iterations for the root solver.

2500
roots_compensated bool

Whether to use the compensated arithmetic version of the Ehrlich-Aberth root solver.

False

Returns:

Name Type Description
array_like

The point source magnification evaluated at w.

critical_and_caustic_curves(npts = 200, nlenses = 2, **params) ¤

Compute critical and caustic curves for visualization purposes.

If nlenses is 2 only the parameters s and q should be specified. If nlenses is 3, the parameters s, q, q3, r3 and psi should be specified.

Parameters:

Name Type Description Default
npts int

Number of points to when computing the critical curves.

200
nlenses int

Number of lenses in the system.

2
s float

Separation between the two lenses. The first lens is located at \(-sq/(1 + q)\) and the second lens is at \(s/(1 + q)\) on the real line.

required
q float

Mass ratio defined as \(m_2/m_1\).

required
q3 float

Mass ratio defined as \(m_3/m_1\).

required
r3 float

Magnitude of the complex position of the third lens.

required
psi float

Phase angle of the complex position of the third lens.

required

Returns:

Name Type Description
tuple

Tuple (critical_curves, caustic_curves) where both elements are arrays with shape (nlenses, npts) containing continuous segments of the critical curves and caustics.