Closed mr-superonion closed 9 months ago
Trying to make simulation using shear from NFW halo.
But I am using the shear distortion from NFW halo to change the positions of background. Is it better to use the deflection angle?
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...) It seems to me that the problem comes from here: https://github.com/mr-superonion/descwl-shear-sims/blob/b64f6d9de39f8eeef97086e749f8a121f3f2d29d/descwl_shear_sims/psfs/dmpsfs.py#L5 I do not know how to change the bases type..
expected list, got tuple
somewhere we are using a tuple instead of a list
I think using shear distortion is correct, but let's ask @rmjarvis to be sure
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 obj = obj.shear(g1,g2)
, that won't change the position.
If you draw first and then shear the image, how do you do that? The shear is not constant across the image, so there's not one shear that makes sense to apply.
Also, another thing you probably want to do if you plan to do cluster science with this kind of sim is to include the dilation/magnification. obj.lens()
can do the full calculation correctly given both shear and convergence.
Each object gets a shift and then an NFW shear. Its really
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?
obj = obj.shift( ).shear( )
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: https://github.com/LSSTDESC/descwl-shear-sims/issues/197)