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).

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.

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_amplification(t)

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).

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.

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_amplification(t)

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.

calc_piE_ecliptic()

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.

get_resolved_amplification(t)

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.

calc_piE_ecliptic()

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.

get_resolved_amplification(t)

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.

calc_piE_ecliptic()

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.

get_resolved_amplification(t)

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.

calc_piE_ecliptic()

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.

get_resolved_amplification(t)

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.

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.

calc_piE_ecliptic()

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.

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).

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.

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_resolved_amplification(t)

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).

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.

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_resolved_amplification(t)

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.

calc_piE_ecliptic()

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.

get_resolved_amplification(t)

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.

calc_piE_ecliptic()

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.

get_resolved_amplification(t)

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.

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.

calc_piE_ecliptic()

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.

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.