lightcurvelynx.effects.microlensing

An effect that adds microlensing magnification.

Classes

Microlensing

A simple microlensing effect that can be applied to basic models. For more

Module Contents

class Microlensing(microlensing_t0, u_0, t_E, probability=1.0, **kwargs)[source]

Bases: lightcurvelynx.effects.effect_model.EffectModel, citation_compass.CiteClass

A simple microlensing effect that can be applied to basic models. For more complex models, such as those blended by the microlensing event, it is recommended to create a new physical model.

This model is a pure Paczynski/point-source point-lens (PSPL) model, without any additional effects. They can be added later. At the moment no values are parametrized, but they can be in the future.

Values that should be parametrized are:

  • lens_mass (M_L)

  • lens_distance (D_L)

  • source_distance (D_S)

  • relative_proper_motion (mu_rel, mu_LS)

  • source_radius (R_S)

References

    1. Bozza, MNRAS 408 (2010) 2188: general algorithm for binary lensing;

  • V. Bozza, E. Bachelet, F. Bartolic, T. Heintz, A. Hoag, M. Hundertmark, MNRAS 479 (2018) 5157: BinaryMag2 function, Extended-Source-Point-Lens methods;

  • V. Bozza, E. Khalouei and E. Bachelet, MNRAS 505 (2021) 126: astrometry, generalized limb darkening, Keplerian orbital motion;

    1. Bozza, v. Saggese, G. Covone, P. Rota & J. Zhang, A&A 694 (2025) 219: multiple lenses.

VBM[source]

The microlensing model.

Type:

VBMicrolensing

Parameters:
  • microlensing_t0 (parameter) – The time of the microlensing peak, in days.

  • u_0 (parameter) – Impact parameter, distance from the source at time of peak in Einstein radii.

  • t_E (parameter) – Einstein timescale, in days.

  • probability (float, optional) – The probability of the microlensing event occurring. Default: 1.0

  • **kwargs (dict, optional) – Any additional keyword arguments.

VBM[source]
apply(flux_density, times=None, wavelengths=None, *, apply_microlensing=None, microlensing_t0=None, u_0=None, t_E=None, **kwargs)[source]

Apply the effect to observations (flux_density values).

Parameters:
  • flux_density (numpy.ndarray) – A length T X N matrix of flux density values (in nJy).

  • times (numpy.ndarray, optional) – A length T array of times (in MJD).

  • wavelengths (numpy.ndarray, optional) – A length N array of wavelengths (in angstroms). Not used for this effect.

  • apply_microlensing (bool) – Whether or not to apply microlensing.

  • microlensing_t0 (float) – The time of the microlensing peak, in days.

  • u_0 (float) – Impact parameter, distance from the source at time of peak in Einstein radii.

  • t_E (float) – Einstein timescale, in days.

  • **kwargs (dict, optional) – Any additional keyword arguments, including any additional parameters needed to apply the effect.

Returns:

flux_density – A length T x N matrix of flux densities after the effect is applied (in nJy).

Return type:

numpy.ndarray

apply_bandflux(bandfluxes, *, apply_microlensing=None, microlensing_t0=None, u_0=None, t_E=None, times=None, filters=None, **kwargs)[source]

Apply the effect to band fluxes.

Parameters:
  • bandfluxes (numpy.ndarray) – A length T array of band fluxes (in nJy).

  • times (numpy.ndarray, optional) – A length T array of times (in MJD).

  • filters (numpy.ndarray, optional) – A length N array of filters. If not provided, the effect is applied to all band fluxes.

  • apply_microlensing (bool) – Whether or not to apply microlensing.

  • microlensing_t0 (float) – The time of the microlensing peak, in days.

  • u_0 (float) – Impact parameter, distance from the source at time of peak in Einstein radii.

  • t_E (float) – Einstein timescale, in days.

  • **kwargs (dict, optional) – Any additional keyword arguments, including any additional parameters needed to apply the effect.

Returns:

bandfluxes – A length T array of band fluxes after the effect is applied (in nJy).

Return type:

numpy.ndarray