The BAGLE Python Package for Bayesian Analysis of Gravitational Lensing Events
Authors:
- J. R. LuJLJ. R. Lu
- Michael MedfordMMMichael Medford
- Casey Y. LamCLCasey Y. Lam
- T. Dex BhadraTBT. Dex Bhadra
- Macy J. HustonMHMacy J. Huston
- Natasha S. AbramsNANatasha S. Abrams
- Edward BroadberryEBEdward Broadberry
- Jeff ChenJCJeff Chen
- Sean K. TerrySTSean K. Terry
- Nijaid ArredondoNANijaid Arredondo
- Andrew ScharfASAndrew Scharf
- Raphael A. P. OliveiraRORaphael A. P. Oliveira
Open Access
- 17 June 2026
- journal article
- Published by American Astronomical Society in The Astronomical Journal
- Vol. 172 (1) , 30
Abstract
We present the open-source Python package, Bayesian Analysis of Gravitational Lensing Events (BAGLE), which enables modeling and joint fitting of photometric and astrometric data sets. We describe the model parameterizations and present the equations for microlensing events containing either a point-source, point-lens, or a finite-source, point-lens geometry both with and without a microlensing parallax due to the motion of the Earth or a satellite around the Sun. Conversions between different coordinate reference frames are also derived. We compare our model lightcurves to those from other papers and microlens modeling software, finding good agreement, although with some differences in the finite-source models at the ∼1% level detectable with upcoming observations from space-based facilities. We also use BAGLE to demonstrate the impact of changing lens mass, lens distance, and blended source flux fraction on photometric lightcurves and astrometric trajectories in preparation for upcoming Gaia data releases and the launch of the Nancy Grace Roman Space Telescope (Roman) and its Galactic Bulge Time Domain Survey (GBTDS). In particular, we show that Roman GBTDS will detect significant microlensing parallax signals for events that are 2× shorter in duration than from ground-based surveys. Additionally, long-duration events with durations of t E,⊙ > 100 days will yield microlensing parallax uncertainties of σ π E < 0.01 with Roman, enabling confident identification of isolated stellar-mass black holes that can be modeled both astrometrically and photometrically with BAGLE for precise mass determinations. BAGLE is an open-source code and community development is encouraged.Keywords
All Related Versions
Funding Information
- National Science Foundation (2108185)
- Heising-Simons Foundation (2022-3542)
- Space Telescope Science Institute (HST-GO-17081.004-A)
- Space Telescope Science Institute (HST-GO-17081.004-A)
This publication has 50 references indexed in Scilit:
- VBMicroLensing : Three algorithms for multiple lensing with contour integrationAstronomy & Astrophysics, 2025
- RTModel: A platform for real-time modeling and massive analyses of microlensing eventsAstronomy & Astrophysics, 2024
- No massive black holes in the Milky Way haloNature, 2024
- SciPy 1.0: fundamental algorithms for scientific computing in PythonNature Methods, 2020
- Modeling microlensing events with MulensModelAstronomy and Computing, 2019
- X-ray spectral modelling of the AGN obscuring region in the CDFS: Bayesian model selection and catalogueAstronomy & Astrophysics, 2014
- Astropy: A community Python package for astronomyAstronomy & Astrophysics, 2013
- Astrometric microlensing with theGAIAsatelliteMonthly Notices of the Royal Astronomical Society, 2002
- Discovery of a planet orbiting a binary star system from gravitational microlensingNature, 1999
- Extended source effects in astrometric gravitational microlensingMonthly Notices of the Royal Astronomical Society, 1998