A gravitational lensing software for modeling mass distribution of galaxies and clusters (strong and weak regime).

  • Credits: People who contribute on this project (in chronological order): Jean-Paul Kneib, Henri Bonnet, Ghyslain Golse, David Sand, Eric Jullo, Phil Marshall, Julien Zoubian, Mathilde Jauzac, Johan Richard, Benjamin ClĂ©ment, Tomas Verdugo, Soniya Sharma
  • Reference papers: Kneib et al 1996, Jullo et al 2007, Jullo & Kneib 2009

Software Download:

Note that you can also install CFITSIO, GSL, ZMQ, CPPZMQ and PGPLOT directly from your package manager. On Ubuntu, you can use the command apt-get from the command line.

Please, contact Eric Jullo (eric.jullo AT, if you want to provide a compiled version with another operating system. Compiled version have been compiled with option --disable-shared.

Software Install

cd lenstool

You can specify the location of cfitsio, wcslib, gsl, zmq and pgplot libraries using the configure options --with-X-include-path=DIR, --with-X-lib-path=DIR, where X stands for cfitsio, wcslib, gsl, zmq or pgplot. Since version 6.8, Histogram and Histogram2D tools are not anymore compiled by default. You need to specify the option --with-pgplot to compile them. These tools also depend on X11 development libraries and fortran compiler.

If you want to use the generalized NFW profile, you need to prepare the lookup table with this command

make table 

In your .bashrc, you must add the following lines

export LENSTOOL_DIR=<path to the directory of lenstool package>

or in your .cshrc,

setenv LENSTOOL_DIR <path to the directory of lenstool package>
  • For Mac Users, you need to previously install XCode and the Command Line Tools.
  • Since 2015, there are 2 libraries available for wcs: wcslib and wcstools. You need to take wcstools.
  • On Ubuntu, the package manager proposes libwcstools-dev. This package is not supported by Lenstool yet. Use the link above instead.


lenstool AT

To be added to the mailing list contact Jean-Paul Kneib: jean-paul.kneib AT

Lenstool documentation

  • LenstoolManual -- Lenstool On Line Manual becoming the reference (not fully complete yet)
  • lenstool.pdf -- Old manual, also available through the source code distribution
  • lenstool_dummies.pdf - A manual written by Mike "McCourt" a student discovering lenstool (Oct 2006).

Lenstool Papers

Papers using lenstool to model the mass distribution of massive clusters (not exhaustive)