Skip to content

modeling_project

Simon Birrer edited this page Jan 8, 2025 · 1 revision

lens modeling

This project aims to:

  • familiarize with astronomical imaging data products
  • learn how to reconstruct the lensing distortions from a given observed image
  • Perform posterior inference for meaningful statistical interpretations

The project is a derivative of the lens modeling tutorial by A. Shajib.

The final product of this project is a Jupyer notebook presenting the modeling of a real lens observed by the Hubble Space Telescope.

Modeling a mock lens

  1. Check out the notebook "Fitting a lens model by hand.ipynb" and try to develop an intuition for how different parameters involved in a lensing system can change the look of the system. Create a perfectly round Einstein ring by appropriately choosing the slider values in the section “Simulating a lens system.” In the section “Demonstration of lens modeling by tuning parameters by hand”, try to achieve a reduced $\chi^2$ as close to 1 as possible. If you want to look at the right answers, they’re given here.
  2. Work with the notebook "Intro to lens modeling with lenstornomy.ipynb". Fit the lensing system given to you. The fitting is done well when you get a reduced $\chi^2$ very close to 1.
  3. Understand everything that is being done in the notebook. (It’s fine to not fully understand kwargs_likelihood and kwargs_numerics at this point.)
  4. Run an MCMC after the PSO (Particle Swarm Optimization). Ensure that the MCMC chain has converged. Obtain the best-fit values and uncertainties for $\theta_{\rm E}$ and $\gamma$.

Modeling a real Hubble Space Telescope image

Get the lens imaging data in ‘.h5’ format. Also, get the ‘psf.h5’ file from this same folder. You have to model the lens system with lenstronomy in a Jupyter notebook (following the structure of "Intro to lens modeling with lenstornomy.ipynb"). The notebook must show the model decomposition plots as in the "Intro to lens modeling with lenstornomy.ipynb" notebook. Your notebook may only run PSO and running MCMC is not required.

Now, here are some directions for you to do the lens modeling.

  1. State your name and the people you got help from for this assignment at the top of the notebook in a Markdown cell.
  2. Check the notebook "Loading data from h5 files.ipynb" to see how to read the HDF5 files.
  3. Make sure the appropriate PSF is being provided to lenstronomy through kwargs_psf.
  4. You need to add external shear to the lens_model_list with the profile name ‘SHEAR’. The free parameters in this profile are: ‘gamma1’ and ‘gamma2’, and the fixed parameters are ‘ra_0’: 0, ‘dec_0’: 0. The upper and lower values for ‘gamma1’ and ‘gamma2’ are 0.3 and -0.3. (lenstronomy documentation)
  5. You need to add the ‘SHAPELETS’ light profile to the source_model_list. The free parameters are ‘beta’, ‘center_x’, and ‘center_y’. But, ‘center_x’ and ‘center_y’ need to be joined with the ‘center_x’ and ‘center_y’ of the Sersic light profile in the source_model_list. The fixed parameter is ‘n_max’, you can try values between 4 and 6 for the fixed value of ‘n_max’. (lenstronomy documentation: https://lenstronomy.readthedocs.io/en/latest/lenstronomy.LightModel.Profiles.html#module-lenstronomy.LightModel.Profiles.shapelets)

If useful, you may try to get help from this tutorial notebook on lens modeling with lenstronomy: modeling_a_simple_Einstein_ring.

  • Try to modify the existing notebook on the BDLensing repository. What choices can be made differently? Will this affect the lens model inference?
  • Discuss how similar/different your lens model is compared to Rafee et al..