FSPL(Finite-Source Point Lens) Models - NOT DONE YET… place holders

FSPL Classes

class model.FSPL

Bases: PSPL

Methods

animate(tE, time_steps, frame_time, name, ...)

Produces animation of microlensing event.

get_photometry(t_obs[, filt_idx, amp_arr, ...])

Get the photometry for each of the lensed source images.

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

get_chi2_photometry

get_lnL_constant

log_likely_photometry

log_likely_photometry_each

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.
takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positions
e.g: ( ((1,0), (0,1), (-1,0), (0,-1)) ) if n = 4 and radius = 1
Returns
source_pointsnumpy array

Returns an array of shape = [2, self.n_outline, len(time)]

get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)

Get the photometry for each of the lensed source images.

Parameters
t_obsarray_like

Array of times to model.

Other Parameters
———-
amp_arrarray_like

Amplifications of each individual image at each time, i.e. amp_arr.shape = (len(t_obs), number of images at each t_obs).

This will over-ride t_obs; but is more efficient when calculating both photometry and astrometry. If None, then just use t_obs.

Returns
mag_modelarray_like

Magnitude of the centroid at t_obs.

animate(tE, time_steps, frame_time, name, size, zoom, astrometry)

Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows

Parameters
tE:
number of einstein crossings times before/after the peak you want the animation to plot

e.g tE = 2 => graph will go from -2 tE to 2 tE

time_steps:

number of time steps before/after peak, so total number of time steps will be 2 times this value

frame_time:

times in ms of each frame in the animation

name: string

the animation will be saved as name.html

size: list

[horizontal, vertical] cm’s

zoom:

# of einstein radii plotted in vertical direction

class model.FSPL_PhotAstrom

Bases: FSPL, PSPL_PhotAstrom

Contains methods for model a PSPL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.

Attributes
Available class variables that should be defined.
t0
tE
u0_amp
u0_E
u0_N
beta
piE_E:

valid only if parallax model

piE_N:

valid only if parallax model

