-
Notifications
You must be signed in to change notification settings - Fork 11
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
prepare the test for the implementation of shear from cluster #198
Conversation
descwl_shear_sims/shear.py
Outdated
import clmm | ||
import galsim | ||
import numpy as np | ||
from astropy.coordinates import SkyCoord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make the astropy and clmm imports optional by importing them on the fly.
…comparing with Galsim
I think using shear distortion is correct, but let's ask @rmjarvis to be sure |
Is this failure in CI due to a change in the stack? If so we may need to convert the type |
It seems the failure is from the new version of the stack (The compiling succeed early yesterday...) |
expected list, got tuple somewhere we are using a tuple instead of a list |
I need more detail. What's the question here? |
@mr-superonion is simulating cluster shear and was wondering if he can just do this, for g1/g2 from the NFW profile he has obj = obj.shear(g1=g1, g2=g2) and get all the shears and sheared positions right, up to the level of accuracy we expect from galsim at shears up to tens of percent. I thought it is fine but wanted to see if there are any gotchas. |
That will shear the shapes, but not the positions. You'd have to do the lensing deflection yourself to put the galaxy in the right place. And that's not directly derivable from just g1,g2, so Position.shear is not the function you want. You would need to go back to the raw deflection formula for NFW halos. |
The positions move if the object is not at the origin. Here the objects will be randomly placed on the image (see example image above) then the shear will be applied and the positions will get sheared. |
I'm very confused then. If you use |
Each object gets a shift and then an NFW shear. obj = obj.shift( ).shear( ) We always do this because there is a slight bias in the recovered shear if we don't let the objects move, or "shear the scene", as we say. |
I update the requirements.txt and workflow and the error message with stackvana is solved |
@lbaumo , Are there any functions in clmm to get the deflection angle fields for given halo profiles? |
That wouldn't put things in the correct position for an NFW profile. (Or indeed for any shear pattern other than a pure constant shear across the whole image.) Indeed the sign of the effect isn't even right. Central mass distributions push the positions out from the center of mass. But your procedure will pull it back towards the center. |
Thanks @rmjarvis , I will use the deflection angle from NFW to put the source galaxies to the correct position!! |
@rmjarvis I realize that I do not understand why for constant shear field, the deflection of position is the same as the shear distortion? |
Shear is the local derivative (Jacobian) of the deflection pattern. If the shear is constant, then that derivative is the same at all points between the center and your galaxy. So applying the shear to a shifted object correctly applies the same thing as the net deflection at the end of the shift. But if the shear is variable, then the local derivative doesn't have to have anything to do with the global deflection. |
I see thanks Mike. Galsim can't know the shear is from an NFW. I think this means you need to shear first then move the object @mr-superonion |
OK. Thanks, I think now I understand. For a constant shear,
|
preparing to implement the shear object and get the shear from clmm (see issue: #197)