Skip to content

Code for "Inferring subhalo effective density slopes from strong lensing observations with neural likelihood-ratio estimation"

License

Notifications You must be signed in to change notification settings

gemyxzhang/neural-subhalo-slope

Repository files navigation

Inferring subhalo effective density slopes from strong lensing observations with neural likelihood-ratio estimation

arXiv

Software dependencies

The code uses standard astropy, numpy and scipy packages. We use paltas and lenstronomy for data generation. These can be installed as follows:

pip install paltas lenstronomy 

We ran our analysis with Python 3.7.7 and Pytorch 1.11.0+cu102.

Code

To generate mock lensing images, use the following scripts (which have dependency on utils.py):

Note: if these scripts are run with slurm job arrays, then it is necessary to manually combine the gamma parameter files produced by the job arrays.

The likelihood-ratio estimator model class is in resnet.py. To train the model on generated images, run train.py with the specified parameters (which has dependecy on data_utils.py).

figures.ipynb contains code that produces the plots in 2208.13796.

About

Code for "Inferring subhalo effective density slopes from strong lensing observations with neural likelihood-ratio estimation"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published