piE_amp
mL
thetaE_amp
thetaE_E
thetaE_N
xS0_E
xS0_N
xL0_E
xL0_N
muS_E
muS_N
muL_E
muL_N
muRel_E
muRel_N
muRel_amp
piS
piL
dL
dS
dL_dS (dL over dS)
radius
n
b_sff[#]
mag_src[#] – add in
mag_base[#] – add in
raL:

if parallax model

decL:

if parallax model

Methods

animate(tE, time_steps, frame_time, name, ...)

Produces animation of microlensing event.

get_astrometry_unlensed(t)

Outputs position of source unlensed.

get_lens_astrometry(t_obs)

get_photometry(t_obs[, filt_idx, amp_arr, ...])

Get the photometry for each of the lensed source images.

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

get_chi2_astrometry

get_chi2_photometry

get_lnL_constant

get_resolved_astrometry

log_likely_astrometry

log_likely_astrometry_each

log_likely_photometry

log_likely_photometry_each

get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)

Get the photometry for each of the lensed source images.

Parameters
t_obsarray_like

Array of times to model.

Other Parameters
———-
amp_arrarray_like

Amplifications of each individual image at each time, i.e. amp_arr.shape = (len(t_obs), number of images at each t_obs).

This will over-ride t_obs; but is more efficient when calculating both photometry and astrometry. If None, then just use t_obs.

Returns
mag_modelarray_like

Magnitude of the centroid at t_obs.

animate(tE, time_steps, frame_time, name, size, zoom, astrometry)

Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows

Parameters
tE:
number of einstein crossings times before/after the peak you want the animation to plot

e.g tE = 2 => graph will go from -2 tE to 2 tE

time_steps:

number of time steps before/after peak, so total number of time steps will be 2 times this value

frame_time:

times in ms of each frame in the animation

name: string

the animation will be saved as name.html

size: list

[horizontal, vertical] cm’s

zoom:

# of einstein radii plotted in vertical direction

get_astrometry_unlensed(t)

Outputs position of source unlensed.

Input a list of times and it will output the position of the source had it not been lensed at each of the times in the list

e.g if n = 4, and say v = [1,0] & the times are [0,1,2] in years.
This will return
((( (1,0),(0,1),(-1,0),(0,-1) ), ( (2,0),(1,1),(0,0),(1,-1) ), ( (3,0),(2,1),(1,0),(2,-1) ))...
= (positions at t=0), (positions at t=1), (positions at t=2)

so np.array(positions) is an array which contains an array for each time step with the positions of all the points on the boundary of the source.

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.
takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positions
e.g: ( ((1,0), (0,1), (-1,0), (0,-1)) ) if n = 4 and radius = 1
Returns
source_pointsnumpy array

Returns an array of shape = [2, self.n_outline, len(time)]

class model.FSPL_noParallax

Bases: PSPL_noParallax

Methods

get_amplification(t)

noParallax: Get the photometric amplification term at a set of times, t.

get_astrometry(t_obs[, ast_filt_idx])

noParallax: Position of the observed source position in arcsec.

get_astrometry_unlensed(t_obs)

noParallax: Get the astrometry of the source if the lens didn't exist.

get_centroid_shift(t)

noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_lens_astrometry(t_obs)

Equation of motion for just the foreground lens.

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

Get the x, y astrometry for each of the two source images, which we label plus and minus.

calc_piE_ecliptic

get_amplification(t)

noParallax: Get the photometric amplification term at a set of times, t.

Parameters
t:

Array of times in MJD.DDD

get_astrometry(t_obs, ast_filt_idx=0)

noParallax: Position of the observed source position in arcsec.

get_astrometry_unlensed(t_obs)

noParallax: Get the astrometry of the source if the lens didn’t exist.

Returns
xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2

The unlensed positions of the source in arcseconds.

get_centroid_shift(t)

noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_lens_astrometry(t_obs)

Equation of motion for just the foreground lens.

Parameters
t_obsarray_like

Time (in MJD).

get_resolved_amplification(t)

Get the photometric amplification term at a set of times, t for both the plus and minus images.

Parameters
t:

Array of times in MJD.DDD

get_resolved_astrometry(t_obs)

Get the x, y astrometry for each of the two source images, which we label plus and minus.

Returns
[xS_plus, xS_minus]list of numpy arrays
  • xS_plus is the vector position of the plus image in arcsec

  • xS_minus is the vector position of the plus image in arcsec

class model.FSPL_Parallax

Bases: PSPL_Parallax

Methods

calc_piE_ecliptic()

Parallax: Get piE_ecliptic

get_amplification(t)

Parallax: Get the photometric amplification term at a set of times, t.

get_astrometry(t_obs[, ast_filt_idx])

Parallax: Get astrometry

get_astrometry_unlensed(t_obs)

Get the astrometry of the source if the lens didn't exist.

get_centroid_shift(t[, ast_filt_idx])

Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_geoproj_ast_params(t0par)

get_geoproj_params(t0par)

get_lens_astrometry(t_obs)

Parallax: Get lens astrometry

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

Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.

start

calc_piE_ecliptic()

Parallax: Get piE_ecliptic

get_amplification(t)

Parallax: Get the photometric amplification term at a set of times, t.

Parameters
t:

Array of times in MJD.DDD

get_astrometry(t_obs, ast_filt_idx=0)

Parallax: Get astrometry

get_astrometry_unlensed(t_obs)

Get the astrometry of the source if the lens didn’t exist.

Returns
xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2

The unlensed positions of the source in arcseconds.

get_centroid_shift(t, ast_filt_idx=0)

Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_lens_astrometry(t_obs)

Parallax: Get lens astrometry

get_resolved_amplification(t)

Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.

Parameters
t:

Array of times in MJD.DDD

get_resolved_astrometry(t_obs)

Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.

Returns
[xS_plus, xS_minus]list of numpy arrays
  • xS_plus is the vector position of the plus image.

  • xS_minus is the vector position of the plus image.

class model.FSPL_PhotAstromParam1(mL, t0, beta, dL, dS, xS0_E, xS0_N, muL_E, muL_N, muS_E, muS_N, radius, b_sff, mag_src, n_outline=10, raL=None, decL=None)

Bases: PSPL_Param

PSPL model for astrometry and photometry - physical parameterization.

A Point Source Point Lens model for microlensing. This model uses a parameterization that depends on only physical quantities such as the lens mass and positions and proper motions of both the lens and source.

Note the attributes, RA (raL) and Dec (decL) are required if you are calculating a model with parallax.

Parameters
mL: float

Mass of the lens (Msun)

t0: float

Time of photometric peak, as seen from Earth (MJD.DDD)

beta: float

Angular distance between the lens and source on the plane of the sky (mas). Can be

  • positive (u0_amp > 0 when u0_hat[0] (East component) < 0) or

  • negative (u0_amp < 0 when u0_hat[0] (East component) > 0).

dL: float

Distance from the observer to the lens (pc)

dL_dS: float

Ratio of Distance from the obersver to the lens to Distance from the observer to the source

xS0_E: float

RA Source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.

xS0_N: float

Dec source position on sky at t = t0 (arcsec) in an arbitrary ref. frame.

muL_E: float

RA Lens proper motion (mas/yr)

muL_N: float

Dec Lens proper motion (mas/yr)

muS_E: float

RA Source proper motion (mas/yr)

muS_N: float

Dec Source proper motion (mas/yr)

radius: float

Projected radius of the star in arcsec on the sky plane.

b_sff: float

The ratio of the source flux to the total (source + neighbors + lens) \(b_sff = f_S / (f_S + f_L + f_N)\). This must be passed in as a list or array, with one entry for each photometric filter.

mag_src: float

Photometric magnitude of the source. This must be passed in as a list or array, with one entry for each photometric filter.

n_outline: int

Number of boundary points to use when approximating the source outline. Calculation time scales approximately linearly with ‘n_outline’.

raL: float, optional

Right ascension of the lens in decimal degrees.

decL: float, optional

Declination of the lens in decimal degrees.

class model.FSPL_PhotAstrom

Bases: FSPL, PSPL_PhotAstrom

Contains methods for model a PSPL photometry + astrometry. This is a Data-type class in our hierarchy. It is abstract and should not be instantiated.

Attributes
Available class variables that should be defined.
t0
tE
u0_amp
u0_E
u0_N
beta
piE_E:

valid only if parallax model

piE_N:

valid only if parallax model

piE_amp
mL
thetaE_amp
thetaE_E
thetaE_N
xS0_E
xS0_N
xL0_E
xL0_N
muS_E
muS_N
muL_E
muL_N
muRel_E
muRel_N
muRel_amp
piS
piL
dL
dS
dL_dS (dL over dS)
radius
n
b_sff[#]
mag_src[#] – add in
mag_base[#] – add in
raL:

if parallax model

decL:

if parallax model

Methods

animate(tE, time_steps, frame_time, name, ...)

Produces animation of microlensing event.

get_astrometry_unlensed(t)

Outputs position of source unlensed.

get_lens_astrometry(t_obs)

get_photometry(t_obs[, filt_idx, amp_arr, ...])

Get the photometry for each of the lensed source images.

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

get_chi2_astrometry

get_chi2_photometry

get_lnL_constant

get_resolved_astrometry

log_likely_astrometry

log_likely_astrometry_each

log_likely_photometry

log_likely_photometry_each

get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)

Get the photometry for each of the lensed source images.

Parameters
t_obsarray_like

Array of times to model.

Other Parameters
———-
amp_arrarray_like

Amplifications of each individual image at each time, i.e. amp_arr.shape = (len(t_obs), number of images at each t_obs).

This will over-ride t_obs; but is more efficient when calculating both photometry and astrometry. If None, then just use t_obs.

Returns
mag_modelarray_like

Magnitude of the centroid at t_obs.

animate(tE, time_steps, frame_time, name, size, zoom, astrometry)

Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows

Parameters
tE:
number of einstein crossings times before/after the peak you want the animation to plot

e.g tE = 2 => graph will go from -2 tE to 2 tE

time_steps:

number of time steps before/after peak, so total number of time steps will be 2 times this value

frame_time:

times in ms of each frame in the animation

name: string

the animation will be saved as name.html

size: list

[horizontal, vertical] cm’s

zoom:

# of einstein radii plotted in vertical direction

get_astrometry_unlensed(t)

Outputs position of source unlensed.

Input a list of times and it will output the position of the source had it not been lensed at each of the times in the list

e.g if n = 4, and say v = [1,0] & the times are [0,1,2] in years.
This will return
((( (1,0),(0,1),(-1,0),(0,-1) ), ( (2,0),(1,1),(0,0),(1,-1) ), ( (3,0),(2,1),(1,0),(2,-1) ))...
= (positions at t=0), (positions at t=1), (positions at t=2)

so np.array(positions) is an array which contains an array for each time step with the positions of all the points on the boundary of the source.

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.
takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positions
e.g: ( ((1,0), (0,1), (-1,0), (0,-1)) ) if n = 4 and radius = 1
Returns
source_pointsnumpy array

Returns an array of shape = [2, self.n_outline, len(time)]

FSPL Limb Classes

class model.FSPL_Limb

Bases: FSPL

Methods

animate(crossings, time_steps, frame_time, ...)

Produces animation of microlensing event.

get_photometry(t_obs[, filt_idx, amp_arr, ...])

Get the photometry for each of the lensed source images.

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

F

get_amplification

get_chi2_photometry

get_lnL_constant

log_likely_photometry

log_likely_photometry_each

get_photometry(t_obs, filt_idx=0, amp_arr=None, print_warning=True)

Get the photometry for each of the lensed source images.

Parameters
t_obsarray_like

Array of times to model.

Returns
mag_modelarray_like

Magnitude of the centroid at t_obs.

animate(crossings, time_steps, frame_time, name, size, zoom)

Produces animation of microlensing event. This function takes the PSPL and makes an animation, the input variables are as follows

Parameters
tE:
number of einstein crossings times before/after the peak you want the animation to plot

e.g tE = 2 => graph will go from -2 tE to 2 tE

time_steps:

number of time steps before/after peak, so total number of time steps will be 2 times this value

frame_time:

times in ms of each frame in the animation

name: string

the animation will be saved as name.html

size: list

[horizontal, vertical] cm’s

zoom:

# of einstein radii plotted in vertical direction

get_source_outline_astrometry(r, n, center)

Return astrometric points that outline the outer circumference of the source star.

The outline is described as a circle of radius self.radius and is evaluated at self.n_outline number of points.
takes in the radius of the circle, centre position and number of points we are approximating the circle by and returns a numpy array of positions
e.g: ( ((1,0), (0,1), (-1,0), (0,-1)) ) if n = 4 and radius = 1
Returns
source_pointsnumpy array

Returns an array of shape = [2, self.n_outline, len(time)]

class model.FSPL_Limb_noParallax

Bases: FSPL_noParallax

Methods

get_amplification(t)

noParallax: Get the photometric amplification term at a set of times, t.

get_astrometry(t_obs[, ast_filt_idx])

noParallax: Position of the observed source position in arcsec.

get_astrometry_unlensed(t_obs)

noParallax: Get the astrometry of the source if the lens didn't exist.

get_centroid_shift(t)

noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_lens_astrometry(t_obs)

Equation of motion for just the foreground lens.

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

Get the x, y astrometry for each of the two source images, which we label plus and minus.

calc_piE_ecliptic

get_amplification(t)

noParallax: Get the photometric amplification term at a set of times, t.

Parameters
t:

Array of times in MJD.DDD

get_astrometry(t_obs, ast_filt_idx=0)

noParallax: Position of the observed source position in arcsec.

get_astrometry_unlensed(t_obs)

noParallax: Get the astrometry of the source if the lens didn’t exist.

Returns
xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2

The unlensed positions of the source in arcseconds.

get_centroid_shift(t)

noParallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_lens_astrometry(t_obs)

Equation of motion for just the foreground lens.

Parameters
t_obsarray_like

Time (in MJD).

get_resolved_amplification(t)

Get the photometric amplification term at a set of times, t for both the plus and minus images.

Parameters
t:

Array of times in MJD.DDD

get_resolved_astrometry(t_obs)

Get the x, y astrometry for each of the two source images, which we label plus and minus.

Returns
[xS_plus, xS_minus]list of numpy arrays
  • xS_plus is the vector position of the plus image in arcsec

  • xS_minus is the vector position of the plus image in arcsec

class model.FSPL_Limb_Parallax

Bases: FSPL_Parallax

Methods

calc_piE_ecliptic()

Parallax: Get piE_ecliptic

get_amplification(t)

Parallax: Get the photometric amplification term at a set of times, t.

get_astrometry(t_obs[, ast_filt_idx])

Parallax: Get astrometry

get_astrometry_unlensed(t_obs)

Get the astrometry of the source if the lens didn't exist.

get_centroid_shift(t[, ast_filt_idx])

Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_geoproj_ast_params(t0par)

get_geoproj_params(t0par)

get_lens_astrometry(t_obs)

Parallax: Get lens astrometry

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

Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.

start

calc_piE_ecliptic()

Parallax: Get piE_ecliptic

get_amplification(t)

Parallax: Get the photometric amplification term at a set of times, t.

Parameters
t:

Array of times in MJD.DDD

get_astrometry(t_obs, ast_filt_idx=0)

Parallax: Get astrometry

get_astrometry_unlensed(t_obs)

Get the astrometry of the source if the lens didn’t exist.

Returns
xS_unlensednumpy array, dtype=float, shape = len(t_obs) x 2

The unlensed positions of the source in arcseconds.

get_centroid_shift(t, ast_filt_idx=0)

Parallax: Get the centroid shift (in mas) for a list of observation times (in MJD).

get_lens_astrometry(t_obs)

Parallax: Get lens astrometry

get_resolved_amplification(t)

Parallax: Get the photometric amplification term at a set of times, t for both the plus and minus images.

Parameters
t:

Array of times in MJD.DDD

get_resolved_astrometry(t_obs)

Parallax: Get the x, y astrometry for each of the two source images, which we label plus and minus.

Returns
[xS_plus, xS_minus]list of numpy arrays
  • xS_plus is the vector position of the plus image.

  • xS_minus is the vector position of the plus image.

class model.FSPL_Limb_PhotAstromParam1(lens_mass, t0, xS0, beta, muL, muS, dL, dS, n, radius, utilde, nr, mag_src)

Bases: PSPL_Param