GalSim
GalSim copied to clipboard
Centroid shifts from lensing
In addition to shear and convergence/magnification, lensing also moves the positions of objects around. We should have our lensing modules also be able to return a shift that is appropriate for the location of the galaxy. Then the user could apply that as well as the shear and magnification to get the complete lensing effect.
Shifts like in this paper? http://arxiv.org/pdf/1405.1432.pdf :)
I can implement the deflection angles for the NFW halo, so that one gets the new positions by iteratively searching for the observed positions given the pre-lensing positions.
What would that look like in terms of how the user interacts with the code? Right now they have to enter post-lensing positions. Is the idea that they would now be told to enter pre-lensing positions, which get shifted and the appropriate shear/magnifications applied?
I think there are two ways about that:
- We stick to post-lensing positions, then a new method, say
getPosition()
would return their pre-lensing positions. That's the easiest way, but not really useful because it doesn't solve the problem that the post-lensing positions do not reflect that presence of a halo (or any sort of matter distribution). - We change to pre-lensing positions, then a new wrapper method would compute the post-lensing ones and call the existing shear/convergence methods with it. A second function call to
getPosition()
would return these coordinates. That's the right way of doing it, but it is costly computationally since there's an iterative solver involved for each (x/y) transformation.
I favor the latter option. The typical use case in which one would care about these shifts is to have a uniform density of objects in the pre-lensing plane, and then want them plotted in the correctly lensed positions. So even though it is more work on our part, I think it's what the user will expect.
As for the UI, I propose the following:
getLensedPositions(prelensing_positions) # New function
getPreLensedPositions(lensed_positions) # New function
getShear(..., prelensed_positions=False) # New kwarg with default = current behavior
... likewise for getConvergence, etc.
So even though it is more work on our part, I think it's what the user will expect.
+1.