MulensModel.mulensobjects.lens module¶
-
class
MulensModel.mulensobjects.lens.Lens(total_mass=None, mass=None, mass_1=None, mass_2=None, a_proj=None, distance=None, q=None, s=None, epsilon=None)¶ Bases:
objectA mass or system of masses.
Standard parameter combinations for defining a Lens object:
2+ body lens:
Note that s, q, and epsilon may be single values, lists, or numpy ndarrays.
If units are not specified for a given mass, it is assumed the value given is in Solar Masses.
If units are not specified for distance it is assumed the value is given in kpc.
-
epsilon¶ [float, list, numpy.ndarray]
An array of mass fractions for each lens components: m_i/total_mass. Stored as a numpy.ndarray.
-
q¶ [float, list, numpy.ndarray]
mass ratio for companions relative to the primary
Array of mass ratios defined relative to the primary (m_i/m_1). Size is number of components -1. Set as a list, np.ndarray, or single value.
Note: if
total_massis defined before q, it is assumed this is the mass of the primary. If you want this to actually be the total mass, define it after defining q.
-
s¶ [float, list, numpy.ndarray]
Separation between the components of the lens as a fraction of the Einstein ring. A np.ndarray or single value.
Definitions for more than 2 lens bodies TBD
-
total_mass¶ astropy.Quantity
The total mass of the lens (sum of all components). An astropy.Quantity with mass units. If set as a float, units are assumed to be solMass.
-
mass¶ astropy.Quantity
The mass of a point lens –> total mass. An astropy.Quantity with mass units. May be set as a float (in which case solMass is assumed).
-
mass_1¶ astropy.Quantity
The mass of the primary. Defined as total_mass * epsilon[0]. An astropy.Quantity with mass units. If set as a float, units are assumed to be solMass.
-
mass_2¶ astropy.Quantity
The mass of the secondary. Defined as total_mass * epsilon[1]. An astropy.Quantity with mass units. If set as a float, units are assumed to be solMass.
Note that if total_mass is defined before mass_2, and there is no epsilon corresponding to mass_2, mass_2 is added to the total_mass.
-
mass_3¶ astropy.Quantity
The mass of the tertiary. Defined as total_mass * epsilon[2]. An astropy.Quantity with mass units. If set as a float, units are assumed to be solMass.
Note that if total_mass is defined before mass_3, and there is no epsilon corresponding to mass_3, mass_3 is added to the total_mass.
-
n_masses¶ int, read-only
number of masses in the system.
-
distance¶ astropy.Quantity
The distance to the lens.
May be set as a float. If no unit is given, the value is assumed to be kpc.
-
pi_L¶ astropy.Quantity
The parallax to the lens in milliarcseconds. May be set as a float, in which case units are assumed to be milliarcseconds.
-
a_proj¶ astropy.Quantity
Projected separation between the components of the lens in AU. An astropy.Quantity with distance units. If set as float (without units), AU is assumed.
-
plot_caustics(n_points=5000, **kwargs)¶ A function to plot the x,y coordinates (scaled to the Einstein ring) of the caustics. Pyplot scatter is used for plotting. See
MulensModel.caustics.Caustics.plot().- Parameters :
- n_points: int
- Number of points be plotted.
**kwargs:- Keyword arguments passed to Pyplot scatter
-