GRALE is a library to model gravitational lenses and invert gravitational lens systems based on the observed images. It is written in C++ and is primarily intended to be used on a unix-like system (Linux, OS X, ...) but should work (in a limited way) on MS-Windows systems as well. The CMake build system is used to create the library. Also available is the program GRALESHELL, which is an interactive environment that provides easy access to many procedures of the GRALE library.


The following articles involve the use of GRALE:

  1. The behaviour of dark matter associated with four bright cluster galaxies in the 10 kpc core of Abell 3827
  2. Lensing time delays as a substructure constraint: a case study with the cluster SDSS J1004+4112
  3. Mass-Galaxy offsets in Abell 3827, 2218 and 1689: intrinsic properties or line-of-sight substructures?
  4. Lensing degeneracies and mass substructure
  5. Strong-Lensing Analysis of MS 1358.4+6245: New Multiple Images and Implications for the Well-Resolved z=4.92 Galaxy
  6. Full Lensing Analysis of Abell 1703: Comparison of Independent Lens-Modelling Techniques
  7. Non-parametric strong lens inversion of SDSS J1004+4112
  8. The search for dark matter via strong lens inversions of galaxy clusters using genetic algorithms
  9. Non-parametric strong lens inversion of Cl 0024+1654: illustrating the monopole degeneracy
  10. A generalisation of the mass-sheet degeneracy producing ring-like artefacts in the lens mass distribution
  11. Non-parametric inversion of gravitational lensing systems with few images using a multi-objective genetic algorithm
  12. A genetic algorithm for the non-parametric inversion of strong lensing systems


To be able to build GRALE and GRALESHELL, you need to have GSL, the GNU Scientific Library, installed. Having Qt installed may also be useful (creating PNG files, having a nicer user interface). To speed up certain calculations, having an MPI implementation available or having an OpenCL library installed is useful.

Not absolutely required, but definitely recommended (not for the MS-Windows platform) is CFITSIO

To compile GRALE and GRALESHELL, several other libraries need to be installed (in this order):

Afterwards, you should first compile GRALE, and then GRALESHELL. Below you can find the links to the source code.



GRALE Lens inversion modules

Note that these have never been used or tested in an MS-Windows environment, so I'm not sure if they'll work that way.

Here are some lens inversion examples. The README file and the comments in the individual files explain what's being done:


This is a small application I once wrote to demonstrate the gravitational lens effect:


The source code (depends on GRALE):

A precompiled MS-Windows version (32 bit):

This contains both a version that simply uses the CPU to perform its calculations, and a version that uses OpenCL. The last one will need an installed version of OpenCL.dll. Note that it has only been tested with NVidia GPUs.


This is a tool to help create input for lens inversions. You can load FITS files, even overlay a color image if you like, select points in different images, create null space maps, add time delay info, etc. No documentation currently, so mail me if you'd like to use this and can't figure out how.


The source code (depends on GRALE):

Some screencasts which show how to use the program, and documents describing what happens:

  1. graleeditor_backgrounds.m4v - graleeditor_backgrounds.txt
  2. graleeditor_imagepoints.m4v - graleeditor_imagepoints.txt


This is another (older) tool to help create input for lens inversions. The main idea here is that you also get to see a backprojected version of an image, which may make it easier to identify corresponding features in images. No documentation currently, so mail me if you'd like to use this and can't figure out how.


The source code (depends on GRALE):


Doxygen based documentation is included in both the GRALE and GRALESHELL packages. At this moment, unfortunately the documentation of GRALE itself is far from complete. The documentation of GRALESHELL will probably be of more use and can also be found on-line:

