BAGLE - Bayesian Analysis of Gravitational Lensing Events
BAGLE allows modeling of gravitational microlensing events both photometrically and astrometrically. Supported microlensing models include:
PSPL: point-source, point-lens with parallax
PSBL: point-source, binary-lens
FSPL: finite-source, point-lens (currently testing further)
All models support fitting data with single or multi-band photometry only, astrometry only, or joint fitting of photometry and astrometry (recommended).
BAGLE TUTORIAL
To learn to use BAGLE models, make microlensing events, and make photometric or astrometric plots, we have created a Jupyter Notebook tutorial.
PSPL Model - No Parallax
The first step in the tutorial is to generate a PSPL model with no parallax and do the following:
Get amplification of event over time
Plot the astrometric shift over time
Animate the microlensing event


PSPL Model - With parallax
The second step is to generate a PSPL model with parallax adding the ra (right ascention of lens) and dec (declination of lens).
PSPL Model From Belokurov and Evans 2002 (Figure 1)
Then a series of plots are made of the lens, source, and image positions on the sky for a set of microlensing event parameters previously published.


Overview of bagle.model
model.py is a module that contains a set of classes and functions that allow the user to construct microlensing models. The available classes for instantiating a microlensing event are shown in the list below. See the API documentation for each class for details.
Example
To instantiate a model:
from bagle import model
mL = 10.0 # msun
t0 = 57000.00
xS0 = np.array([0.000, 0.000])
beta = 1.4 # mas
muS = np.array([8.0, 0.0])
muL = np.array([0.00, 0.00])
dL = 4000.0
dS = 8000.0
b_sff = [1.0] # one for each filter
mag_src = [19.0] # one for each filter
event1 = model.PSPL_PhotAstrom_noPar_Param1(mL,
t0, beta, dL, dL / dS,
xS0[0], xS0[1], muL[0], muL[1],
muS[0], muS[1],
b_sff, mag_src)
# Get time range for event
t = np.arange(event1.t0 - 3000,
event1.t0 + 3000, 1)
dt = t - event1.t0
# Quanties you can print
A = event1.get_amplification(t)
shift = event1.get_centroid_shift(t)
shift_amp = np.linalg.norm(shift, axis=1)
Note, each model class has a name that typically has a structure of
<ModelDataType>_<Parallax>_<GP>_<Parameterization>
For example, PSPL_Phot_noPar_Param2 has a data and model class type of PSPL_Phot, which contains a point-source, point-lens event with photometry only. The model has no parallax, no GP and uses parameterization #2.
The complete list of instantiable model classes is:
Point source, point lens, photometry only:
PSPL_Phot_noPar_Param1
PSPL_Phot_noPar_Param2
PSPL_Phot_Par_Param1
PSPL_Phot_Par_Param2
PSPL_Phot_Par_Param1_geoproj
PSPL_Phot_noPar_GP_Param1
PSPL_Phot_noPar_GP_Param2
PSPL_Phot_Par_GP_Param1
PSPL_Phot_Par_GP_Param1_2
PSPL_Phot_Par_GP_Param2
PSPL_Phot_Par_GP_Param2_2
Point source, point lens, photometry and astrometry:
PSPL_PhotAstrom_noPar_Param1
PSPL_PhotAstrom_noPar_Param2
PSPL_PhotAstrom_noPar_Param3
PSPL_PhotAstrom_noPar_Param4
PSPL_PhotAstrom_Par_Param4_geoproj
PSPL_PhotAstrom_Par_Param1
PSPL_PhotAstrom_Par_Param2
PSPL_PhotAstrom_Par_Param3
PSPL_PhotAstrom_Par_Param4
PSPL_PhotAstrom_Par_Param5
PSPL_PhotAstrom_LumLens_Par_Param1
PSPL_PhotAstrom_LumLens_Par_Param2
PSPL_PhotAstrom_LumLens_Par_Param4
PSPL_PhotAstrom_noPar_GP_Param1
PSPL_PhotAstrom_noPar_GP_Param2
PSPL_PhotAstrom_Par_GP_Param1
PSPL_PhotAstrom_Par_GP_Param2
PSPL_PhotAstrom_Par_GP_Param3
PSPL_PhotAstrom_Par_GP_Param4
PSPL_PhotAstrom_Par_LumLens_GP_Param1
PSPL_PhotAstrom_Par_LumLens_GP_Param2
PSPL_PhotAstrom_Par_LumLens_GP_Param3
PSPL_PhotAstrom_Par_LumLens_GP_Param4
Point source, point lens, astrometry only
PSPL_Astrom_Par_Param4
PSPL_Astrom_Par_Param3
Point soruce, binary lens, photometry only
PSBL_Phot_noPar_Param1
PSBL_Phot_Par_Param1
PSBL_Phot_noPar_GP_Param1
PSBL_Phot_Par_GP_Param1
Point source, binary lens, photometry and astrometry
PSBL_PhotAstrom_noPar_Param1
PSBL_PhotAstrom_noPar_Param2
PSBL_PhotAstrom_noPar_Param3
PSBL_PhotAstrom_Par_Param1
PSBL_PhotAstrom_Par_Param2
PSBL_PhotAstrom_Par_Param3
PSBL_PhotAstrom_Par_Param4
PSBL_PhotAstrom_Par_Param5
PSBL_PhotAstrom_noPar_GP_Param1
PSBL_PhotAstrom_noPar_GP_Param2
PSBL_PhotAstrom_Par_GP_Param1
PSBL_PhotAstrom_Par_GP_Param2
Binary source, point lens, photometry and only
BSPL_Phot_noPar_Param1
BSPL_Phot_Par_Param1
BSPL_Phot_noPar_GP_Param1
BSPL_Phot_Par_GP_Param1
Binary source, point lens, photometry and astrometry
BSPL_PhotAstrom_noPar_Param1
BSPL_PhotAstrom_noPar_Param2
BSPL_PhotAstrom_noPar_Param3
BSPL_PhotAstrom_Par_Param1
BSPL_PhotAstrom_Par_Param2
BSPL_PhotAstrom_Par_Param3
BSPL_PhotAstrom_noPar_GP_Param1
BSPL_PhotAstrom_noPar_GP_Param2
BSPL_PhotAstrom_noPar_GP_Param3
BSPL_PhotAstrom_Par_GP_Param1
BSPL_PhotAstrom_Par_GP_Param2
BSPL_PhotAstrom_Par_GP_Param3
Finite source, point lens, photometry and astrometry (broken)
FSPL_PhotAstrom_Par_Param1
Developers
Each model class i built up from a menu of different features by inheriting from multiple base classes, each from a different ‘family’ of related classes.
Each microlensing model must contain:
A class from the Data Class Family:
PSPL – base class for all Data classes:
PSPL_Phot
PSPL_PhotAstrom
PSPL_GP_Phot
PSPL_GP_PhotAstrom
A class from the Parallax Class Family:
ParallaxClassABC – base class for all Parallax classes:
PSPL_noParallax
PSPL_Parallax
A class from the GP Class Family: (optional)
PSPL_GP – base class for all GP classes.
A class from the Parametrization Class Family:
PSPL_Param – base class for all Param classes
PSPL_PhotParam1
PSPL_PhotParam2
PSPL_PhotAstromParam1
PSPL_PhotAstromParam2
PSPL_PhotAstromParam3
PSPL_PhotAstromParam4
PSPL_PhotAstromParam5
PSPL_GP_PhotParam1
PSPL_GP_PhotParam2
PSPL_GP_PhotAstromParam1
PSPL_GP_PhotAstromParam2
PSPL_GP_PhotAstromParam3
PSPL_GP_PhotAstromParam4
There is a similar hierarchy for PSBL, etc.
For example, the PSPL_PhotAstrom_noPar_Param1 model is declared as:
class PSPL_PhotAstrom_noPar_Param1(ModelClassABC,
PSPL_PhotAstrom,
PSPL_noParallax,
PSPL_PhotAstromParam1)
Class Families
Model Class Family
These are the classes that can be instantiated by the user. The base class is ModelClassABC.
Data Class Family
These classes inform the model of what type of data will be used by the model. If the model will be for photometry only, then a model with the PSPL_Phot class must be selected. These models have the words Phot in their names. If the model will be using photometry and astrometry data, then a model with the PSPL_PhotAstrom must be selected. These models have the words PhotAstrom in their names.
Data containing astrometry will generate a warning that astrometry data will not be used in the model when run through a model using PSPL_Phot. Data that does not contain astrometry run through a model using PSPL_PhotAstrom will generate a RuntimeError.
The base class is PSPL.
Parallax Class Family
These classes set whether the model uses parallax when calculating photometry, calculating astrometry, and fitting data. There are only two options for this class family, PSPL_noParallax and PSPL_Parallax. Models that do not have parallax have the words noPar in their names, while models that do contain parallax have the words Par in their names.
The base class is ParallaxClassABC.
Parameterization Class Family
These classes determine which physical parameters define the model. Currently this file supports one parameterization when using only photometry (Phot) and three parametrizations when using photometry and astrometery (PhotAstrom).
The base class is PSPL_Param.
The parameters for each parameterization are:
- PhotParam1 :
Point source point lens model for microlensing photometry only. This model includes the relative proper motion between the lens and the source. Parameters are reduced with the use of piRel
- Parameters:
t0, u0_amp, tE,piE_E, piE_N,b_sff, mag_src,(ra, dec)- PhotAstromParam1 :
Point Source Point Lens model for microlensing. This model includes proper motions of both the lens and source.
- Parameters:
mL, t0, beta,dL, dL_dS,xS0_E, xS0_N,muL_E, muL_N,muS_E, muS_N,b_sff, mag_src,(ra, dec)- PhotAstromParam2 :
Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky.
- Parameters:
t0, u0_amp, tE, thetaE, piS,piE_E, piE_N,xS0_E, xS0_N,muS_E, muS_N,b_sff, mag_src,(ra, dec)- PhotAstromParam3 :
Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky. Note it fits the baseline magnitude rather than the unmagnified source brightness.
- Parameters:
t0, u0_amp, tE, log10_thetaE, piS,piE_E, piE_N,xS0_E, xS0_N,muS_E, muS_N,b_sff, mag_base,(ra, dec)
(ra, dec) are only required if the model is created with a parallax class. More details about each parameterization can be found in the Parameterization Class docstring.
Making a New Model
Each model is, as described above, constructed by combining inheriting from different parent classes that contain the desired features for the model. Each model must have one class from each class family. In addition to this, there are several rules that must be followed when creating a new class.
The data class must match the parameterization class. For example, if the chosen data class is PSPL_Phot, then the parameter class must be PSPL_PhotParam1 (or a different PhotParam in a future version). If the data class is PSPL_PhotAstrom, then the parameter class must be one of the classes with a PhotAstromParam.
Models are built using python’s multiple inheritance feature. Therefore the order in which the parent classes are listed in the model class’ definition matters. Parent classes to models should always be listed in the order:
ModelClassABC
Data Class
Parallax Class
Parameterization Class
If using the optional GP class, then the order is
ModelClassABC
GP Class
Data Class
Parallax Class
Parameterization Class
Each class must be given the @inheritdocstring decorator, and include the following commands in the model’s
__init__
:
a.super().__init__(*args, **kwargs)
startbases(self)
checkconflicts(self)
Each of these performs the following function:
super().__init__(*args, **kwargs)
: Inherits the__init__
from the Parameterization Class.
startbases(self)
: Runs a start command on each parent class, giving each parent class a chance to run a set of functions upon instantiation.
checkconflicts(self)
: Checks to confirm that the combination of parent classes in the model are valid.Models should be named to reflect the parents classes used to construct it, as outlined in the above sections.
Instantiable Model Classes
PSPL Model Classes
PSPL
- class model.PSPL_PhotAstrom_noPar_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_noParallax
,PSPL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
PSPL Parallax
- class model.PSPL_PhotAstrom_Par_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_PhotAstrom_LumLens_Par_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_Parallax_LumLens
,PSPL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_PhotAstrom_LumLens_Par_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_Parallax_LumLens
,PSPL_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_PhotAstrom_LumLens_Par_Param4(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_Parallax_LumLens
,PSPL_PhotAstromParam4
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
PSPL_parallax2 / PSPL_multiphot_parallax
- class model.PSPL_PhotAstrom_Par_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_PhotAstrom_noPar_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_noParallax
,PSPL_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.PSPL_PhotAstrom_Par_Param3(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_PhotAstromParam3
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_PhotAstrom_Par_Param4(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_PhotAstromParam4
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_PhotAstrom_noPar_Param4(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_PhotAstrom
,PSPL_noParallax
,PSPL_PhotAstromParam4
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.PSPL_Astrom_Par_Param4(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_Astrom
,PSPL_Parallax
,PSPL_AstromParam4
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_Astrom_Par_Param3(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_Astrom
,PSPL_Parallax
,PSPL_AstromParam3
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
PSPL_phot
- class model.PSPL_Phot_noPar_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_Phot
,PSPL_noParallax
,PSPL_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
calc_piE_ecliptic
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.PSPL_Phot_noPar_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_Phot
,PSPL_noParallax
,PSPL_PhotParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
calc_piE_ecliptic
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
PSPL_phot_parallax / PSPL_phot_multiphot_parallax
- class model.PSPL_Phot_Par_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_Phot
,PSPL_Parallax
,PSPL_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_Phot_Par_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_Phot
,PSPL_Parallax
,PSPL_PhotParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
PSPL Phot parallax with GP
- class model.PSPL_Phot_Par_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_Phot
,PSPL_Parallax
,PSPL_GP_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_Phot_Par_GP_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_Phot
,PSPL_Parallax
,PSPL_GP_PhotParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_Phot_Par_GP_Param1_2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_Phot
,PSPL_Parallax
,PSPL_GP_PhotParam1_2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_Phot_Par_GP_Param2_2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_Phot
,PSPL_Parallax
,PSPL_GP_PhotParam2_2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
PSPL Phot, no parallax with GP
- class model.PSPL_Phot_noPar_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_Phot
,PSPL_noParallax
,PSPL_GP_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
calc_piE_ecliptic
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_Phot_noPar_GP_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_Phot
,PSPL_noParallax
,PSPL_GP_PhotParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
calc_piE_ecliptic
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
PSPL PhotAstrom, parallax with GP
- class model.PSPL_PhotAstrom_Par_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_GP_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_Par_GP_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_GP_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_Par_GP_Param3(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_GP_PhotAstromParam3
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_Par_GP_Param4(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax
,PSPL_GP_PhotAstromParam4
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_Par_LumLens_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax_LumLens
,PSPL_GP_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_Par_LumLens_GP_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax_LumLens
,PSPL_GP_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_Par_LumLens_GP_Param3(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax_LumLens
,PSPL_GP_PhotAstromParam3
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_Par_LumLens_GP_Param4(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_Parallax_LumLens
,PSPL_GP_PhotAstromParam4
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
PSPL PhotAstrom, no parallax with GP
- class model.PSPL_PhotAstrom_noPar_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_noParallax
,PSPL_GP_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_PhotAstrom_noPar_GP_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSPL_PhotAstrom
,PSPL_noParallax
,PSPL_GP_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
PSBL User Classes
PSBL
- class model.PSBL_PhotAstrom_noPar_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_PhotAstrom
,PSBL_noParallax
,PSBL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- class model.PSBL_PhotAstrom_noPar_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_PhotAstrom
,PSBL_noParallax
,PSBL_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
PSBL Parallax
- class model.PSBL_PhotAstrom_Par_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_PhotAstrom
,PSBL_Parallax
,PSBL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- class model.PSBL_PhotAstrom_Par_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_PhotAstrom
,PSBL_Parallax
,PSBL_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- class model.PSBL_PhotAstrom_Par_Param3(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_PhotAstrom
,PSBL_Parallax
,PSBL_PhotAstromParam3
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- class model.PSBL_PhotAstrom_Par_Param4(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_PhotAstrom
,PSBL_Parallax
,PSBL_PhotAstromParam4
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
PSBL_Phot
- class model.PSBL_Phot_noPar_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_Phot
,PSBL_noParallax
,PSBL_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in Einstein radii.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in Einstein radii.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
calc_piE_ecliptic
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_resolved_amplification
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in Einstein radii.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist. Note, this is a photometry only model, so units are in Einstein radii.
- Returns
- xS_unlensednumpy array, dtype=float,
shape = len(t_obs) x 2
The unlensed positions of the source in Einstein radii.
- xS_unlensednumpy array, dtype=float,
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_centroid_shift(t, ast_filt_idx=0)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers.
This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in Einstein radii.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
PSBL_phot_parallax
- class model.PSBL_Phot_Par_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSBL_Phot
,PSBL_Parallax
,PSBL_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in Einstein radii.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in Einstein radii.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_resolved_amplification
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in Einstein radii.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist. Note, this is a photometry only model, so units are in Einstein radii.
- Returns
- xS_unlensednumpy array, dtype=float,
shape = len(t_obs) x 2
The unlensed positions of the source in Einstein radii.
- xS_unlensednumpy array, dtype=float,
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers.
This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in Einstein radii.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
PSBL PhotAstrom, no parallax with GP
- class model.PSBL_PhotAstrom_noPar_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSBL_PhotAstrom
,PSBL_noParallax
,PSBL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- class model.PSBL_PhotAstrom_noPar_GP_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSBL_PhotAstrom
,PSBL_noParallax
,PSBL_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
calc_piE_ecliptic
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
PSBL PhotAstrom, parallax with GP
- class model.PSBL_PhotAstrom_Par_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSBL_PhotAstrom
,PSBL_Parallax
,PSBL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- class model.PSBL_PhotAstrom_Par_GP_Param2(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSBL_PhotAstrom
,PSBL_Parallax
,PSBL_PhotAstromParam2
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
PSBL Phot, no parallax with GP
- class model.PSBL_Phot_noPar_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSBL_Phot
,PSBL_noParallax
,PSBL_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in Einstein radii.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in Einstein radii.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
calc_piE_ecliptic
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_resolved_amplification
log_likely_astrometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in Einstein radii.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist. Note, this is a photometry only model, so units are in Einstein radii.
- Returns
- xS_unlensednumpy array, dtype=float,
shape = len(t_obs) x 2
The unlensed positions of the source in Einstein radii.
- xS_unlensednumpy array, dtype=float,
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_centroid_shift(t, ast_filt_idx=0)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers.
This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in Einstein radii.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
PSBL Phot, parallax with GP
- class model.PSBL_Phot_Par_GP_Param1(*args, **kwargs)
Bases:
ModelClassABC
,PSPL_GP
,PSBL_Phot
,PSBL_Parallax
,PSBL_PhotParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_amplification
(t_obs[, amp_arr])noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in Einstein radii.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in Einstein radii.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_resolved_amplification
log_likely_astrometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_amplification(t_obs, amp_arr=None)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in Einstein radii.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist. Note, this is a photometry only model, so units are in Einstein radii.
- Returns
- xS_unlensednumpy array, dtype=float,
shape = len(t_obs) x 2
The unlensed positions of the source in Einstein radii.
- xS_unlensednumpy array, dtype=float,
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers.
This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_lens_astrometry(t)
Parallax: Get lens astrometry
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in Einstein radii.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
FSPL User Class
FSPL_parallax
- class model.FSPL_PhotAstrom_Par_Param1(*args, **kwargs)
Bases:
ModelClassABC
,FSPL_PhotAstrom
,FSPL_Parallax
,FSPL_PhotAstromParam1
Helper class that provides a standard way to create an ABC using inheritance.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
Outputs position of source unlensed.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_source_outline_astrometry
(r, n, center)Return astrometric points that outline the outer circumference of the source star.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_resolved_astrometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
start
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t)
Outputs position of source unlensed.
Input a list of times and it will output the position of the source had it not been lensed at each of the times in the list
e.g ifn = 4
, and sayv = [1,0]
& the times are[0,1,2]
in years.This will return((( (1,0),(0,1),(-1,0),(0,-1) ), ( (2,0),(1,1),(0,0),(1,-1) ), ( (3,0),(2,1),(1,0),(2,-1) ))...
= (positions at t=0), (positions at t=1), (positions at t=2)so
np.array(positions)
is an array which contains an array for each time step with the positions of all the points on the boundary of the source.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Other Parameters
- ———-
- amp_arrarray_like
Amplifications of each individual image at each time, i.e. amp_arr.shape = (len(t_obs), number of images at each t_obs).
This will over-ride t_obs; but is more efficient when calculating both photometry and astrometry. If None, then just use t_obs.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- get_source_outline_astrometry(r, n, center)
Return astrometric points that outline the outer circumference of the source star.
The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positionse.g:( ((1,0), (0,1), (-1,0), (0,-1)) )
if n = 4 and radius = 1- Returns
- source_pointsnumpy array
Returns an array of
shape = [2, self.n_outline, len(time)]
POINT SOURCE POINT LENS (PSPL) CLASSES
Parameterization Class Family
Here is a subsection of the inheritance diagram for the PSPL Parametrization classes showing the AstromParam, PhotParam, and PhotAstromParam structures.

PSPL Models
- class model.PSPL_Param(*args, **kwargs)
Bases:
ABC
An abstract class that all Param classes should sub-class. This serves as a reminder for the class variables that MUST be set.
- class model.PSPL_AstromParam4(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, raL=None, decL=None)
Bases:
PSPL_Param
Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky. It is the same as PSPL_PhotAstromParam2 except it fits for baseline instead of source magnitude.
Notes
Note
Required parameters if calculating with parallax
raL: Right ascension of the lens in decimal degrees.
decL: Declination of the lens in decimal degrees.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time (days).
- thetaE: float
The size of the Einstein radius in (mas).
- piS: float
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Dec Source proper motion (mas/yr)
- class model.PSPL_AstromParam3(t0, u0_amp, tE, log10_thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, raL=None, decL=None)
Bases:
PSPL_Param
DESCRIPTION: Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky. It is the same as PSPL_PhotAstromParam3 except it fits only astrometry, no photometry.
Notes
Note
Required parameters if calculating with parallax
raL: Right ascension of the lens in decimal degrees.
decL: Declination of the lens in decimal degrees.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time (days).
- log10_thetaE: float
The log of the Einstein radius log10(thetaE/mas).
- piS: float
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Dec Source proper motion (mas/yr)
- class model.PSPL_PhotParam1(t0, u0_amp, tE, piE_E, piE_N, b_sff, mag_src, raL=None, decL=None)
Bases:
PSPL_Param
PSPL model for photometry only.
Point source point lens model for microlensing photometry only. This model includes the relative proper motion between the lens and the source. Parameters are reduced with the use of piRel (rather than dL and dS) and muRel (rather than muL and muS).
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. It can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time in days.
- piE_E: float
The microlensing parallax in the East direction in units of thetaE.
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- b_sff: numpy array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src: numpy array or list
Photometric magnitude of the source. This must be passed in as a list or array, with one entry for each photometric filter.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.PSPL_PhotParam2(t0, u0_amp, tE, piE_E, piE_N, b_sff, mag_base, raL=None, decL=None)
Bases:
PSPL_Param
DESCRIPTION: Point source point lens model for microlensing photometry only. This model includes the relative proper motion between the lens and the source. Parameters are reduced with the use of piRel (rather than dL and dS) and muRel (rather than muL and muS). Same as PSPL_PhotParam1, except fits for mag_base instead of mag_src.
Notes
Note
Required parameters if calculating with parallax
raL: Right ascension of the lens in decimal degrees.
decL: Declination of the lens in decimal degrees.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. It can be positive (u0_amp > 0 when u0_hat[0] > 0) or negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time in days.
- piE_E: float
The microlensing parallax in the East direction in units of thetaE.
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- b_sff: numpy array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_base: numpy array or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter.
- class model.PSPL_PhotAstromParam1(mL, t0, beta, dL, dL_dS, xS0_E, xS0_N, muL_E, muL_N, muS_E, muS_N, b_sff, mag_src, raL=None, decL=None)
Bases:
PSPL_Param
PSPL model for astrometry and photometry - physical parameterization.
A Point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- mL: float
Mass of the lens (Msun)
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- beta: float
Angular distance between the lens and source on the plane of the sky (mas). Can be
positive (u0_amp > 0 when u0_hat[0] < 0) or
negative (u0_amp < 0 when u0_hat[0] > 0).
- dL: float
Distance from the observer to the lens (pc)
- dL_dS: float
Ratio of Distance from the obersver to the lens to Distance from the observer to the source
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muL_E: float
RA Lens proper motion (mas/yr)
- muL_N: float
Dec Lens proper motion (mas/yr)
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Dec Source proper motion (mas/yr)
- b_sff: numpy array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src: numpy array or list
Photometric magnitude of the source. This must be passed in as a list or array, with one entry for each photometric filter.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.PSPL_PhotAstromParam2(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_src, raL=None, decL=None)
Bases:
PSPL_Param
PSPL model for photometry and astrometry – photom-like parameterization
Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time (days).
- thetaE: float
The size of the Einstein radius in (mas).
- piS: float
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Source proper motion (mas/yr)
- b_sff: numpy array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src: numpy array or list
Photometric magnitude of the source. This must be passed in as a list or array, with one entry for each photometric filter.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.PSPL_PhotAstromParam3(t0, u0_amp, tE, log10_thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_base, raL=None, decL=None)
Bases:
PSPL_Param
Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky. It is the same as PSPL_PhotAstromParam4 except it fits for log10(thetaE) instead of thetaE.
Notes
Note
Required parameters if calculating with parallax
raL: Right ascension of the lens in decimal degrees.
decL: Declination of the lens in decimal degrees.
- Attributes
- t0float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_ampfloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- log10_thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
\(b_sff = f_S / (f_S + f_L + f_N)\).
This must be passed in as a list or array, with one entry for each photometric filter.
- mag_basenumpy array or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter.
- class model.PSPL_PhotAstromParam4(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_base, raL=None, decL=None)
Bases:
PSPL_Param
DESCRIPTION: Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky. It is the same as PSPL_PhotAstromParam2 except it fits for baseline instead of source magnitude.
- Parameters
- t0float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_ampfloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- thetaE:
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
\(b_sff = f_S / (f_S + f_L + f_N)\).
This must be passed in as a list or array, with one entry for each photometric filter.
- mag_basenumpy array or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter.
Notes
Note
Required parameters if calculating with parallax
raL: Right ascension of the lens in decimal degrees.
decL: Declination of the lens in decimal degrees.
- class model.PSPL_PhotAstromParam5(t0, u0_amp, tE, log10_thetaE, piS, piE_E, piEN_piEE, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_base, raL=None, decL=None)
Bases:
PSPL_Param
DESCRIPTION: Point Source Point Lens model for microlensing. This model includes proper motions of the source and the source position on the sky. It fits for piEN/piEE and piEE, instead of piEE and piEN.
Notes
Note
Required parameters if calculating with parallax
raL: Right ascension of the lens in decimal degrees.
decL: Declination of the lens in decimal degrees.
- Attributes
- t0float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_ampfloat
Angular distance between the source and the lens on the plane of the sky at closest approach in units of thetaE. Can
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- log10_thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piEN_piEEfloat
Ratio of piE_N to piE_E.
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
\(b_sff = f_S / (f_S + f_L + f_N)\).
This must be passed in as a list or array, with one entry for each photometric filter.
- mag_basenumpy array or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter.
GP Models
- class model.PSPL_GP_PhotParam1(t0, u0_amp, tE, piE_E, piE_N, b_sff, mag_src, gp_log_sigma, gp_log_rho, gp_log_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotParam1
- class model.PSPL_GP_PhotParam1_2(t0, u0_amp, tE, piE_E, piE_N, b_sff, mag_src, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotParam1
Figuring out the new prior parametrization.
- class model.PSPL_GP_PhotParam2(t0, u0_amp, tE, piE_E, piE_N, b_sff, mag_base, gp_log_sigma, gp_log_rho, gp_log_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotParam2
- class model.PSPL_GP_PhotParam2_2(t0, u0_amp, tE, piE_E, piE_N, b_sff, mag_base, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotParam2
- class model.PSPL_GP_PhotAstromParam1(mL, t0, beta, dL, dL_dS, xS0_E, xS0_N, muL_E, muL_N, muS_E, muS_N, b_sff, mag_src, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotAstromParam1
- class model.PSPL_GP_PhotAstromParam2(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_src, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotAstromParam2
- class model.PSPL_GP_PhotAstromParam2(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_src, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotAstromParam2
- class model.PSPL_GP_PhotAstromParam3(t0, u0_amp, tE, log10_thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_base, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotAstromParam3
Point Source Point Lens with GP model for microlensing. This model includes proper motions of the source and the source position on the sky. It is the same as PSPL_PhotAstromParam4 except it fits for log10(thetaE) instead of thetaE.
Notes
Note
raL and decL are required parameters if calculating with parallax
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time (days).
- log10_thetaE: float
log10 of the size of the Einstein radius in (mas).
- piS: float
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Dec Source proper motion (mas/yr)
- b_sff: numpy array or list of floats
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_base: numpy array or list of floats
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter.
- gp_log_sigma: float
Guassian process \(log(\sigma)\) for the Matern 3/2 kernel.
- gp_rho: float
Guassian process \({\rho}\) for the Matern 3/2 kernel.
- gp_log_omega04_S0: float
Guassian process \(log(\omega_0^4 * S_0)\) from the SHO kernel.
- gp_log_omega0: float
Guassian process \(log(\omega_0)\) from the SHO kernel.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.PSPL_GP_PhotAstromParam4(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, b_sff, mag_base, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
PSPL_PhotAstromParam4
Point Source Point Lens with GP model for microlensing. This model includes proper motions of the source and the source position on the sky. It is the same as PSPL_PhotAstromParam2 except it fits for baseline instead of source magnitude.
Notes
Note
raL and decL are required parameters if calculating with parallaxFor an explanation of the Guassian process parameters, see Golovich et al. 2019()- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time (days).
- thetaE: float
The size of the Einstein radius in (mas).
- piS: float
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Dec Source proper motion (mas/yr)
- b_sff: float
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_base: float
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter.
- gp_log_sigma: float
Guassian process \(log(\sigma)\) for the Matern 3/2 kernel.
- gp_rho: float
Guassian process \({\rho}\) for the Matern 3/2 kernel.
- gp_log_omega04_S0: float
Guassian process \(log(\omega_0^4 * S_0)\) from the SHO kernel.
- gp_log_omega0: float
Guassian process \(log(\omega_0)\) from the SHO kernel.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
Data Class Family
- class model.PSPL
Bases:
ABC
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- class model.PSPL_Phot
Bases:
PSPL
Contains methods for model a PSPL photometry only. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_astrometry
get_astrometry_unlensed
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
get_resolved_amplification
get_resolved_astrometry
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- class model.PSPL_PhotAstrom
Bases:
PSPL
Contains methods for model a PSPL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- class model.PSPL_Astrom
Bases:
PSPL
Contains methods for model a PSPL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
GP Class Family
- class model.Celerite_GP_Model(pspl_model, filter_index)
Bases:
Model
This is nedeed for the GP. Just a wrapper over our model so it is a celerite model.
- Attributes
full_size
The total number of parameters (including frozen parameters)
parameter_vector
An array of all parameters (including frozen parameters)
vector_size
The number of active (or unfrozen) parameters
Methods
compute_gradient
(*args, **kwargs)Compute the "gradient" of the model for the current parameters
Freeze all parameters of the model
freeze_parameter
(name)Freeze a parameter by name
get_parameter
(name)Get a parameter value by name
get_parameter_bounds
([include_frozen])Get a list of the parameter bounds
get_parameter_dict
([include_frozen])Get an ordered dictionary of the parameters
get_parameter_names
([include_frozen])Get a list of the parameter names
get_parameter_vector
([include_frozen])Get an array of the parameter values in the correct order
get_value
(t_obs)Compute the "value" of the model for the current parameters
Compute the log prior probability of the current parameters
set_parameter
(name, value)Set a parameter value by name
set_parameter_vector
(vector[, include_frozen])Set the parameter values to the given vector
Thaw all parameters of the model
thaw_parameter
(name)Thaw a parameter by name
get_gradient
- get_value(t_obs)
Compute the “value” of the model for the current parameters
This method should be overloaded by subclasses to implement the actual functionality of the model.
- compute_gradient(*args, **kwargs)
Compute the “gradient” of the model for the current parameters
This method should be overloaded by subclasses to implement the actual functionality of the model. The output of this function should be an array where the first dimension is
full_size
.
- freeze_all_parameters()
Freeze all parameters of the model
- freeze_parameter(name)
Freeze a parameter by name
- Args:
name: The name of the parameter
- property full_size
The total number of parameters (including frozen parameters)
- get_parameter(name)
Get a parameter value by name
- Args:
name: The name of the parameter
- get_parameter_bounds(include_frozen=False)
Get a list of the parameter bounds
- Args:
- include_frozen (Optional[bool]): Should the frozen parameters be
included in the returned value? (default:
False
)
- get_parameter_dict(include_frozen=False)
Get an ordered dictionary of the parameters
- Args:
- include_frozen (Optional[bool]): Should the frozen parameters be
included in the returned value? (default:
False
)
- get_parameter_names(include_frozen=False)
Get a list of the parameter names
- Args:
- include_frozen (Optional[bool]): Should the frozen parameters be
included in the returned value? (default:
False
)
- get_parameter_vector(include_frozen=False)
Get an array of the parameter values in the correct order
- Args:
- include_frozen (Optional[bool]): Should the frozen parameters be
included in the returned value? (default:
False
)
- log_prior()
Compute the log prior probability of the current parameters
- property parameter_vector
An array of all parameters (including frozen parameters)
- set_parameter(name, value)
Set a parameter value by name
- Args:
name: The name of the parameter value (float): The new value for the parameter
- set_parameter_vector(vector, include_frozen=False)
Set the parameter values to the given vector
- Args:
- vector (array[vector_size] or array[full_size]): The target
parameter vector. This must be in the same order as
parameter_names
and it should only include frozen parameters ifinclude_frozen
isTrue
.- include_frozen (Optional[bool]): Should the frozen parameters be
included in the returned value? (default:
False
)
- thaw_all_parameters()
Thaw all parameters of the model
- thaw_parameter(name)
Thaw a parameter by name
- Args:
name: The name of the parameter
- property vector_size
The number of active (or unfrozen) parameters
- class model.PSPL_GP
Bases:
ABC
PSPL object that has optional support for gaussian process on each photometric filter.
Methods
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
- class model.PSPL_GP
Bases:
ABC
PSPL object that has optional support for gaussian process on each photometric filter.
Methods
get_log_det_covariance
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
get_photometry_with_gp
(t_obs, mag_obs, ...)Returns photometry with GP noise added in.
log_likely_photometry
(t_obs, mag_obs, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
- get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)
Returns photometry with GP noise added in.
Note
This will throw an error if this is a filter with use_gp_phot[filt_index] = False.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.
Parallax Class Family
- class model.PSPL_noParallax
Bases:
ParallaxClassABC
Methods
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.PSPL_Parallax
Bases:
ParallaxClassABC
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- class model.PSPL_Parallax
Bases:
ParallaxClassABC
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- class model.PSPL_noParallax_LumLens
Bases:
PSPL_noParallax
Methods
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
- get_centroid_shift(t, ast_filt_idx=0)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.PSPL_Parallax_LumLens
Bases:
PSPL_Parallax
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.PSPL_Parallax
Bases:
ParallaxClassABC
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
POINT SOURCE BINARY LENS (PSBL) CLASSES
Data Class Family
- class model.PSBL
Bases:
PSPL
Contains methods for model a PSBL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_photometry
get_lnL_constant
log_likely_photometry
log_likely_photometry_each
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- class model.PSBL_Phot
-
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in Einstein radii.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in Einstein radii.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_resolved_amplification
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers.
This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist. Note, this is a photometry only model, so units are in Einstein radii.
- Returns
- xS_unlensednumpy array, dtype=float,
shape = len(t_obs) x 2
The unlensed positions of the source in Einstein radii.
- xS_unlensednumpy array, dtype=float,
Notes
Note
Note, this is a photometry only model, so units are in Einstein radii.
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in Einstein radii.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in Einstein radii.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
- class model.PSBL_PhotAstrom
Bases:
PSBL
,PSPL_PhotAstrom
Contains methods for model a PSPL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_all_arrays
(t_obs[, check_sols, rescale])Obtain the image and amplitude arrays for each t_obs.
get_amp_arr
(z_arr, z1, z2)Calculations amplification array
get_astrometry
(t_obs[, image_arr, amp_arr, ...])Position of the observed (unresolved) source position in arcsec.
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid
(t_obs[, ast_filt_idx, ...])PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_complex_pos
(t_obs)Get the positions of the lenses and source as complex numbers.
get_image_pos_arr
(w, z1, z2, m1, m2[, ...])Gets image positions.
get_image_pos_arr_old
(w, z1, z2[, check_sols])Gets image positions.
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens system.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_resolved_astrometry
(t_obs[, image_arr, ...])Position of the observed source position in arcsec.
get_resolved_lens_astrometry
(t_obs)Equation of motion for just the foreground lenses, individually.
get_resolved_photometry
(t_obs[, filt_idx, ...])Get the photometry for each of the lensed source images.
rescale_complex_pos
(w, z1, z2)Make sure everything is roughly centered on the origin in a 1 x 1 box.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- get_complex_pos(t_obs)
Get the positions of the lenses and source as complex numbers. This is needed for further calculations. Note that all units are still the same as before, this is just rewriting vectors \(z = (x,y)\) as \(z = x + iy\).
- Returns
- wcomplex array
Source position as an array of complex numbers with real = east component, imaginary = north component
- z1complex array
Lens primary component position as an array of complex numbers with real = east component, imaginary = north component
- z2complex array
Lens secondary component position as an array of complex numbers with real = east component, imaginary = north component
- get_resolved_astrometry(t_obs, image_arr=None, amp_arr=None)
Position of the observed source position in arcsec.
- Parameters
- t_obsarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_astrometry(t_obs, image_arr=None, amp_arr=None, ast_filt_idx=0)
Position of the observed (unresolved) source position in arcsec.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens system.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_lens_astrometry(t_obs)
Equation of motion for just the foreground lenses, individually.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_centroid(t_obs, ast_filt_idx=0, image_arr=None, amp_arr=None)
PSPL: Get the centroid shift (in mas) for a list of observation times (in MJD).
- Parameters
- t_obsarray or float
- Returns
- Centroid offset on the plane of the sky in milli-arcseoncds.
- Other Parameters
- ast_filt_idxint
Index into the photometry parameter lists for the photometry that corresponds to this astrometry data set.
- image_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- amp_arrlist
List returned from PSPL get_all_arrays() used to improve efficiency.
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_all_arrays(t_obs, check_sols=True, rescale=True)
Obtain the image and amplitude arrays for each t_obs.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- imagesarray_like
Array/tuple of complex positions of each images at each t_obs.
- amp_arrarray_like
Array/tuple of amplification of each images at each t_obs.
- get_amp_arr(z_arr, z1, z2)
Calculations amplification array
Calculates the amplification A from the Jacobian J, \(A = 1/|J|\)
- Parameters
- z_arrarray_like
- Complex position of images.
Shape = [N_times, N_solutions, 1]
– note this could be jagged. - z1array_like
Complex position(s) of lens 1 (primary).
Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary).
Shape = [N_times, 1]
- Returns
- amp_arrarray_like
BLEH
- get_image_pos_arr(w, z1, z2, m1, m2, check_sols=True)
Gets image positions.
Solve the fifth-order polynomial and get the image positions.See PSBL writeup for full equations.All angular distances are in arcsec.- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_image_pos_arr_old(w, z1, z2, check_sols=True)
Gets image positions. | Solve the fifth-order polynomial and get the image positions. | See PSBL writeup for full equations. | All angular distances are in arcsec.
- Parameters
- warray_like
Complex position(s) of the source. Shape = [N_times, 1]
- z1array_like
Complex position(s) of lens 1 (primary). Shape = [N_times, 1]
- z2array_like
Complex position(s) of lens 2 (secondary). Shape = [N_times, 1]
- check_solsbool, optional
If True, calculated roots are checked against the lens equation, and output will only contain those within self.root_tol. If False, all calculated roots are returned.
- Returns
- z_arrarray_like
Position of the lensed source images. Rank-1 array of polynomial roots, possibly complex. If check_sols = True, only roots solving the lens equation are returned.
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- get_resolved_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images. Implement with no blending (since we don’t support different blendings for the different images).
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of each lensed image centroid at t_obs. Shape = [5, len(t_obs)]
- rescale_complex_pos(w, z1, z2)
Make sure everything is roughly centered on the origin in a 1 x 1 box.
Parallax Class Family - PSBL
- class model.PSPL_Parallax
Bases:
ParallaxClassABC
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- class model.PSPL_noParallax
Bases:
ParallaxClassABC
Methods
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
Parameterization Class Family - PSBL
PSBL Models
- class model.PSBL_PhotAstromParam1(mLp, mLs, t0, xS0_E, xS0_N, beta, muL_E, muL_N, muS_E, muS_N, dL, dS, sep, alpha, b_sff, mag_src, raL=None, decL=None, root_tol=1e-08)
Bases:
PSPL_Param
Point source binary lens. It has 3 more parameters than PSPL (additional mass term, separation, and angle of approach). Note that this is a STATIC binary lens, i.e. there is no orbital motion.
- Attributes
- mLp, mLsfloat
Masses of the lenses (Msun)
- t0float
Time of photometric peak, as seen from Earth (MJD.DDD)
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- betafloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky (mas). Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- muL_Efloat
Lens system proper motion in the RA direction (mas/yr)
- muL_Nfloat
Lens system proper motion in the Dec. direction (mas/yr)
- muS_Efloat
Source proper motion in the RA direction (mas/yr)
- muS_Nfloat
Source proper motion in the Dec. direction (mas/yr)
- dLfloat
Distance from the observer to the lens system (pc)
- dSfloat
Distance from the observer to the source (pc)
- sepfloat
Angular separation of the two lenses (mas)
- alphafloat
Angle made between the binary axis and North; measured in degrees East of North.
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
- mag_srcnumpy array or list
Source magnitude, unlensed. One in each filter.
- root_tolfloat
Tolerance in comparing the polynomial roots to the physical solutions. Default = 1e-8
- class model.PSBL_PhotAstromParam2(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, q, sep, alpha, b_sff, mag_src, raL=None, decL=None, root_tol=1e-08)
Bases:
PSPL_Param
Point source binary lens. It has 3 more parameters than PSPL (additional mass term, separation, and angle of approach). Note that this is a STATIC binary lens, i.e. there is no orbital motion.
- Attributes
- t0float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_ampfloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- qfloat
Mass ratio (M2 / M1)
- sepfloat
Angular separation of the two lenses (mas)
- alphafloat
Angle made between the binary axis and North; measured in degrees East of North.
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
- mag_srcnumpy array or list
Source magnitude, unlensed. One in each filter.
- root_tolfloat
Tolerance in comparing the polynomial roots to the physical solutions. Default = 1e-8
- class model.PSBL_PhotAstromParam3(t0, u0_amp, tE, log10_thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, q, sep, alpha, b_sff, mag_base, raL=None, decL=None, root_tol=1e-08)
Bases:
PSPL_Param
Point source binary lens. It has 3 more parameters than PSPL (additional mass term, separation, and angle of approach). Note that this is a STATIC binary lens, i.e. there is no orbital motion.
- Attributes
- t0float
Time of photometric peak, as seen from Earth (MJD.DDD) FIXME: THIS IS NOT RIGHT
- u0_ampfloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky at closest approach in units of thetaE. Can
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- log10_thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- qfloat
Mass ratio (M2 / M1)
- sepfloat
Angular separation of the two lenses (mas)
- alphafloat
Angle made between the binary axis and North; measured in degrees East of North.
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
\(b_sff = f_S / (f_S + f_L + f_N)\).
This must be passed in as a list or array, with one entry for each photometric filter.
- mag_basenumpy array or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter.
- root_tolfloat
Tolerance in comparing the polynomial roots to the physical solutions. Default = 1e-8
- class model.PSBL_PhotAstromParam4(t0_com, u0_amp_com, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, q, sep, alpha, b_sff, mag_src, raL=None, decL=None, root_tol=1e-08)
Bases:
PSPL_Param
Point source binary lens. It has 3 more parameters than PSPL (additional mass term, separation, and angle of approach). Note that this is a STATIC binary lens, i.e. there is no orbital motion.
- Attributes
- t0_comfloat
Time of photometric peak, as seen from Earth (MJD.DDD) FIXME: THIS IS NOT RIGHT
- u0_amp_comfloat
Angular distance between the source and the binary lens COM on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- betafloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky (mas).
- qfloat
Mass ratio (M2 / M1)
- sepfloat
Angular separation of the two lenses (mas)
- alphafloat
Angle made between the binary axis and North; measured in degrees East of North.
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
- mag_srcnumpy array or list
Source magnitude, unlensed. One in each filter.
- root_tolfloat
Tolerance in comparing the polynomial roots to the physical solutions. Default = 1e-8
- class model.PSBL_PhotAstromParam5(t0_prim, u0_amp_prim, tE, thetaE, piS, piE_E, piEN_piEE, xS0_E, xS0_N, muS_E, muS_N, q, sep, alpha, b_sff, mag_base, raL=None, decL=None, root_tol=1e-08)
Bases:
PSPL_Param
Point source binary lens. It has 3 more parameters than PSPL (additional mass term, separation, and angle of approach). Note that this is a STATIC binary lens, i.e. there is no orbital motion.
- Attributes
- t0_primfloat
Time of photometric peak, as seen from Earth (MJD.DDD) FIXME: THIS IS NOT RIGHT
- u0_amp_primfloat
Angular distance between the source and the PRIMARY lens on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- betafloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky (mas).
- qfloat
Mass ratio (M2 / M1)
- sepfloat
Angular separation of the two lenses (mas)
- alphafloat
Angle made between the binary axis and North; measured in degrees East of North.
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
- mag_srcnumpy array or list
Source magnitude, unlensed. One in each filter.
- root_tolfloat
Tolerance in comparing the polynomial roots to the physical solutions. Default = 1e-8
- class model.PSBL_PhotAstromParam6(t0_prim, u0_amp_prim, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, q, sep, alpha, b_sff, mag_src, raL=None, decL=None, root_tol=1e-08)
Bases:
PSPL_Param
Point source binary lens. It has 3 more parameters than PSPL (additional mass term, separation, and angle of approach). Note that this is a STATIC binary lens, i.e. there is no orbital motion.
- Attributes
- t0_primfloat
Time of photometric peak, as seen from Earth (MJD.DDD) FIXME: THIS IS NOT RIGHT
- u0_amp_primfloat
Angular distance between the source and the PRIMARY lens on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tEfloat
Einstein crossing time (days).
- thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr)
- muS_Nfloat
Dec Source proper motion (mas/yr)
- betafloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky (mas).
- qfloat
Mass ratio (M2 / M1)
- sepfloat
Angular separation of the two lenses (mas)
- alphafloat
Angle made between the binary axis and North; measured in degrees East of North.
- b_sffnumpy array or list
The ratio of the source flux to the total (source + neighbors + lenses). One for each filter.
- mag_srcnumpy array or list
Source magnitude, unlensed. One in each filter.
- root_tolfloat
Tolerance in comparing the polynomial roots to the physical solutions. Default = 1e-8
- class model.PSBL_PhotParam1(t0, u0_amp, tE, piE_E, piE_N, q, sep, phi, b_sff, mag_src, raL=None, decL=None, root_tol=1e-08)
Bases:
PSPL_Param
Point source binary lens, photometry only.
- It has 3 more parameters than PSPL_PhotParam1:
mass ratio
separation – in units of thetaE
angle of approach
Note that this is a STATIC binary lens, i.e. there is no orbital motion.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth [MJD]
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. It can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time. [MJD]
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- q: float
Mass ratio (low-mass / high-mass)
- sep: float
Angular separation of the two lenses in units of thetaE where thetaE is defined with the total binary mass.
- phi: float
Angle made between the binary axis and the relative proper motion vector, measured in degrees.
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src: array or list
Photometric magnitude of the source. This must be passed in as a list or array, with one entry for each photometric filter.
- Other Parameters
- —————
- raL: float
Right ascension of the lens in decimal degrees. Required if calculating with parallax
- decL: float
Declination of the lens in decimal degrees. Required if calculating with parallax
- root_tol: float
- Tolerance in comparing the polynomial roots to the physical solutions.Default = 0.0
GP Models
- class model.PSBL_GP_PhotParam1(t0, u0_amp, tE, piE_E, piE_N, q, sep, phi, b_sff, mag_src, gp_log_sigma, gp_log_rho, gp_log_S0, gp_log_omega0, raL=None, decL=None, root_tol=1e-08)
Bases:
PSBL_PhotParam1
- class model.PSBL_GP_PhotAstromParam1(mLp, mLs, t0, xS0_E, xS0_N, beta, muL_E, muL_N, muS_E, muS_N, dL, dS, sep, alpha, b_sff, mag_src, gp_log_sigma, gp_log_rho, gp_log_S0, gp_log_omega0, raL=None, decL=None, root_tol=1e-08)
Bases:
PSBL_PhotAstromParam1
- class model.PSBL_GP_PhotAstromParam2(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, q, sep, alpha, b_sff, mag_src, gp_log_sigma, gp_log_rho, gp_log_S0, gp_log_omega0, raL=None, decL=None, root_tol=1e-08)
Bases:
PSBL_PhotAstromParam2
BINARY SOURCE POINT LENS (BSPL) CLASSES
Parameterization Class Family - BSPL
BSPL Models
- class model.BSPL_PhotParam1(t0, u0_amp, tE, piE_E, piE_N, sep, phi, mag_src_pri, mag_src_sec, b_sff, raL=None, decL=None)
Bases:
PSPL_Param
BSPL model for photometry only
A Binary point Source Point Lens model for microlensing.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. It can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
Note, since this is a binary source, we are expressing the nominal source position as that of the primary star in the source binary system.
- tE: float
Einstein crossing time. [MJD]
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- sep: float
Angular separation of the source scondary from the source primary (in units of thetaE).
- phi: float
Angle made between the binary axis and the relative proper motion vector, measured in degrees.
- mag_src_pri: array or list
Photometric magnitude of the first (primary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src_sec: array or list
Photometric magnitude of the second (secondary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = (f_S1 + f_S2) / (f_S1 + f_s2 + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.BSPL_PhotAstromParam1(mL, t0, beta, dL, dL_dS, xS0_E, xS0_N, muL_E, muL_N, muS_E, muS_N, sep, alpha, mag_src_pri, mag_src_sec, b_sff, raL=None, decL=None)
Bases:
PSPL_Param
BSPL model for astrometry and photometry - physical parameterization.
A Binary point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- mL: float
Mass of the lens (Msun)
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- beta: float
Angular distance between the lens and primary source on the plane of the sky (mas). Can be
positive (u0_amp > 0 when u0_hat[0] < 0) or
negative (u0_amp < 0 when u0_hat[0] > 0).
Note, since this is a binary source, we are expressing the nominal source position as that of the primary star in the source binary system.
- dL: float
Distance from the observer to the lens (pc)
- dL_dS: float
Ratio of Distance from the obersver to the lens to Distance from the observer to the source
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame. This should be the position of the source primary.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame. This should be the position of the source primary.
- muL_E: float
RA Lens proper motion (mas/yr)
- muL_N: float
Dec Lens proper motion (mas/yr)
- muS_E: float
RA Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- muS_N: float
Dec Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- sep: float
Angular separation of the source scondary from the source primary (mas).
- alpha: float
Angle made between the binary source axis and North; measured in degrees East of North.
- mag_src_pri: array or list
Photometric magnitude of the first (primary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src_sec: array or list
Photometric magnitude of the second (secondary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = (f_S1 + f_S2) / (f_S1 + f_s2 + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.BSPL_PhotAstromParam2(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, sep, alpha, fratio_bin, mag_base, b_sff, raL=None, decL=None)
Bases:
PSPL_Param
BSPL model for astrometry and photometry - physical parameterization.
A Binary point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_ampfloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky at closest approach in units of thetaE. Can
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
Note, since this is a binary source, we are expressing the nominal source position as that of the primary star in the source binary system.
- tEfloat
Einstein crossing time (days).
- thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame. This should be the position of the source primary.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- muS_Nfloat
Dec Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- sep: float
Angular separation of the source scondary from the source primary (mas).
- alpha: float
Angle made between the binary source axis and North; measured in degrees East of North.
- fratio_bin: float
Flux ratio of secondary flux / primary flux.
- mag_basearray or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter. Note that
\(flux_{base} = f_{src1} + f_{src2} + f_{blend}\)
- such that
\(b_sff = (f_{src1}+ f_{src2}) / ( f_{src1} + f_{src2} + f_{blend} )\)
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = (f_{S1} + f_{S2}) / (f_{S1} + f_{s2} + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.BSPL_PhotAstromParam3(t0, u0_amp, tE, log10_thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, sep, alpha, fratio_bin, mag_base, b_sff, raL=None, decL=None)
Bases:
PSPL_Param
BSPL model for astrometry and photometry - physical parameterization.
A Binary point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_ampfloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky at closest approach in units of thetaE. Can
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
Note, since this is a binary source, we are expressing the nominal source position as that of the primary star in the source binary system.
- tEfloat
Einstein crossing time (days).
- log10_thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame. This should be the position of the source primary.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- muS_Nfloat
Dec Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- sep: float
Angular separation of the source scondary from the source primary (mas).
- alpha: float
Angle made between the binary source axis and North; measured in degrees East of North.
- fratio_bin: float
Flux ratio of secondary flux / primary flux.
- mag_basearray or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter. Note that
\(flux_base = f_{src1{ + f_{src2{ + f_{blend}\)
- such that
\(b_sff = (f_{src1} + f_{src2}) / ( f_{src1} + f_{src2} + f_{blend} )\)
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = (f_{S1} + f_{S2}) / (f_{S1} + f_{s2} + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
GP Models
- class model.BSPL_GP_PhotParam1(t0, u0_amp, tE, piE_E, piE_N, sep, phi, mag_src_pri, mag_src_sec, b_sff, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
BSPL_PhotParam1
BSPL model for photometry only, with GP.
A Binary point Source Point Lens model for microlensing.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Parameters
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. It can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
Note, since this is a binary source, we are expressing the nominal source position as that of the primary star in the source binary system.
- tE: float
Einstein crossing time. [MJD]
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- sep: float
Angular separation of the source scondary from the source primary (in units of thetaE).
- phi: float
Angle made between the binary axis and the relative proper motion vector, measured in degrees.
- mag_src_pri: array or list
Photometric magnitude of the first (primary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src_sec: array or list
Photometric magnitude of the second (secondary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = (f_{S1} + f_{S2}) / (f_{S1} + f_{s2} + f_L + f_N).\) This must be passed in as a list or array, with one entry for each photometric filter.
- gp_log_sigma: float
Guassian process \(log(\sigma)\) for the Matern 3/2 kernel.
- gp_rho: float
Guassian process \({\rho}\) for the Matern 3/2 kernel.
- gp_log_omega04_S0: float
Guassian process \(log(\omega_0^4 * S_0)\) from the SHO kernel.
- gp_log_omega0: float
Guassian process \(log(\omega_0)\) from the SHO kernel.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.BSPL_GP_PhotAstromParam1(mL, t0, beta, dL, dL_dS, xS0_E, xS0_N, muL_E, muL_N, muS_E, muS_N, sep, alpha, mag_src_pri, mag_src_sec, b_sff, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
BSPL_PhotAstromParam1
BSPL model for astrometry and photometry with GP - physical parameterization.
A Binary point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- mL: float
Mass of the lens (Msun)
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- beta: float
Angular distance between the lens and primary source on the plane of the sky (mas). Can be
positive (u0_amp > 0 when u0_hat[0] < 0) or
negative (u0_amp < 0 when u0_hat[0] > 0).
Note, since this is a binary source, we are expressing the nominal source position as that of the primary star in the source binary system.
- dL: float
Distance from the observer to the lens (pc)
- dL_dS: float
Ratio of Distance from the obersver to the lens to Distance from the observer to the source
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame. This should be the position of the source primary.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame. This should be the position of the source primary.
- muL_E: float
RA Lens proper motion (mas/yr)
- muL_N: float
Dec Lens proper motion (mas/yr)
- muS_E: float
RA Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- muS_N: float
Dec Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- sep: float
Angular separation of the source scondary from the source primary (mas).
- alpha: float
Angle made between the binary source axis and North; measured in degrees East of North.
- mag_src_pri: array or list
Photometric magnitude of the first (primary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src_sec: array or list
Photometric magnitude of the second (secondary) source. This must be passed in as a list or array, with one entry for each photometric filter.
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = (f_{S1} + f_{S2}) / (f_{S1} + f_{s2} + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- gp_log_sigma: float
Guassian process \(log(\sigma)\) for the Matern 3/2 kernel.
- gp_rho: float
Guassian process \({\rho}\) for the Matern 3/2 kernel.
- gp_log_omega04_S0: float
Guassian process \(log(\omega_0^4 * S_0)\) from the SHO kernel.
- gp_log_omega0: float
Guassian process \(log(\omega_0)\) from the SHO kernel.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.BSPL_GP_PhotAstromParam2(t0, u0_amp, tE, thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, sep, alpha, fratio_bin, mag_base, b_sff, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
BSPL_PhotAstromParam2
BSPL model for astrometry and photometry with GP - physical parameterization.
A Binary point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_ampfloat
Angular distance between the source and the GEOMETRIC center of the lenses on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
Note, since this is a binary source, we are expressing the nominal source position as that of the primary star in the source binary system.
- tEfloat
Einstein crossing time (days).
- thetaEfloat
The size of the Einstein radius in (mas).
- piSfloat
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_Efloat
The microlensing parallax in the East direction in units of thetaE
- piE_Nfloat
The microlensing parallax in the North direction in units of thetaE
- xS0_Efloat
R.A. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame. This should be the position of the source primary.
- xS0_Nfloat
Dec. of source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_Efloat
RA Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- muS_Nfloat
Dec Source proper motion (mas/yr) Identical proper motions are assumed for the source primary and secondary.
- sep: float
Angular separation of the source scondary from the source primary (mas).
- alpha: float
Angle made between the binary source axis and North; measured in degrees East of North.
- fratio_bin: float
Flux ratio of secondary flux / primary flux.
- mag_basearray or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter. Note that
\(flux_{base} = f_{src1} + f_{src2} + f_{blend}\)
- such that
\(b_{sff} = (f_{src1} + f_{src2}) / ( f_{src1} + f_{src2} + f_{blend} )\)
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) :math:` b_{sff} = (f_{S1} + f_{S2}) / (f_{S1} + f_{s2} + f_L + f_N)`. This must be passed in as a list or array, with one entry for each photometric filter.
- gp_log_sigma: float
Guassian process \(log(\sigma)\) for the Matern 3/2 kernel.
- gp_rho: float
Guassian process \({\rho}\) for the Matern 3/2 kernel.
- gp_log_omega04_S0: float
Guassian process \(log(\omega_0^4 * S_0)\) from the SHO kernel.
- gp_log_omega0: float
Guassian process \(log(\omega_0)\) from the SHO kernel.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.BSPL_GP_PhotAstromParam3(t0, u0_amp, tE, log10_thetaE, piS, piE_E, piE_N, xS0_E, xS0_N, muS_E, muS_N, sep, alpha, fratio_bin, mag_base, b_sff, gp_log_sigma, gp_rho, gp_log_omega04_S0, gp_log_omega0, raL=None, decL=None)
Bases:
BSPL_PhotAstromParam3
Point Source Point Lens with GP model for microlensing. This model includes proper motions of the source and the source position on the sky. It is the same as PSPL_PhotAstromParam4 except it fits for log10(thetaE) instead of thetaE.
- Attributes
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- u0_amp: float
Angular distance between the lens and source on the plane of the sky at closest approach in units of thetaE. Can be
positive (u0_amp > 0 when u0_hat[0] > 0) or
negative (u0_amp < 0 when u0_hat[0] < 0).
- tE: float
Einstein crossing time (days).
- log10_thetaE: float
log10 of the size of the Einstein radius in (mas).
- piS: float
Amplitude of the parallax (1AU/dS) of the source. (mas)
- piE_E: float
The microlensing parallax in the East direction in units of thetaE
- piE_N: float
The microlensing parallax in the North direction in units of thetaE
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Dec Source proper motion (mas/yr)
- sep: float
Angular separation of the source scondary from the source primary (mas).
- alpha: float
Angle made between the binary source axis and North; measured in degrees East of North.
- fratio_bin: float
Flux ratio of secondary flux / primary flux.
- mag_basearray or list
Photometric magnitude of the base. This must be passed in as a list or array, with one entry for each photometric filter. Note that
\(flux_{base} = f_{src1} + f_{src2} + f_{blend}\)
- such that
\(b_{sff} = (f_{src1} + f_{src2}) / ( f_{src1} + f_{src2} + f_{blend})\)
- b_sff: array or list
The ratio of the source flux to the total (source + neighbors + lens) :math:` b_{sff} = (f_{S1} + f_{S2}) / (f_{S1} + f_{s2} + f_L + f_N)`. This must be passed in as a list or array, with one entry for each photometric filter.
- gp_log_sigma: float
Guassian process \(log(\sigma)\) for the Matern 3/2 kernel.
- gp_rho: float
Guassian process \({\rho}\) for the Matern 3/2 kernel.
- gp_log_omega04_S0: float
Guassian process \(log(\omega_0^4 * S_0)\) from the SHO kernel.
- gp_log_omega0: float
Guassian process \(log(\omega_0)\) from the SHO kernel.
Data Class Family
- class model.BSPL
Bases:
PSPL
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_amplification
(t[, filt_idx])Parallax: Get the photometric amplification term at a set of times, t.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_u
(t)- Parameters
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_photometry
log_likely_photometry_each
- get_u(t)
- Parameters
- tnumpy array
Times at which to evaluate the source-lens separation.
- Returns
- unumpy array
Shape = [len(t), 2 sources, 2 directions on sky]
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t: Array of times in MJD.DDD
- Returns
- A_resolvednumpy array
[shape = len(t), len(sources), 2]
Notes
- For each time t and each source, we have:
A_plus is the amplification for the plus image.
A_minus is the amplification for the minus image.
- In other words,
xS[0, 0, 0] returns the amplification of the first source’s “plus” image at the first time.
- Similarly,
xS[0, 0, 1] returns the amplification of the first source’s “minus” image at the first time.
- get_amplification(t, filt_idx=0)
Parallax: Get the photometric amplification term at a set of times, t.
Note that this is a convenience function that combines amplifications from multiple sources. The returned amplification is
..math:
A = (f1 * A1 + f2 * A2) / (f1 + f2)
where the fluxes are the intrinsic source flux in the specified filter.
- Parameters
- t: Array of times in MJD.DDD
- Returns
- Anumpy array
- Array of combined amplifications in the specified filter.Shape = [len(t)]
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- class model.BSPL_Phot
-
Contains methods for model a BSPL photometry only. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
- Attributes
- t0
- tE
- u0_amp
- u0_E
- u0_N
- piE_E:
valid only if parallax model
- piE_N:
valid only if parallax model
- piE_amp
- b_sff[#]
- mag_src[#]:
add in
- mag_base[#]:
add in
- raL:
if parallax model
- decL:
if parallax model
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_amplification
(t[, filt_idx])Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t[, ast_filt_idx])Position of the observed (unresolved) source position in Einstein radii.
get_astrometry_unlensed
(t[, ast_filt_idx])Get the astrometry of the source if the lens didn't exist.
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
Position of the observed source position in Einstein radii.
Get the astrometry of the source if the lens didn't exist.
get_u
(t)- Parameters
get_centroid_shift
get_chi2_photometry
get_lens_astrometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_photometry
log_likely_photometry_each
- get_resolved_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist. Note, this is a photometry only model, so units are in Einstein radii.
- Returns
- xS_resolved_unlensednumpy array, [shape = len(t_obs), N_sources, 2]
The unlensed positions of the sources in Einstein radii.
- In other words,
xS[0, 0, :] returns the 2D sky position of the first source at the first time.
- Similarly,
xS[0, 1, :] returns the 2D sky position of the second source at the first time.
- get_astrometry_unlensed(t, ast_filt_idx=0)
Get the astrometry of the source if the lens didn’t exist. Note, this is a photometry only model, so units are in Einstein radii.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in Einstein radii.
- get_resolved_astrometry(t)
Position of the observed source position in Einstein radii.
- Parameters
- tarray_like, shape = [N_times]
Array of times to model.
- Returns
- model_posarray_like. shape = [N_times, N_images, 2]
Array of vector positions of the centroid at each t_obs.
- get_astrometry(t, ast_filt_idx=0)
Position of the observed (unresolved) source position in Einstein radii.
- Parameters
- t: array_like
Array of times to model.
- Returns
- model_posarray_like
Array of vector positions of the centroid at each t_obs.
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t, filt_idx=0)
Parallax: Get the photometric amplification term at a set of times, t.
Note that this is a convenience function that combines amplifications from multiple sources. The returned amplification is
..math:
A = (f1 * A1 + f2 * A2) / (f1 + f2)
where the fluxes are the intrinsic source flux in the specified filter.
- Parameters
- t: Array of times in MJD.DDD
- Returns
- Anumpy array
- Array of combined amplifications in the specified filter.Shape = [len(t)]
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t: Array of times in MJD.DDD
- Returns
- A_resolvednumpy array
[shape = len(t), len(sources), 2]
Notes
- For each time t and each source, we have:
A_plus is the amplification for the plus image.
A_minus is the amplification for the minus image.
- In other words,
xS[0, 0, 0] returns the amplification of the first source’s “plus” image at the first time.
- Similarly,
xS[0, 0, 1] returns the amplification of the first source’s “minus” image at the first time.
- get_u(t)
- Parameters
- tnumpy array
Times at which to evaluate the source-lens separation.
- Returns
- unumpy array
Shape = [len(t), 2 sources, 2 directions on sky]
- class model.BSPL_PhotAstrom
Bases:
BSPL
,PSPL_PhotAstrom
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_amplification
(t[, filt_idx])Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t[, ast_filt_idx])Parallax: Get unresolved astrometry for binary source, point lens.
get_astrometry_unlensed
(t[, ast_filt_idx])Get the astrometry of the sources if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
Parallax: For each source, get the x, y astrometry for the two lensed source images.
Get the astrometry of the source if the lens didn't exist.
get_u
(t)- Parameters
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_photometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- get_resolved_astrometry_unlensed(t)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_resolved_unlensednumpy array, [shape = len(t_obs), N_sources, 2]
The unlensed positions of the sources in arcseconds.
- In other words,
xS[0, 0, :] returns the 2D sky position of the first source at the first time.
- Similarly,
xS[0, 1, :] returns the 2D sky position of the second source at the first time.
- get_astrometry_unlensed(t, ast_filt_idx=0)
Get the astrometry of the sources if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2 directions
- The unlensed positions of the combined sources in arcseconds.Shape = [len(t), 2 directions]
- get_resolved_astrometry(t)
Parallax: For each source, get the x, y astrometry for the two lensed source images. For each source, we label the two images as plus and minus.
- Returns
- xS_resolvednumpy array
[shape = len(t), len(sources), 2, 2]
Notes
- For each time t and each source, we have:
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the minus image.
- In other words,
xS[0, 0, 0, :] returns the 2D sky position of the first source’s “plus” image at the first time.
- Similarly,
xS[0, 0, 1, :] returns the 2D sky position of the first source’s “minus” image at the first time.
- get_astrometry(t, ast_filt_idx=0)
Parallax: Get unresolved astrometry for binary source, point lens.
- Parameters
- t:
Array of times in MJD.DDD
- Returns
- xS_lensed
Returns flux-weighted average of lensed source positions.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
Returns the flux-weighted centroid of all the sources lensed images.
- Parameters
- t:
Array of times in MJD.DDD
- Returns
- centroid_shiftnumpy array
[shape = len(t), 2]
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_amplification(t, filt_idx=0)
Parallax: Get the photometric amplification term at a set of times, t.
Note that this is a convenience function that combines amplifications from multiple sources. The returned amplification is
..math:
A = (f1 * A1 + f2 * A2) / (f1 + f2)
where the fluxes are the intrinsic source flux in the specified filter.
- Parameters
- t: Array of times in MJD.DDD
- Returns
- Anumpy array
- Array of combined amplifications in the specified filter.Shape = [len(t)]
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t: Array of times in MJD.DDD
- Returns
- A_resolvednumpy array
[shape = len(t), len(sources), 2]
Notes
- For each time t and each source, we have:
A_plus is the amplification for the plus image.
A_minus is the amplification for the minus image.
- In other words,
xS[0, 0, 0] returns the amplification of the first source’s “plus” image at the first time.
- Similarly,
xS[0, 0, 1] returns the amplification of the first source’s “minus” image at the first time.
- get_u(t)
- Parameters
- tnumpy array
Times at which to evaluate the source-lens separation.
- Returns
- unumpy array
Shape = [len(t), 2 sources, 2 directions on sky]
Parallax Class Family
- class model.BSPL_noParallax
Bases:
PSPL_noParallax
Methods
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.BSPL_Parallax
Bases:
PSPL_Parallax
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
FSPL(Finite-Source Point Lens) Models - NOT DONE YET… place holders
FSPL Classes
- class model.FSPL
Bases:
PSPL
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_source_outline_astrometry
(r, n, center)Return astrometric points that outline the outer circumference of the source star.
get_chi2_photometry
get_lnL_constant
log_likely_photometry
log_likely_photometry_each
- get_source_outline_astrometry(r, n, center)
Return astrometric points that outline the outer circumference of the source star.
The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positionse.g:( ((1,0), (0,1), (-1,0), (0,-1)) )
if n = 4 and radius = 1- Returns
- source_pointsnumpy array
Returns an array of
shape = [2, self.n_outline, len(time)]
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Other Parameters
- ———-
- amp_arrarray_like
Amplifications of each individual image at each time, i.e. amp_arr.shape = (len(t_obs), number of images at each t_obs).
This will over-ride t_obs; but is more efficient when calculating both photometry and astrometry. If None, then just use t_obs.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- class model.FSPL_PhotAstrom
Bases:
FSPL
,PSPL_PhotAstrom
Contains methods for model a PSPL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
- Attributes
- Available class variables that should be defined.
- t0
- tE
- u0_amp
- u0_E
- u0_N
- beta
- piE_E:
valid only if parallax model
- piE_N:
valid only if parallax model
- piE_amp
- mL
- thetaE_amp
- thetaE_E
- thetaE_N
- xS0_E
- xS0_N
- xL0_E
- xL0_N
- muS_E
- muS_N
- muL_E
- muL_N
- muRel_E
- muRel_N
- muRel_amp
- piS
- piL
- dL
- dS
- dL_dS (dL over dS)
- radius
- n
- b_sff[#]
- mag_src[#] – add in
- mag_base[#] – add in
- raL:
if parallax model
- decL:
if parallax model
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Outputs position of source unlensed.
get_lens_astrometry
(t_obs)get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_source_outline_astrometry
(r, n, center)Return astrometric points that outline the outer circumference of the source star.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_resolved_astrometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Other Parameters
- ———-
- amp_arrarray_like
Amplifications of each individual image at each time, i.e. amp_arr.shape = (len(t_obs), number of images at each t_obs).
This will over-ride t_obs; but is more efficient when calculating both photometry and astrometry. If None, then just use t_obs.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_astrometry_unlensed(t)
Outputs position of source unlensed.
Input a list of times and it will output the position of the source had it not been lensed at each of the times in the list
e.g ifn = 4
, and sayv = [1,0]
& the times are[0,1,2]
in years.This will return((( (1,0),(0,1),(-1,0),(0,-1) ), ( (2,0),(1,1),(0,0),(1,-1) ), ( (3,0),(2,1),(1,0),(2,-1) ))...
= (positions at t=0), (positions at t=1), (positions at t=2)so
np.array(positions)
is an array which contains an array for each time step with the positions of all the points on the boundary of the source.
- get_source_outline_astrometry(r, n, center)
Return astrometric points that outline the outer circumference of the source star.
The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positionse.g:( ((1,0), (0,1), (-1,0), (0,-1)) )
if n = 4 and radius = 1- Returns
- source_pointsnumpy array
Returns an array of
shape = [2, self.n_outline, len(time)]
- class model.FSPL_noParallax
Bases:
PSPL_noParallax
Methods
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.FSPL_Parallax
Bases:
PSPL_Parallax
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.FSPL_PhotAstromParam1(mL, t0, beta, dL, dS, xS0_E, xS0_N, muL_E, muL_N, muS_E, muS_N, radius, b_sff, mag_src, n_outline=10, raL=None, decL=None)
Bases:
PSPL_Param
PSPL model for astrometry and photometry - physical parameterization.
A Point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.
Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.
- Parameters
- mL: float
Mass of the lens (Msun)
- t0: float
Time of photometric peak, as seen from Earth (MJD.DDD)
- beta: float
Angular distance between the lens and source on the plane of the sky (mas). Can be
positive (u0_amp > 0 when u0_hat[0] (East component) < 0) or
negative (u0_amp < 0 when u0_hat[0] (East component) > 0).
- dL: float
Distance from the observer to the lens (pc)
- dL_dS: float
Ratio of Distance from the obersver to the lens to Distance from the observer to the source
- xS0_E: float
RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- xS0_N: float
Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.
- muL_E: float
RA Lens proper motion (mas/yr)
- muL_N: float
Dec Lens proper motion (mas/yr)
- muS_E: float
RA Source proper motion (mas/yr)
- muS_N: float
Dec Source proper motion (mas/yr)
- radius: float
Projected radius of the star in arcsec on the sky plane.
- b_sff: float
The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.
- mag_src: float
Photometric magnitude of the source. This must be passed in as a list or array, with one entry for each photometric filter.
- n_outline: int
Number of boundary points to use when approximating the source outline. Calculation time scales approximately linearly with ‘n_outline’.
- raL: float, optional
Right ascension of the lens in decimal degrees.
- decL: float, optional
Declination of the lens in decimal degrees.
- class model.FSPL_PhotAstrom
Bases:
FSPL
,PSPL_PhotAstrom
Contains methods for model a PSPL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.
- Attributes
- Available class variables that should be defined.
- t0
- tE
- u0_amp
- u0_E
- u0_N
- beta
- piE_E:
valid only if parallax model
- piE_N:
valid only if parallax model
- piE_amp
- mL
- thetaE_amp
- thetaE_E
- thetaE_N
- xS0_E
- xS0_N
- xL0_E
- xL0_N
- muS_E
- muS_N
- muL_E
- muL_N
- muRel_E
- muRel_N
- muRel_amp
- piS
- piL
- dL
- dS
- dL_dS (dL over dS)
- radius
- n
- b_sff[#]
- mag_src[#] – add in
- mag_base[#] – add in
- raL:
if parallax model
- decL:
if parallax model
Methods
animate
(tE, time_steps, frame_time, name, ...)Produces animation of microlensing event.
Outputs position of source unlensed.
get_lens_astrometry
(t_obs)get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_source_outline_astrometry
(r, n, center)Return astrometric points that outline the outer circumference of the source star.
get_chi2_astrometry
get_chi2_photometry
get_lnL_constant
get_resolved_astrometry
log_likely_astrometry
log_likely_astrometry_each
log_likely_photometry
log_likely_photometry_each
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Other Parameters
- ———-
- amp_arrarray_like
Amplifications of each individual image at each time, i.e. amp_arr.shape = (len(t_obs), number of images at each t_obs).
This will over-ride t_obs; but is more efficient when calculating both photometry and astrometry. If None, then just use t_obs.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- animate(tE, time_steps, frame_time, name, size, zoom, astrometry)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_astrometry_unlensed(t)
Outputs position of source unlensed.
Input a list of times and it will output the position of the source had it not been lensed at each of the times in the list
e.g ifn = 4
, and sayv = [1,0]
& the times are[0,1,2]
in years.This will return((( (1,0),(0,1),(-1,0),(0,-1) ), ( (2,0),(1,1),(0,0),(1,-1) ), ( (3,0),(2,1),(1,0),(2,-1) ))...
= (positions at t=0), (positions at t=1), (positions at t=2)so
np.array(positions)
is an array which contains an array for each time step with the positions of all the points on the boundary of the source.
- get_source_outline_astrometry(r, n, center)
Return astrometric points that outline the outer circumference of the source star.
The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positionse.g:( ((1,0), (0,1), (-1,0), (0,-1)) )
if n = 4 and radius = 1- Returns
- source_pointsnumpy array
Returns an array of
shape = [2, self.n_outline, len(time)]
FSPL Limb Classes
- class model.FSPL_Limb
Bases:
FSPL
Methods
animate
(crossings, time_steps, frame_time, ...)Produces animation of microlensing event.
get_photometry
(t_obs[, filt_idx, amp_arr, ...])Get the photometry for each of the lensed source images.
get_source_outline_astrometry
(r, n, center)Return astrometric points that outline the outer circumference of the source star.
F
get_amplification
get_chi2_photometry
get_lnL_constant
log_likely_photometry
log_likely_photometry_each
- get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)
Get the photometry for each of the lensed source images.
- Parameters
- t_obsarray_like
Array of times to model.
- Returns
- mag_modelarray_like
Magnitude of the centroid at t_obs.
- animate(crossings, time_steps, frame_time, name, size, zoom)
Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows
- Parameters
- tE:
- number of einstein crossings times before/after the peak you want the animation to plot
e.g tE = 2 => graph will go from -2 tE to 2 tE
- time_steps:
number of time steps before/after peak, so total number of time steps will be 2 times this value
- frame_time:
times in ms of each frame in the animation
- name: string
the animation will be saved as name.html
- size: list
[horizontal, vertical] cm’s
- zoom:
# of einstein radii plotted in vertical direction
- get_source_outline_astrometry(r, n, center)
Return astrometric points that outline the outer circumference of the source star.
The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positionse.g:( ((1,0), (0,1), (-1,0), (0,-1)) )
if n = 4 and radius = 1- Returns
- source_pointsnumpy array
Returns an array of
shape = [2, self.n_outline, len(time)]
- class model.FSPL_Limb_noParallax
Bases:
FSPL_noParallax
Methods
noParallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])noParallax: Position of the observed source position in arcsec.
get_astrometry_unlensed
(t_obs)noParallax: Get the astrometry of the source if the lens didn't exist.
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_lens_astrometry
(t_obs)Equation of motion for just the foreground lens.
Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Get the x, y astrometry for each of the two source images, which we label plus and minus.
calc_piE_ecliptic
- get_amplification(t)
noParallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
noParallax: Position of the observed source position in arcsec.
- get_astrometry_unlensed(t_obs)
noParallax: Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t)
noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Equation of motion for just the foreground lens.
- Parameters
- t_obsarray_like
Time (in MJD).
- get_resolved_amplification(t)
Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image in arcsec
xS_minus is the vector position of the plus image in arcsec
- class model.FSPL_Limb_Parallax
Bases:
FSPL_Parallax
Methods
Parallax: Get piE_ecliptic
Parallax: Get the photometric amplification term at a set of times, t.
get_astrometry
(t_obs[, ast_filt_idx])Parallax: Get astrometry
get_astrometry_unlensed
(t_obs)Get the astrometry of the source if the lens didn't exist.
get_centroid_shift
(t[, ast_filt_idx])Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
get_geoproj_ast_params
(t0par)get_geoproj_params
(t0par)get_lens_astrometry
(t_obs)Parallax: Get lens astrometry
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
get_resolved_astrometry
(t_obs)Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
start
- calc_piE_ecliptic()
Parallax: Get piE_ecliptic
- get_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t.
- Parameters
- t:
Array of times in MJD.DDD
- get_astrometry(t_obs, ast_filt_idx=0)
Parallax: Get astrometry
- get_astrometry_unlensed(t_obs)
Get the astrometry of the source if the lens didn’t exist.
- Returns
- xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2
The unlensed positions of the source in arcseconds.
- get_centroid_shift(t, ast_filt_idx=0)
Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).
- get_lens_astrometry(t_obs)
Parallax: Get lens astrometry
- get_resolved_amplification(t)
Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.
- Parameters
- t:
Array of times in MJD.DDD
- get_resolved_astrometry(t_obs)
Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.
- Returns
- [xS_plus, xS_minus]list of numpy arrays
xS_plus is the vector position of the plus image.
xS_minus is the vector position of the plus image.
- class model.FSPL_Limb_PhotAstromParam1(lens_mass, t0, xS0, beta, muL, muS, dL, dS, n, radius, utilde, nr, mag_src)
Bases:
PSPL_Param
Model Fitter
PSPL_Solver
- class model_fitter.PSPL_Solver(data, model_class, custom_additional_param_names=None, add_error_on_photometry=False, multiply_error_on_photometry=False, use_phot_optional_params=True, use_ast_optional_params=True, wrapped_params=None, importance_nested_sampling=False, multimodal=True, const_efficiency_mode=False, n_live_points=300, evidence_tolerance=0.5, sampling_efficiency=0.8, n_iter_before_update=100, null_log_evidence=-1e+90, max_modes=100, mode_tolerance=-1e+90, outputfiles_basename='chains/1-', seed=-1, verbose=False, resume=False, context=0, write_output=True, log_zero=-1e+100, max_iter=0, init_MPI=False, dump_callback='default')
Bases:
Solver
A PyMultiNest solver to find the optimal PSPL parameters, given data and a microlensing model from model.py. DESPITE THE NAME YOU CAN ALSO USE IT TO FIT PSBL!
Examples
Assuming that a data dictionary has been instantiated with the above keys, and that a model has been loaded in from model.py, PSPL_Solver can be run with the following commands: .. code:
fitter = PSPL_Solver(data, PSPL_PhotAstrom_Par_Param1, add_error_on_photometry=True, custom_additional_param_names=['dS', 'tE'], outputfiles_basename='./model_output/test_') fitter.solve()
- Attributes
- datadictionary
Observational data used to fit a microlensing model. What the data must contain depends on what type of microlensing model you are solving for.
The data dictionary must always photometry information of at least one filter. This data must contain the times, magnitudes, and magnitude errors of the observations. The keys to these arrays are:
t_phot1 (MJD)
mag1 (magnitudes)
mag_err1 (magnitudes)
PSPL_Solver supports multiple photometric filters. For each additional filter, increments the extension of the above keys by one. For example, a second filter would be:
t_phot2 (MJD)
mag2 (magnitudes)
mag_err2 (magnitudes)
PSPL_Solver supports solving microlensing models that calculate with parallax. These models must be accompanied with data that contains the right ascenscion and declination of the target. These keys are:
raL (decimal degrees)
decL (decimal degrees)
PSPL_Solver supports solving microlensing models that fit astrometry. These models must be accompanied with data that contains astrometric observations in the following keys:
t_ast (MJD)
xpos (arcsec along East-West increasing to the East)
ypos (arcsec along the North-South increasing to the North)
xpos_err (arcsec)
ypos_err (arcsec)
- model_class
PSPL_Solver must be provided with the microlensing model that you are trying to fit to your data. These models are written out in model.py, along with extensive documentation as to their content and construction in the file’s docstring. The model can support either
photometric data or photometric and astrometric data,
parallax or no parallax, and
different parameterizations of the model.
For example, a model with accepts both astrometric and photometric data, uses parallax, and uses a parameterization that includes the distance to the source and the lens is: PSPL_PhotAstrom_Par_Param1.
- custom_additional_param_nameslist, optional
If provided, the fitter will override the default additional_param_names of the model_class. These are the parameters, besides those that are being fitted for, that are written out to disk for posterior plotting after the fit has completed. To see the default additional_param_names run:
print(model_class.additional _param_names)
- add_error_on_photometryboolean, optional
If set to True, the fitter will fit for an additive error to the photometric magnitudes in the fitting process. This error will have the name add_errN, with an N equal to the filter number.
- multiply_error_on_photometryboolean, optional
If set to True, the fitter will fit for a multiplicative error to the photometric magnitudes in the fitting process. This error will have the name mult_errN, with an N equal to the filter number.
- All other parameters
See pymultinest.run() for a description of all other parameters.
Methods
LogLikelihood
(cube[, ndim, n_params])This is just a wrapper because PyMultinest requires passing in the ndim and nparams.
Prior
(cube[, ndim, nparams])Prior_from_post
(cube[, ndim, nparams])Get the bin midpoints
calc_best_fit
(tab, smy[, s_idx, def_best])Returns best-fit parameters, where best-fit can be median, maxl, or MAP.
calc_chi2
([params, verbose])- Parameters
calc_chi2_manual
([params, verbose])- Parameters
get_best_fit
([def_best])Returns best-fit parameters, where best-fit can be median, maxl, or MAP.
get_best_fit_model
([def_best])Identify best-fit model
get_best_fit_modes
([def_best])Returns a list of best-fit parameters, where best-fit can be median, maxl, or MAP.
load_mnest_modes
([remake_fits])Load up the separate modes results into an astropy table.
Make a Dynesty-style results object that can be used in the nicer plotting codes.
load_mnest_results
([remake_fits])Load up the MultiNest results into an astropy table.
load_mnest_results_for_dynesty
([remake_fits])Make a Dynesty-style results object that can be used in the nicer plotting codes.
load_mnest_summary
([remake_fits])Load up the MultiNest results into an astropy table.
log_likely
(cube[, verbose])- Parameters
Setup our prior distributions (i.e.
plot_dynesty_style
([sim_vals, fit_vals, ...])- Parameters
plot_model_and_data
(model[, input_model, ...])Make and save the model and data plots.
plot_model_and_data_modes
([def_best])Plots photometry data, along with n random draws from the posterior.
print_likelihood
([params, verbose])- Parameters
sample_post
(binmids, cdf, bininds)Randomly sample from a multinest posterior distribution.
Reads in the fits for the different modes (post_separate.dat) and splits it into a .dat file per mode.
solve
()Run a MultiNest fit to find the optimal parameters (and their posteriors) given the data.
Write a YAML file that contains the parameters to re-initialize this object, if desired.
Prior_copy
callback_plotter
check_data
dyn_log_likely
dyn_prior
get_best_fit_modes_model
get_model
get_modified_mag_err
log_likely_astrometry
log_likely_photometry
setup_params
summarize_results
summarize_results_modes
write_summary_maxL
- make_default_priors()
Setup our prior distributions (i.e. random samplers). We will draw from these in the Prior() function. We set them up in advance because they depend on properties of the data. Also, they can be over-written by custom priors as desired.
To make your own custom priors, use the make_gen() functions with different limits.
- Prior_from_post(cube, ndim=None, nparams=None)
Get the bin midpoints
- sample_post(binmids, cdf, bininds)
Randomly sample from a multinest posterior distribution.
- Parameters
- Nparams:
number of parameters
- Nbins:
number of histogram bins per dimension
- Nnzero:
number of histogram bins with non-zero probability
- binmidslist of length N, each list entry is an array of shape (M, )
The centers of the bins for each parameter
- cdf(Nnzero, ) array
CDF of the distribution. Only the non-zero probability entries.
- bininds(Nnzero, Nparams) array
Histogram indices of the non-zero probability entries.
- LogLikelihood(cube, ndim=None, n_params=None)
This is just a wrapper because PyMultinest requires passing in the ndim and nparams.
- log_likely(cube, verbose=False)
- Parameters
- cubelist or dict
The dictionary or cube of the model parameters.
- write_params_yaml()
Write a YAML file that contains the parameters to re-initialize this object, if desired.
- solve()
Run a MultiNest fit to find the optimal parameters (and their posteriors) given the data.
Note we will ALWAYS tell multinest to be verbose.
- separate_modes()
Reads in the fits for the different modes (post_separate.dat) and splits it into a .dat file per mode.
Is there a more intelligent way to deal with all the indices??? Write better later, but it seems to work for now…
- calc_best_fit(tab, smy, s_idx=0, def_best='maxl')
Returns best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If best-fit is median, then also return +/- 1 sigma uncertainties.
If best-fit is MAP, then also need to indicate which row of summary table to use. Default is s_idx = 0 (global solution). s_idx = 1, 2, … , n for the n different modes.
tab = self.load_mnest_results() smy = self.load_mnest_summary()
- get_best_fit(def_best='maxl')
Returns best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If def_best is median, then also return +/- 1 sigma uncertainties.
- Returns
- Either a dicitonary or a tuple of length=2 holding
- two dictionaries, one for values and one for uncertainty ranges.
- See calc_best_fit() for details.
- get_best_fit_modes(def_best='maxl')
Returns a list of best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If def_best is median, then also return +/- 1 sigma uncertainties.
- Returns
- Either a list of dicitonaries or a list where each entry is
- a tuple of length=2 holding two dictionaries, one for values
- and one for uncertainty ranges.
- See calc_best_fit() for details.
- get_best_fit_model(def_best='maxl')
Identify best-fit model
- Parameters
- def_beststr
Choices are ‘map’ (maximum a posteriori), ‘median’, or ‘maxl’ (maximum likelihood)
- load_mnest_results(remake_fits=False)
Load up the MultiNest results into an astropy table.
- load_mnest_summary(remake_fits=False)
Load up the MultiNest results into an astropy table.
- load_mnest_modes(remake_fits=False)
Load up the separate modes results into an astropy table.
- load_mnest_results_for_dynesty(remake_fits=False)
Make a Dynesty-style results object that can be used in the nicer plotting codes.
- load_mnest_modes_results_for_dynesty(remake_fits=False)
Make a Dynesty-style results object that can be used in the nicer plotting codes.
- plot_dynesty_style(sim_vals=None, fit_vals=None, remake_fits=False, dims=None, traceplot=True, cornerplot=True, kde=True)
- Parameters
- sim_valsdict
Dictionary of simulated input or comparison values to overplot on posteriors.
- fit_valsstr
Choices are ‘map’ (maximum a posteriori), ‘mean’, or ‘maxl’ (maximum likelihood)
- plot_model_and_data(model, input_model=None, mnest_results=None, suffix='', zoomx=None, zoomy=None, zoomy_res=None, fitter=None, N_traces=50)
Make and save the model and data plots.
zoomx, xoomy, zoomy_res : list the same length as self.n_phot_sets Each entry of the list is a list [a, b] cooresponding to the plot limits
- plot_model_and_data_modes(def_best='maxl')
Plots photometry data, along with n random draws from the posterior.
- print_likelihood(params='best', verbose=True)
- Parameters
- model_paramsstr or dict, optional
- model_params = ‘best’ will load up the best solution and calculate
the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- calc_chi2(params='best', verbose=False)
- Parameters
- paramsstr or dict, optional
model_params = ‘best’ will load up the best solution and calculate the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- calc_chi2_manual(params='best', verbose=False)
- Parameters
- paramsstr or dict, optional
model_params = ‘best’ will load up the best solution and calculate the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- class model_fitter.PSPL_Solver_weighted(data, model_class, custom_additional_param_names=None, add_error_on_photometry=False, multiply_error_on_photometry=False, use_phot_optional_params=True, use_ast_optional_params=True, wrapped_params=None, importance_nested_sampling=False, multimodal=True, const_efficiency_mode=False, n_live_points=300, evidence_tolerance=0.5, sampling_efficiency=0.8, n_iter_before_update=100, null_log_evidence=-1e+90, max_modes=100, mode_tolerance=-1e+90, outputfiles_basename='chains/1-', seed=-1, verbose=False, resume=False, context=0, write_output=True, log_zero=-1e+100, max_iter=0, init_MPI=False, dump_callback=None, weights='phot_ast_equal')
Bases:
PSPL_Solver
Soliver where the likelihood function has each data set weigthed equally (i.e. not the natural weighting by the number of points; but rather each contributes 1/n_k where n is the number of data points and k is the data set.
Methods
LogLikelihood
(cube[, ndim, n_params])This is just a wrapper because PyMultinest requires passing in the ndim and nparams.
Prior
(cube[, ndim, nparams])Prior_from_post
(cube[, ndim, nparams])Get the bin midpoints
calc_best_fit
(tab, smy[, s_idx, def_best])Returns best-fit parameters, where best-fit can be median, maxl, or MAP.
calc_chi2
([params, verbose])- Parameters
calc_chi2_manual
([params, verbose])- Parameters
calc_weights
(weights)order of weight_arr is `[phot_1, phot_2, .
get_best_fit
([def_best])Returns best-fit parameters, where best-fit can be median, maxl, or MAP.
get_best_fit_model
([def_best])Identify best-fit model
get_best_fit_modes
([def_best])Returns a list of best-fit parameters, where best-fit can be median, maxl, or MAP.
load_mnest_modes
([remake_fits])Load up the separate modes results into an astropy table.
Make a Dynesty-style results object that can be used in the nicer plotting codes.
load_mnest_results
([remake_fits])Load up the MultiNest results into an astropy table.
load_mnest_results_for_dynesty
([remake_fits])Make a Dynesty-style results object that can be used in the nicer plotting codes.
load_mnest_summary
([remake_fits])Load up the MultiNest results into an astropy table.
log_likely
(cube[, verbose])- Parameters
Setup our prior distributions (i.e.
plot_dynesty_style
([sim_vals, fit_vals, ...])- Parameters
plot_model_and_data
(model[, input_model, ...])Make and save the model and data plots.
plot_model_and_data_modes
([def_best])Plots photometry data, along with n random draws from the posterior.
print_likelihood
([params, verbose])- Parameters
sample_post
(binmids, cdf, bininds)Randomly sample from a multinest posterior distribution.
Reads in the fits for the different modes (post_separate.dat) and splits it into a .dat file per mode.
solve
()Run a MultiNest fit to find the optimal parameters (and their posteriors) given the data.
Write a YAML file that contains the parameters to re-initialize this object, if desired.
Prior_copy
callback_plotter
check_data
dyn_log_likely
dyn_prior
get_best_fit_modes_model
get_model
get_modified_mag_err
log_likely_astrometry
log_likely_photometry
setup_params
summarize_results
summarize_results_modes
write_summary_maxL
- calc_weights(weights)
order of weight_arr is [phot_1, phot_2, … phot_n, ast_1, ast_2, … ast_n]
- LogLikelihood(cube, ndim=None, n_params=None)
This is just a wrapper because PyMultinest requires passing in the ndim and nparams.
- Prior_from_post(cube, ndim=None, nparams=None)
Get the bin midpoints
- calc_best_fit(tab, smy, s_idx=0, def_best='maxl')
Returns best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If best-fit is median, then also return +/- 1 sigma uncertainties.
If best-fit is MAP, then also need to indicate which row of summary table to use. Default is s_idx = 0 (global solution). s_idx = 1, 2, … , n for the n different modes.
tab = self.load_mnest_results() smy = self.load_mnest_summary()
- calc_chi2(params='best', verbose=False)
- Parameters
- paramsstr or dict, optional
model_params = ‘best’ will load up the best solution and calculate the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- calc_chi2_manual(params='best', verbose=False)
- Parameters
- paramsstr or dict, optional
model_params = ‘best’ will load up the best solution and calculate the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- get_best_fit(def_best='maxl')
Returns best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If def_best is median, then also return +/- 1 sigma uncertainties.
- Returns
- Either a dicitonary or a tuple of length=2 holding
- two dictionaries, one for values and one for uncertainty ranges.
- See calc_best_fit() for details.
- get_best_fit_model(def_best='maxl')
Identify best-fit model
- Parameters
- def_beststr
Choices are ‘map’ (maximum a posteriori), ‘median’, or ‘maxl’ (maximum likelihood)
- get_best_fit_modes(def_best='maxl')
Returns a list of best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If def_best is median, then also return +/- 1 sigma uncertainties.
- Returns
- Either a list of dicitonaries or a list where each entry is
- a tuple of length=2 holding two dictionaries, one for values
- and one for uncertainty ranges.
- See calc_best_fit() for details.
- load_mnest_modes(remake_fits=False)
Load up the separate modes results into an astropy table.
- load_mnest_modes_results_for_dynesty(remake_fits=False)
Make a Dynesty-style results object that can be used in the nicer plotting codes.
- load_mnest_results(remake_fits=False)
Load up the MultiNest results into an astropy table.
- load_mnest_results_for_dynesty(remake_fits=False)
Make a Dynesty-style results object that can be used in the nicer plotting codes.
- load_mnest_summary(remake_fits=False)
Load up the MultiNest results into an astropy table.
- log_likely(cube, verbose=False)
- Parameters
- cubelist or dict
The dictionary or cube of the model parameters.
- make_default_priors()
Setup our prior distributions (i.e. random samplers). We will draw from these in the Prior() function. We set them up in advance because they depend on properties of the data. Also, they can be over-written by custom priors as desired.
To make your own custom priors, use the make_gen() functions with different limits.
- plot_dynesty_style(sim_vals=None, fit_vals=None, remake_fits=False, dims=None, traceplot=True, cornerplot=True, kde=True)
- Parameters
- sim_valsdict
Dictionary of simulated input or comparison values to overplot on posteriors.
- fit_valsstr
Choices are ‘map’ (maximum a posteriori), ‘mean’, or ‘maxl’ (maximum likelihood)
- plot_model_and_data(model, input_model=None, mnest_results=None, suffix='', zoomx=None, zoomy=None, zoomy_res=None, fitter=None, N_traces=50)
Make and save the model and data plots.
zoomx, xoomy, zoomy_res : list the same length as self.n_phot_sets Each entry of the list is a list [a, b] cooresponding to the plot limits
- plot_model_and_data_modes(def_best='maxl')
Plots photometry data, along with n random draws from the posterior.
- print_likelihood(params='best', verbose=True)
- Parameters
- model_paramsstr or dict, optional
- model_params = ‘best’ will load up the best solution and calculate
the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- sample_post(binmids, cdf, bininds)
Randomly sample from a multinest posterior distribution.
- Parameters
- Nparams:
number of parameters
- Nbins:
number of histogram bins per dimension
- Nnzero:
number of histogram bins with non-zero probability
- binmidslist of length N, each list entry is an array of shape (M, )
The centers of the bins for each parameter
- cdf(Nnzero, ) array
CDF of the distribution. Only the non-zero probability entries.
- bininds(Nnzero, Nparams) array
Histogram indices of the non-zero probability entries.
- separate_modes()
Reads in the fits for the different modes (post_separate.dat) and splits it into a .dat file per mode.
Is there a more intelligent way to deal with all the indices??? Write better later, but it seems to work for now…
- solve()
Run a MultiNest fit to find the optimal parameters (and their posteriors) given the data.
Note we will ALWAYS tell multinest to be verbose.
- write_params_yaml()
Write a YAML file that contains the parameters to re-initialize this object, if desired.
- class model_fitter.PSPL_Solver_Hobson_Weighted(data, model_class, custom_additional_param_names=None, add_error_on_photometry=False, multiply_error_on_photometry=False, use_phot_optional_params=True, use_ast_optional_params=True, wrapped_params=None, importance_nested_sampling=False, multimodal=True, const_efficiency_mode=False, n_live_points=300, evidence_tolerance=0.5, sampling_efficiency=0.8, n_iter_before_update=100, null_log_evidence=-1e+90, max_modes=100, mode_tolerance=-1e+90, outputfiles_basename='chains/1-', seed=-1, verbose=False, resume=False, context=0, write_output=True, log_zero=-1e+100, max_iter=0, init_MPI=False, dump_callback='default')
Bases:
PSPL_Solver
Methods
LogLikelihood
(cube[, ndim, n_params])This is just a wrapper because PyMultinest requires passing in the ndim and nparams.
Prior
(cube[, ndim, nparams])Prior_from_post
(cube[, ndim, nparams])Get the bin midpoints
calc_best_fit
(tab, smy[, s_idx, def_best])Returns best-fit parameters, where best-fit can be median, maxl, or MAP.
calc_chi2
([params, verbose])- Parameters
calc_chi2_manual
([params, verbose])- Parameters
get_best_fit
([def_best])Returns best-fit parameters, where best-fit can be median, maxl, or MAP.
get_best_fit_model
([def_best])Identify best-fit model
get_best_fit_modes
([def_best])Returns a list of best-fit parameters, where best-fit can be median, maxl, or MAP.
Return the effective weights, alpha_k, for each data set.
hobson_weight_log_likely
(ln_prob_dk_giv_ak_1)Implement a data-set-specific weighting scheme by using a hyperparameter, alpha_k, for the kth data set as described in Hobson et al. 2002.
load_mnest_modes
([remake_fits])Load up the separate modes results into an astropy table.
Make a Dynesty-style results object that can be used in the nicer plotting codes.
load_mnest_results
([remake_fits])Load up the MultiNest results into an astropy table.
load_mnest_results_for_dynesty
([remake_fits])Make a Dynesty-style results object that can be used in the nicer plotting codes.
load_mnest_summary
([remake_fits])Load up the MultiNest results into an astropy table.
log_likely
(cube[, verbose])Compute a log-likelihood where there is a hyperparameter, alpha_k, that controls the weighting between each data k set.
Setup our prior distributions (i.e.
plot_dynesty_style
([sim_vals, fit_vals, ...])- Parameters
plot_model_and_data
(model[, input_model, ...])Make and save the model and data plots.
plot_model_and_data_modes
([def_best])Plots photometry data, along with n random draws from the posterior.
print_likelihood
([params, verbose])- Parameters
sample_post
(binmids, cdf, bininds)Randomly sample from a multinest posterior distribution.
Reads in the fits for the different modes (post_separate.dat) and splits it into a .dat file per mode.
solve
()Run a MultiNest fit to find the optimal parameters (and their posteriors) given the data.
Write a YAML file that contains the parameters to re-initialize this object, if desired.
Prior_copy
callback_plotter
check_data
dyn_log_likely
dyn_prior
get_best_fit_modes_model
get_model
get_modified_mag_err
log_likely_astrometry
log_likely_photometry
setup_params
summarize_results
summarize_results_modes
write_summary_maxL
- log_likely(cube, verbose=False)
Compute a log-likelihood where there is a hyperparameter, alpha_k, that controls the weighting between each data k set. This algorithm is described in Hobson et al. 2002.
Specifically, we are implementing Eq. 35.
- Parameters
- cubelist or dict
The dictionary or cube of the model parameters.
- hobson_weight_log_likely(ln_prob_dk_giv_ak_1)
Implement a data-set-specific weighting scheme by using a hyperparameter, alpha_k, for the kth data set as described in Hobson et al. 2002.
Specifically, we are implementing Eq. 16 and 23-27, with the prior described in Eq. 21.
We are not using the simplifications in Section 5 for now.
- get_hobson_effective_weights(cube)
Return the effective weights, alpha_k, for each data set. Photometry first, then astrometry.
- LogLikelihood(cube, ndim=None, n_params=None)
This is just a wrapper because PyMultinest requires passing in the ndim and nparams.
- Prior_from_post(cube, ndim=None, nparams=None)
Get the bin midpoints
- calc_best_fit(tab, smy, s_idx=0, def_best='maxl')
Returns best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If best-fit is median, then also return +/- 1 sigma uncertainties.
If best-fit is MAP, then also need to indicate which row of summary table to use. Default is s_idx = 0 (global solution). s_idx = 1, 2, … , n for the n different modes.
tab = self.load_mnest_results() smy = self.load_mnest_summary()
- calc_chi2(params='best', verbose=False)
- Parameters
- paramsstr or dict, optional
model_params = ‘best’ will load up the best solution and calculate the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- calc_chi2_manual(params='best', verbose=False)
- Parameters
- paramsstr or dict, optional
model_params = ‘best’ will load up the best solution and calculate the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- get_best_fit(def_best='maxl')
Returns best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If def_best is median, then also return +/- 1 sigma uncertainties.
- Returns
- Either a dicitonary or a tuple of length=2 holding
- two dictionaries, one for values and one for uncertainty ranges.
- See calc_best_fit() for details.
- get_best_fit_model(def_best='maxl')
Identify best-fit model
- Parameters
- def_beststr
Choices are ‘map’ (maximum a posteriori), ‘median’, or ‘maxl’ (maximum likelihood)
- get_best_fit_modes(def_best='maxl')
Returns a list of best-fit parameters, where best-fit can be median, maxl, or MAP. Default is maxl.
If def_best is median, then also return +/- 1 sigma uncertainties.
- Returns
- Either a list of dicitonaries or a list where each entry is
- a tuple of length=2 holding two dictionaries, one for values
- and one for uncertainty ranges.
- See calc_best_fit() for details.
- load_mnest_modes(remake_fits=False)
Load up the separate modes results into an astropy table.
- load_mnest_modes_results_for_dynesty(remake_fits=False)
Make a Dynesty-style results object that can be used in the nicer plotting codes.
- load_mnest_results(remake_fits=False)
Load up the MultiNest results into an astropy table.
- load_mnest_results_for_dynesty(remake_fits=False)
Make a Dynesty-style results object that can be used in the nicer plotting codes.
- load_mnest_summary(remake_fits=False)
Load up the MultiNest results into an astropy table.
- make_default_priors()
Setup our prior distributions (i.e. random samplers). We will draw from these in the Prior() function. We set them up in advance because they depend on properties of the data. Also, they can be over-written by custom priors as desired.
To make your own custom priors, use the make_gen() functions with different limits.
- plot_dynesty_style(sim_vals=None, fit_vals=None, remake_fits=False, dims=None, traceplot=True, cornerplot=True, kde=True)
- Parameters
- sim_valsdict
Dictionary of simulated input or comparison values to overplot on posteriors.
- fit_valsstr
Choices are ‘map’ (maximum a posteriori), ‘mean’, or ‘maxl’ (maximum likelihood)
- plot_model_and_data(model, input_model=None, mnest_results=None, suffix='', zoomx=None, zoomy=None, zoomy_res=None, fitter=None, N_traces=50)
Make and save the model and data plots.
zoomx, xoomy, zoomy_res : list the same length as self.n_phot_sets Each entry of the list is a list [a, b] cooresponding to the plot limits
- plot_model_and_data_modes(def_best='maxl')
Plots photometry data, along with n random draws from the posterior.
- print_likelihood(params='best', verbose=True)
- Parameters
- model_paramsstr or dict, optional
- model_params = ‘best’ will load up the best solution and calculate
the chi^2 based on those values. Alternatively, pass in a dictionary with the model parameters to use.
- sample_post(binmids, cdf, bininds)
Randomly sample from a multinest posterior distribution.
- Parameters
- Nparams:
number of parameters
- Nbins:
number of histogram bins per dimension
- Nnzero:
number of histogram bins with non-zero probability
- binmidslist of length N, each list entry is an array of shape (M, )
The centers of the bins for each parameter
- cdf(Nnzero, ) array
CDF of the distribution. Only the non-zero probability entries.
- bininds(Nnzero, Nparams) array
Histogram indices of the non-zero probability entries.
- separate_modes()
Reads in the fits for the different modes (post_separate.dat) and splits it into a .dat file per mode.
Is there a more intelligent way to deal with all the indices??? Write better later, but it seems to work for now…
- solve()
Run a MultiNest fit to find the optimal parameters (and their posteriors) given the data.
Note we will ALWAYS tell multinest to be verbose.
- write_params_yaml()
Write a YAML file that contains the parameters to re-initialize this object, if desired.
Prior Generators
- model_fitter.make_gen(min, max)
- model_fitter.make_norm_gen(mean, std)
- model_fitter.make_lognorm_gen(mean, std)
Make a natural-log normal distribution for a variable. The specified mean and std should be in the ln() space.
- model_fitter.make_log10norm_gen(mean_in_log10, std_in_log10)
Scale scipy lognorm from natural log to base 10. Note the mean and std should be in the log10() space already.
- Parameters
- mean:
mean of the underlying log10 gaussian (i.e. a log10 quantity)
- std:
variance of underlying log10 gaussian
- model_fitter.make_truncnorm_gen(mean, std, lo_cut, hi_cut)
lo_cut and hi_cut are in the units of sigma
- model_fitter.make_truncnorm_gen_with_bounds(mean, std, low_bound, hi_bound)
low_bound and hi_bound are in the same units as mean and std
- model_fitter.make_t0_gen(t, mag)
Get an approximate t0 search range by finding the brightest point and then searching days where flux is higher than 80% of this peak.
- model_fitter.make_mag_base_gen(mag)
Make a prior for baseline magnitude using the data.
- model_fitter.make_mag_src_gen(mag)
Make a prior for source magnitude using the data. Allow negative blending.
- model_fitter.make_xS0_gen(pos)
- model_fitter.make_xS0_norm_gen(pos)
- model_fitter.make_muS_EN_gen(t, pos, scale_factor=100.0)
Get an approximate muS search range by looking at the best fit straight line to the astrometry. Then allows lots of free space.
- Returns
- gen:
uniform generator for velocity in mas/yr
- model_fitter.make_muS_EN_norm_gen(t, pos, n_use=None, scale_factor=10.0)
Get an approximate muS search range by looking at the best fit straight line to the astrometry. Then allows lots of free space.
- Parameters
- t:
array of times in days
- pos:
array of positions in arcsec
- Returns
- gen:
uniform generator for velocity in mas/yr
- model_fitter.make_invgamma_gen(t_arr)
ADD DESCRIPTION
- Parameters
- t_arr:
time array
- model_fitter.compute_invgamma_params(t_arr)
- Based on function of same name from
Fran Bartolic’s
caustic
package: https://github.com/fbartolic/caustic | Returns parameters of an inverse gamma distribution s.t.1% of total prob. mass is assigned to values of \(t < t_{min}\) and
1% of total prob. masss to values greater than t_{tmax}.
t_{min} is defined to be the median spacing between consecutive data points in the time series and t_{max} is the total duration of the time series.
- Parameters
- t_arrarray
Array of times
- Returns
- invgamma_a, invgamma_bfloat (?)
The parameters a,b of the inverse gamma function.
- model_fitter.make_piS()
- model_fitter.make_fdfdt()
- model_fitter.random_prob(generator, x)
- model_fitter.weighted_quantile(values, quantiles, sample_weight=None, values_sorted=False, old_style=False)
Very close to numplt.percentile, but supports weights.
Parameters
- values:
numplt.array with data
- quantiles:
array-like with many quantiles needed
- sample_weight:
array-like of the same length as array
- values_sorted: bool,
if True, then will avoid sorting of initial array
- old_style:
if True, will correct output to be consistent with numplt.percentile.
- Returns
- arr:
numplt.array with computed quantiles.
Notes
Note
quantiles should be in [0, 1]!
- model_fitter.split_param_filter_index1(s)
Split a parameter name into the <string><number> components where <string> is the parameter name and <number> is the filter index (1-based). If there is no number at the end for a filter index, then return None for the second argument.
- Returns
- param_namestr
The name of the parameter.
- filt_indexint (or None)
The 1-based filter index.
- model_fitter.generate_params_dict(params, fitter_param_names)
Take a list, dictionary, or astropy Row of fit parameters and extra parameters and convert it into a well-formed dictionary that can be fed straight into a model object.
The output object will only contain parameters specified by name in fitter_param_names. Multi-filter photometry parameters are treated specially and grouped together into an array such as [‘mag_src’] = [mag_src1, mag_src2].
- Parameters
- paramslist, dict, Row
Contains values of parameters. Note that if the params are in a list, they need to be in the same order as fitter_param_names. If the params are in a dict or Row, then order is irrelevant.
- fitter_param_nameslist
The names of the parameters that will be delivered, in order, in the output.
- Returns
- params_dictdict
Dictionary of the parameter names and values.