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:
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
- Attributes :
- trajectory:
trajectory
Trajectory used to calculate positions of the source that are used to calculate magnification values.
- trajectory:
- set_magnification_methods(methods, default_method)¶
Sets methods used for magnification calculation.
- For available methods, see:
get_point_lens_magnification()
and
- 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.
- 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}}
.
- get_magnification()¶
Calculate magnification.
- Returns :
- magnification: np.ndarray
Vector of magnifications.
- get_point_lens_magnification()¶
Calculate the Point Lens magnification.
- Allowed magnification methods (set by
set_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_uniform_Gould94_direct
:Same as
finite_source_uniform_Gould94
, but calculates the underlying functions directly (i.e., without interpolation).finite_source_uniform_WittMao94
:Uses the Witt and Mao 1994 ApJ, 430, 505 method assuming a uniform (and circular) source. This method interpolates pre-computed tables. The relative interpolation errors are smaller than 10^-4.
finite_source_LD_WittMao94
:Uses the Witt and Mao 1994 ApJ, 430, 505 method and integrates multiple annuli to obtain magnification for a circular source including limb-darkening. For description of integration of multiple annuli see, e.g., Bozza et al. 2018 MNRAS, 479, 5157. 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_LD_Yoo04_direct
:Same as
finite_source_LD_Yoo04
, but calculates the underlying functions directly (i.e., without interpolation), 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.
- Allowed magnification methods (set by
- get_binary_lens_magnification()¶
Calculate the binary lens magnification. If the shear or convergence are set, then they are used.
- Allowed magnification methods (set by
set_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()
Note that it doesn’t work if shear or convergence are set.
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.
- Allowed magnification methods (set by
- get_d_A_d_params(parameters)¶
Calculate d A / d parameters for a point lens model.
- Parameters :
- parameters: list
List of the parameters to take derivatives with respect to.
- Returns :
- dA_dparam: dict
Keys are parameter names from parameters argument above. Values are the partial derivatives for that parameter evaluated at each epoch.
- get_d_A_d_rho()¶
Calculate d A / d rho for a point lens model.
No Inputs
- Returns :
- dA_drho: np.array
Values are the partial derivatives for rho evaluated at each data point.
- property methods_for_epochs¶
list
for each epoch, decide which methods should be used to calculate magnification, but don’t run the calculations
- property methods_indices¶
dict
Keys are the magnification methods. Values are a boolean index that indicate which epochs should be calculated with each method.