-
Notifications
You must be signed in to change notification settings - Fork 21
coding_project
The aim of the coding project is to:
- familiarize yourself with git and GitHub workflows
- familiarize yourself with code documentation
- translate equations into code
- connect the different lensing quantities (convergence, deflection angles, lensing potential) and test their correspondances
- Understand object-oriented programing with classes, definitions, and inheritance
- understand unit testing
- meaningfully contribute to an established strong lensing software package
- improve documentation and usability of a software package
Upon completion of this project, you become a contributor to lenstronomy and will be added as a contributor for the next release version and publication.
You will be contributing to the lenstronomy software.
- Follow the contribution guidelines and make a new branch on your Github repository. If you are less familiar with GitHub, please read through the Basic Github usage wiki page.
I recommend you using an IDE (integrated development environment) or a dedicated code editor. Among the popular (with free student versions) are
Both these editors have automatic GitHub integrations. I recommend using them.
- Read about PEP8: https://peps.python.org/pep-0008/ . This is the official recommendation for writing Python code, which is very helpful when code is shared between collaborators.
2. Familiarize yourself with the lenstronomy lens model conventions and the unit tests that should guarantee reliability
- The BaseClass will be inherited and any individual profile must follow these same conventions.
- The Elliptical Power-law mass distribution (EPL) gives you an example of an implementation and documentation.
- The code needs to be tested. Look at the corresponding unit tests for the EPL model. The key is that these tests confirm something we know or we want to impose (i.e. against a simpler case, or a special case where the solution is analytically known).
- All lens models are tested such that the numerical derivatives correspond to the (often analytical) quantities. Take a look at the numerical derivative tests.
lenstronomy has routines to numerically integrate lensing convergence to compute deflection angles and lensing potentials. Familiarize yourself with the integration routines and the associated tests of the numerical profile integrals.
Pick two lensing profiles from the list of lens models (discuss it with the Professor to make sure it is feasible), go through the code and make sure you understand the code. Improve the documentation if necessary and make a pull request. The documentation should contain:
- Proper references to journal articles introducing these models
- Proper documentation strings for all definitions
- LateX formulae to be displayed in the html documentation.
Make edits on separate git branches for each lens model and make one pull request per lens model from the separate branch. Only one feature per pull request. The assignment is complete once you address all the review requests and the pull request is merged.
- Open a jupyter notebook
- Chose a lens model of your choice from the list available in lenstronomy
- Compute the convergence on a grid
- Perform the numerical integration to calculate the deflection angles and lensing potential
- Compare the results with the exact solution from lenstronomy. What could have caused the differences?
- Submit the jupyter notebook with good documentation and markdowns
Hint: Inspire yourself by the test routines of the convergence integrals.
Implement a new mass model in lenstronomy from the literature that has not been implemented yet. Make sure you follow the same guidelines and document and test the code.