Skip to content

Lightcurve¤

caustics.lightcurve ¤

Computing the magnification of an extended source at an arbitrary set of points in the source plane.

mag(w_points, rho, nlenses = 2, npts_limb = 200, limb_darkening = False, u1 = 0.0, npts_ld = 100, roots_itmax = 2500, roots_compensated = False, **params) ¤

Compute the extended source magnification for a system with nlenses lenses and a source star radius rho at a set of complex points w_points in the source plane. This function calls either [caustics.multipole._mag_hexadecapole] or caustics.mag_extended_source at each point in w_points depending on whether or not the hexadecapole approximation is accurate enough at that point.

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}\). The magnification is computed using contour integration in the image plane. Boolean flag limb_darkening indicates whether linear limb-darkening needs to taken into account. If limb_darkening is set to True the linear limb-darkening coefficient u1 needs to be specified as well. Note that turning on this flag slows down the computation by up to an order of magnitude.

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.

Note

Turning on limb-darkening (limb_darkening=True) slows down the computation by up to an order of magnitude.

Warning

At the moment the test determining whether or not to use the hexadecapole approximation does not work for triple lenses so the function will use full contour integration at every point. This substantially slows down the computation. See https://github.com/fbartolic/caustics/issues/19.

Parameters:

Name Type Description Default
w_points array_like

Source positions in the complex plane.

required
rho float

Source radius in Einstein radii.

required
nlenses int

Number of lenses in the system.

2
npts_limb int

Initial number of points uniformly distributed on the source limb when computing the point source magnification. The final number of points is greater than this value because the number of points is decreased geometrically by a factor of 1/2 until it reaches 2.

200
limb_darkening bool

If True, compute the magnification of a limb-darkened source. If limb_darkening is enabled the u1 linear limb-darkening coefficient needs to be specified. Defaults to False.

False
u1 float

Linear limb darkening coefficient. Defaults to 0..

0.0
npts_ld int

Number of points at which the stellar brightness function is evaluated when computing contour integrals \(\int P(z_1^\prime, z_2) dz_1^\prime\) and \(\int Q(z_1, z_2^\prime) dz_2^\prime\) (see Dominik 1998). Defaults to 100. 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.

100
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

Magnification array.