Galaxy-galaxy strong lensing simualtion package. Assuming all lenses are axis-symmetric, whose mass density profiles can be modelled by a gnfw+Sersic model.
Get the code from GitHub:
git clone https://github.com/fatginger1024/SLens.git
Then inside SLens run:
python setup.py install
Alternatively, if you do not wish to install SLens, you can also download/clone it as stated above, and then make sure to add it to your PYTHONPATH by:
export PYTHONPATH="/path_to_SLens/"
- numpy>=1.21.4
- scipy>=1.7.1
- astropy>=3.2.2
- tqdm>=4.36.1
To test whether SLens is successfully installed and is properly functioning, you can run the following test code:
from SLens import analyser
method = analyser()
out = method.get_cross_section()
You should get something similar to:
>>> out
(1.1643534724004403, 1.4196481784612613, 2.2720335055294467, -0.7272314003782123, 2.0619025821969736, 0.43005470946638896)(1.1643534724004403, 1.4196481784612613, 2.2720335055294467, -0.7272314003782123, 2.0619025821969736, 0.43005470946638896)
Lens galaxy catalogue:
Crocce, M., Castander, F. J., Gaztañaga, E., Fosalba, P., & Carretero, J. 2015, MNRAS, 453, 1513
Source galaxy cataglogue:
Laigle, C., McCracken, H. J., Ilbert, O., et al. 2016, ApJS, 224, 24
- gNFW:
refer: Resolving the Central Density Profile of Dark Matter Halos Gravitational Lensing Statistics by Masamune Oguri, section E.1.5
- Sersic:
refer: Sonnenfeld, A. & Cautun, M. 2021, A&A, 651, A18 section 3.1
- concentration:
Ludlow, A. D., Bose, S., Angulo, R. E., et al. 2016, MNRAS, 460, 1214 appendix c
- mass-size:
Sonnenfeld, A., Wang, W., & Bahcall, N. 2019, A&A, 622, A30 section 3.1
- angular diamter distance:
Hogg, David W. "Distance measures in cosmology." arXiv preprint astro-ph/9905116 (1999). section 6
One can analyse the lens statistics using the lens_statistics
module as provided in the tutorials.
The lens statistics (as functions of the dimensionless radial coordiate ) are:
- : the projected mass density;
- : the deflection angle;
- : the lens equation, which describes the mapping from the lens plane to the source plane ;
- : the convergence, which describes the magnification of the image by increasing its size;
- : the shear, which describes the how much the shape of the image is changed tangentially.
Below is an example of how changing the source radial position would impact the image position(s). When the source is outiside of the radial caustic, there is one image generated on the image plane; when it crosses the caustic, there would be three images. On its way of moving radially inwards, the magnification(s) of the images increase.
By means of the deflection angle equation we could find the positions of the images, given the source position. Below gives an axample of find ing the image positions.
We define a lens to be a strong lens if it generates at least two images with apparent magnitude greater than a threshold (26.3).
This is only a rudimentary guide to strong lensing simulation, for more information please feel free to contact the author (Qing Zhou) via email.
This code is licensed under the MIT license and is intended for academic research.