# GRAVLENS - Software for Gravitational Lensing

## by Chuck Keeton for the CASTLES project Version 1.99k, 16 Aug 2008

Now there is a tutorial with sample calculations done both analytically and with gravlens.

### Software

The code comes packaged in a Unix "gzipped tar" file called gravlens.tar.gz. To extract the files, give the commands:

gzip -vd gravlens.tar.gz
tar -xvf gravlens.tar

The package contains two executables:
• gravlens: A code to perform many basic lensing calculations
• lensmodel: A code for modeling observed lens systems; contains all the capabilities of gravlens, plus commands to handle many common modeling situations
The table below contains files for different computer architectures. Note that darwin is the version of Unix on which Mac OS X is built, so choose this architecture if you are running on a Macintosh.

Disclaimer: In general, I believe that the code works correctly. It has been used for several years by different people for different applications, and we have not uncovered any fundamental errors. Nevertheless, I make no guarantee of its accuracy. I encourage you to perform your own tests, and to watch out for results that do not make sense.

Note: I have had reports that the code may behave erratically on alpha machines, perhaps because the compilers are not well supported. If you have any questions or comments about running on alphas, please let me know.

 Version Date Architecture Documentation Updates Comments 1.99 Click here for the latest updates. 1.07 11 Aug 2005 solaris linux darwin Added plotpot and changevary commands. Added mode 4 to kapgam command. Added oversampling to SBmap1 and SBmap2; also added uniform source to SBmap2. Added ability to handle tab-delimited files. Modified findimg commands to report time delays. Revised lensmodel's handling of time delays: it previously assumed that all delays were referenced to the global leading image; now it accepts the delay(s) between any combination of images. Modified lensmodel to allow negative values of parameter p[4] for the mpole model. 1.06 9 Jan 2004 solaris linux darwin manual (ps, pdf) catalog (ps, pdf) Added autogrid, plotkappa, SBmap1, SBmap2, findimg2, and findimg3 commands; added jaffe, nfwpot, and fourmode model classes; modified nfwcusp model class to use a fitting formula for the case $\gamma=1.5$; modified mock1 and mock2 commands to add more capabilities; made small changes to plotdef0 command and convrg model class. 1.05 10 Feb 2003 solaris linux darwin manual, catalog Added magtensor, mock1, and mock2 commands; added maxshear and NGALMAX variables; improved use of chiperpoint variable; updated normalization of cusp model; added monopole, mpole, and intshr models for multipole series; also added boxypot model. 1.04 4 June 2002 solaris linux manual, catalog Added alphapot and nuker models; added calcRein command; added vertmode variable; fixed a small bug in the use of omitcore; added more precision to devauc models; fixed a typo in the manual in the equations for softened power law models. 1.03 7 Aug 2001 solaris linux alpha manual, catalog Added elliptical versions of nfwcusp models; extended cusp models to handle n=3; added version command; upgraded curve fitting algorithm to handle multiple families of curves (see manual p. 58). Note that the curve fitting algorithm is likely to change further; contact me for more information. 1.01, 1.02 11 July 2001 solaris linux alpha manual Small additions, including clus3 models and the verbose variable; minor internal tweakings. 1.0 14 Feb 2001 First general release.

### Documentation

There are several pieces of documentation. A paper describes the conceptual foundation of the code, presenting a fully general algorithm for solving the lens equation and a discussion of strategies for modeling strong lenses. A separate paper offers a catalog of mass models for lensing, with a review of all known analytic results for those models. A manual gives detailed information about running the software.

This written documentation is now out of date; I hope to switch to wiki-based documentation soon.

• Paper: astro-ph/0102340
• Catalog of mass models: get the latest version in the table above. The original version can also be found archived at astro-ph/0102341.
• Manual: get the latest version in the table above.

In addition, there are two online tutorials:

• Tutorial 1. Presents sample calculations done both analytically and with gravlens.
• Tutorial 2. Presents a more extensive set of examples with gravlens and lensmodel.

### Contact

Questions and comments are encouraged. Send me email: keeton at physics.rutgers.edu