You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def physical_deflection_angle(
self,
x: Tensor,
y: Tensor,
z_s: Tensor,
*args,
params: Optional["Packed"] = None,
z_l: Optional[Tensor] = None,
**kwargs,
) -> tuple[Tensor, Tensor]:
"""
Computes the physical deflection angle immediately after passing through this lens's plane.
Parameters
----------
x: Tensor
Tensor of x coordinates in the lens plane.
*Unit: arcsec*
y: Tensor
Tensor of y coordinates in the lens plane.
*Unit: arcsec*
z_s: Tensor
Tensor of source redshifts.
*Unit: unitless*
params: (Packed, optional)
Dynamic parameter container for the lens model. Defaults to None.
Returns
-------
x_component: Tensor
Deflection Angle in x-direction.
*Unit: arcsec*
y_component: Tensor
Deflection Angle in y-direction.
*Unit: arcsec*
"""
d_s = self.cosmology.angular_diameter_distance(z_s, params)
d_ls = self.cosmology.angular_diameter_distance_z1z2(z_l, z_s, params)
deflection_angle_x, deflection_angle_y = self.reduced_deflection_angle(
x, y, z_s, params
)
return func.physical_from_reduced_deflection_angle(
deflection_angle_x, deflection_angle_y, d_s, d_ls
)
We also have method
def reduced_deflection_angle(
self,
x: Tensor,
y: Tensor,
z_s: Tensor,
*args,
params: Optional["Packed"] = None,
z_l: Optional[Tensor] = None,
**kwargs,
) -> tuple[Tensor, Tensor]:
"""
Computes the reduced deflection angle of the lens at given coordinates [arcsec].
Parameters
----------
x: Tensor
Tensor of x coordinates in the lens plane.
*Unit: arcsec*
y: Tensor
Tensor of y coordinates in the lens plane.
*Unit: arcsec*
z_s: Tensor
Tensor of source redshifts.
*Unit: unitless*
params: (Packed, optional)
Dynamic parameter container for the lens model. Defaults to None.
Returns
--------
x_component: Tensor
Deflection Angle in the x-direction.
*Unit: arcsec*
y_component: Tensor
Deflection Angle in the y-direction.
*Unit: arcsec*
"""
d_s = self.cosmology.angular_diameter_distance(z_s, params)
d_ls = self.cosmology.angular_diameter_distance_z1z2(z_l, z_s, params)
deflection_angle_x, deflection_angle_y = self.physical_deflection_angle(
x, y, z_s, params
)
return func.reduced_from_physical_deflection_angle(
deflection_angle_x, deflection_angle_y, d_s, d_ls
)
The implementation logic is circular. Furthermore, the physical deflection angle convention in the literature is to take in physical coordinates. We decided a while ago to use the convention of using angular coordinates in caustics, since our main target was the reduced deflection angle method.
I'd like to review this part of the code with the intention to refactor and clarify the multiplane code.
The text was updated successfully, but these errors were encountered:
The intention with the circular logic was to make it so only one needed to be defined and the other would come automatically. If that seems ok to you, maybe we can close this issue?
In the ThinLens class we have method
We also have method
The implementation logic is circular. Furthermore, the physical deflection angle convention in the literature is to take in physical coordinates. We decided a while ago to use the convention of using angular coordinates in caustics, since our main target was the reduced deflection angle method.
I'd like to review this part of the code with the intention to refactor and clarify the multiplane code.
The text was updated successfully, but these errors were encountered: