Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of a subset of lens/source/psf models #3

Merged
merged 58 commits into from
Mar 2, 2023

Conversation

JelleAalbers
Copy link
Collaborator

This will allow us to implement new lens, source, or psf models without slowing down existing calculations.

Currently, to avoid parallelism-breaking conditionals (if lensmodel is NFW, then...), jaxstronomy evaluates the effect of every possible lens/source/psf model on the image, then selects the right output using jax.lax.switch and the user-provided model_index.

This PR adds optional arguments to the image_simulation functions to specify the model lists in which the model_index lookups/switches occur. Lens light models obey the source_models argument, since lens light models are source models (maybe we should call them light models or light profiles instead).

Some new test code checks that you can change the order / amount of specified models for both lens, source, and PSF. The tests pass on my laptop GPU (assuming #2 is merged first; I can rebase if it helps you review).

JelleAalbers and others added 30 commits October 4, 2022 21:50
… nfw functions and the final translation to lenstronomy functions
…e dictionaries. Still needs to be tested and nfw functions need to be written.
… the input pipeline will need some major refactor moving forward
swagnercarena and others added 28 commits February 6, 2023 00:17
…xible configuration file. Found some major bugs in the fixed configuration that were likely leading to problems with detecting sigma_sub. train.py still need a rework
…running smoothly after running tests on gpus. Signal should be very strong of the substructure now, so hopefully training should be smooth.
…off of desired truth outputs, and made sure that truncation radius can never return 0.
…calculations. Should speed up image simulations meaningfully.
… Substructure draws are similar, but images produced are different.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants