lenstronomy - gravitational lensing software package¶
lenstronomy is a multi-purpose package to model strong gravitational lenses. The software package is presented in
Birrer & Amara 2018 and is based on Birrer et al 2015.
lenstronomy finds application in e.g. Birrer et al 2016,
Birrer et al 2019, Shajib et al 2020 and
Birrer et al 2020 for time-delay cosmography and measuring
the expansion rate of the universe and Birrer et al 2017 and Gilman et al. 2020 for
quantifying lensing substructure to infer dark matter properties.
The development is coordinated on GitHub and contributions are welcome.
The documentation of
lenstronomy is available at readthedocs.org and
the package is distributed over PyPI.
lenstronomy is an affiliated package of astropy.
$ pip install lenstronomy --user
To run lens models with elliptical mass distributions, the fastell4py package, originally from Barkana (fastell), is also required and can be cloned from: https://github.com/sibirrer/fastell4py (needs a fortran compiler)
$ sudo apt-get install gfortran $ git clone https://github.com/sibirrer/fastell4py.git <desired location> $ cd <desired location> $ python setup.py install --user
Additional python libraries are e.g. :
- a variety of analytic lens model profiles
- various lensing computation tools (lens equation solver, ray-tracing etc)
- API to conveniently simulating mock lenses
- Extended source reconstruction with basis sets (shapelets)
- Model fitting and statistical inference tools with MPI and multi-threading support (Particle swarm optimization, emcee, MultiNest, DyPolyChord, or Dynesty) with MPI and multi-threading support
- integrated support for multi-lens plane and multi-source plane modelling
- Kinematic modelling (Jeans anisotropy models) of lens deflector galaxy
- Cosmographic inference tools
- …and much more
The starting guide jupyter notebook
leads through the main modules and design features of
lenstronomy. The modular design of
lenstronomy allows the
user to directly access a lot of tools and each module can also be used as stand-alone packages.
We have made an extension module available at https://github.com/sibirrer/lenstronomy_extensions. You can find simple examle notebooks for various cases. The latest versions of the notebooks should be compatible with the recent pip version of lenstronomy.
- Units, coordiante system and parameter definitions in lenstronomy
- FITS handling and extracting needed information from the data prior to modeling
- Modeling a simple Einstein ring
- Quadrupoly lensed quasar modelling
- Double lensed quasar modelling
- Time-delay cosmography
- Source reconstruction and deconvolution with Shapelets
- Solving the lens equation
- Measuring cosmic shear with Einstein rings
- Fitting of galaxy light profiles, like e.g. GALFIT
- Quasar-host galaxy decomposition
- Hiding and seeking a single subclump
- Mock generation of realistic images with substructure in the lens
- Mock simulation API with multi color models
- Catalogue data modeling of image positions, flux ratios and time delays
- Example of numerical ray-tracing and convolution options
Multiple affiliated packages that make use of lenstronomy can be found here (not complete) and further packages are under development by the community.
Mailing list and Slack channel¶
You can join the lenstronomy mailing list by signing up on the google groups page.
The email list is meant to provide a communication platform between users and developers. You can ask questions, and suggest new features. New releases will be announced via this mailing list.
If you encounter errors or problems with lenstronomy, please let us know!
Shapelet reconstruction demonstration movies¶
We provide some examples where a real galaxy has been lensed and then been reconstructed by a shapelet basis set.
The design concept of
lenstronomy are reported in Birrer & Amara 2018.
Please cite this paper when you use lenstronomy in a publication and link to https://github.com/sibirrer/lenstronomy.
Please also cite Birrer et al 2015
when you make use of the
lenstronomy work-flow or the Shapelet source reconstruction. Please make sure to cite also
the relevant work that was implemented in
lenstronomy, as described in the release paper.
- lenstronomy package
- Contributing to lenstronomy
- Mailing list
- Published work with lenstronomy
- Affiliated packages
- 0.0.1 (2018-01-09)
- 0.0.2 (2018-01-16)
- 0.0.6 (2018-01-29)
- 0.1.0 (2018-02-25)
- 0.1.1 (2018-03-05)
- 0.2.0 (2018-03-10)
- 0.2.1 (2018-03-19)
- 0.2.2 (2018-03-25)
- 0.2.8 (2018-05-31)
- 0.3.1 (2018-07-21)
- 0.3.3 (2018-08-21)
- 0.4.1-3 (2018-11-27)
- 0.5.0 (2019-1-30)
- 0.6.0 (2019-2-26)
- 0.7.0 (2019-4-13)
- 0.8.0 (2019-5-23)
- 0.8.1 (2019-5-23)
- 0.8.2 (2019-5-27)
- 0.9.0 (2019-7-06)
- 0.9.1 (2019-7-21)
- 0.9.2 (2019-8-29)
- 0.9.3 (2019-9-25)
- 1.0.0 (2019-9-25)
- 1.0.1 (2019-10-01)
- 1.1.0 (2019-11-5)
- 1.2.0 (2019-11-17)
- 1.2.4 (2020-01-02)
- 1.3.0 (2020-01-10)
- 1.4.0 (2020-03-26)
- 1.5.0 (2020-04-05)
- 1.5.1 (2020-06-20)
- 1.6.0 (2020-09-07)