MulensModel.magnificationcurve module

class MulensModel.magnificationcurve.MagnificationCurve(times, parameters, parallax=None, coords=None, satellite_skycoord=None, gamma=0.0)

Bases: object

The magnification curve calculated from the model light curve.

The key function is set_magnification_methods(), which specifies the method used to calculate the finite source magnification and when to use it..

Arguments :
times: iterable of floats
the times at which to generate the magnification curve
parameters: ModelParameters
specifies the microlensing parameters
parallax: dict, optional
dictionary specifying what parallax effects should be used, e.g., {'earth_orbital': True, 'satellite': False, 'topocentric': False}
coords: MulensModel.coordinates.Coordinates, optional
sky coordinates of the event
satellite_skycoord: Astropy.coordinates.SkyCoord, optional
sky coordinates of the satellite specified by the ephemerides file. see MulensModel.mulensdata.MulensData.satellite_skycoord.
gamma: float, optional
limb darkening coefficient in gamma convention; defaults to 0
set_magnification_methods(methods, default_method)

Sets methods used for magnification calculation.

For available methods, see:

get_point_lens_magnification()

and

get_binary_lens_magnification()

Parameters :
methods: list

List that specifies which methods (str) should be used when (float values for Julian dates). Given method will be used for times between the times between which it is on the list, e.g.,

methods = [2455746., 'Quadrupole', 2455746.6, 'Hexadecapole', 2455746.7, 'VBBL', 2455747., 'Hexadecapole', 2455747.15, 'Quadrupole', 2455748.]

default_method: str
Name of the method to be used for epochs outside the ranges specified in methods.

For point-lens with finite source, the methods named finite_source_uniform_Gould94 and finite_source_LD_Yoo04 implement the algorithms presented by Gould 1994 ApJ, 421L, 71 and Yoo et al. 2004 ApJ, 603, 139 and interpolate pre-computed tables when possible. Add _direct to these names to force direct integration.

set_magnification_methods_parameters(methods_parameters)

Set additional parameters for magnification calculation methods.

Parameters :
methods_parameters: dict
Dictionary that for method names (keys) returns dictionary in the form of **kwargs that are passed to given method, e.g., {'VBBL': {'accuracy': 0.005}}.
magnification

np.ndarray

provide vector of magnifications

get_magnification()

Calculate magnification.

Returns :
magnification: np.ndarray
Vector of magnifications.
get_point_lens_magnification()

Calculate the Point Lens magnification.

Allowed magnification methods :
point_source:
standard Paczynski equation for a point source/point lens.
finite_source_uniform_Gould94:
Uses the Gould 1994 ApJ, 421L, 71 prescription assuming a uniform (and circular) source. This method interpolates pre-computed tables. The relative interpolation errors are smaller than 10^-4.
finite_source_LD_Yoo04:
Uses the Yoo et al. 2004 ApJ, 603, 139 prescription for a circular source including limb-darkening. This method interpolates pre-computed tables. The relative interpolation errors are smaller than 10^-4.
finite_source_uniform_Gould94_direct:
Uses the Gould 1994 ApJ, 421L, 71 prescription assuming a uniform (and circular) source. This method calculates the underlying functions directly.
finite_source_LD_Yoo04_direct:
Uses the Yoo et al. 2004 ApJ, 603, 139 prescription for a circular source including limb-darkening. This method calculates 2D integral directly (hence can be slow).
finite_source_uniform_Lee09:
Uses the Lee et al. 2009 ApJ, 695, 200 method for a circular and uniform source. This method works well for large sources (rho ~ 1).
finite_source_LD_Lee09:
Uses the Lee et al. 2009 ApJ, 695, 200 method for a circular source including limb-darkening. This method works well for large sources (rho ~ 1) but can be slow compared to other methods.
Returns :
magnification: np.ndarray
Vector of magnifications.
get_binary_lens_magnification()

Calculate the binary lens magnification.

Allowed magnification methods :
point_source:
standard point source magnification calculation.
quadrupole:
From Gould 2008 ApJ, 681, 1593. See hexadecapole_magnification()
hexadecapole:
From Gould 2008 ApJ, 681, 1593 See hexadecapole_magnification()
VBBL:
Uses VBBinaryLensing (a Stokes theorem/contour integration code) by Valerio Bozza (Bozza 2010 MNRAS, 408, 2188). See vbbl_magnification()
Adaptive_Contouring:
Uses AdaptiveContouring (a Stokes theorem/contour integration code) by Martin Dominik (Dominik 2007 MNRAS, 377, 1679). See adaptive_contouring_magnification()
point_source_point_lens:
Uses point-source _point_-_lens_ approximation; useful when you consider binary lens but need magnification very far from the lens (e.g. at separation u = 100).
Returns :
magnification: np.ndarray
Vector of magnifications.