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

GNFW does not have potential implemented #466

Open
jhod0 opened this issue May 5, 2023 · 4 comments
Open

GNFW does not have potential implemented #466

jhod0 opened this issue May 5, 2023 · 4 comments

Comments

@jhod0
Copy link
Contributor

jhod0 commented May 5, 2023

Hello - an undergrad I'm working with has run into a problem trying to run the lens equation solver with a generalized NFW profile. It fails saying that the GNFW profile has no potential implemented.

There's a comment in the docs so it looks like you're aware of it!

TODO: implement the gravitational potential for this profile

Is the problem just that it hasn't been implemented, or is there no analytic solution for it? If it's the former, I would be happy to help implement it 😄

@sibirrer
Copy link
Collaborator

sibirrer commented May 6, 2023

Hi @jhod0,
to my knowledge, there is no analytical solution to it, and hence this was left as 'TODO'. There could be different approaches here, either use a numerical integration (there might be examples of other profiles), or use a multi gaussian expansion (MGE), or even an expansion with CSE (cored steep ellipse) profiles. The latter can be implemented as a 'SYNTHESIS' profile and has been done by @mattgomer . See e.g. these test functions: https://github.com/lenstronomy/lenstronomy/blob/main/test/test_LensModel/test_Profiles/test_synthesis.py
Perhaps @dangilman has another solution for it in pyhalo as well. Just tagging them here.

@dangilman
Copy link
Collaborator

Hi @jhod0 @sibirrer, there probably is an analytic solution for the potential, the profile is fairly simple. If you have mathematica you can probably do it fairly easily

@jhod0
Copy link
Contributor Author

jhod0 commented May 8, 2023

Thanks @jhod0 @sibirrer! I might try plugging into Mathematica later. (Although looking at the Munoz 2001 paper cited as the source of the profile, I assume the solution is quite messy.)

For the near-term goal of simply computing predicted image positions for a source image, is there another solver that does not require the lens potential to be implemented? The undergrad who was running this code has been using Solver.image_position_from_source with the lenstronomy solver. I might ask him to try the stochastic option.

@sibirrer
Copy link
Collaborator

sibirrer commented May 8, 2023

@jhod0 , the only part where the lens potential is requested in this routine is when sorting the images according to arrival times. I.e. if you set arrival_time_sort=False, you might not get an error.

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

No branches or pull requests

3 participants