autogalaxy.profiles.mass.PowerLawMultipole#
- class PowerLawMultipole[source]#
Bases:
MassProfileAbstract class for elliptical mass profiles.
- Parameters:
Methods
angleThe position angle in degrees of the major-axis of the ellipse defined by profile, defined counter clockwise from the positive x-axis (0.0 > angle > 180.0).
angle_radiansThe position angle in radians of the major-axis of the ellipse defined by profile, defined counter clockwise from the positive x-axis (0.0 > angle > 2pi).
angle_to_profile_grid_fromThe angle between each angle theta on the grid and the profile, in radians.
axis_ratioThe ratio of the minor-axis to major-axis (b/a) of the ellipse defined by profile (0.0 > q > 1.0).
Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates.
The radial (azimuthally-averaged) convergence of a pure multipole perturbation is identically zero — the cos(m(phi - phi_m)) term integrates to zero over angle for m >= 1, so the multipole adds no net azimuthally-symmetric mass.
deflections_2d_via_potential_2d_fromReturns the 2D deflection angles of the mass profile by numerically differentiating the lensing potential on the input grid.
Calculate the deflection angles on a grid of (y,x) arc-second coordinates.
density_between_circular_annuliCalculate the mass between two circular annuli and compute the density by dividing by the annuli surface area.
eccentric_radii_grid_fromConvert a grid of (y,x) coordinates to an eccentric radius: :math: axis_ratio^0.5 (x^2 + (y^2/q))^0.5
elliptical_radii_grid_fromConvert a grid of (y,x) coordinates to their elliptical radii values: :math: (x^2 + (y^2/q))^0.5
extract_attributeReturns an attribute of a class and its children profiles in the galaxy as a ValueIrregular or Grid2DIrregular object.
The shape angle is the offset between the angle of the ellipse and the angle of the multipole, this defines the shape that the multipole takes.
hasReturns True if any attribute of this profile is an instance of the input class cls, else False.
The Jacobian transformation from polar to cartesian coordinates.
Return the multipole normalization
k_mand orientation angleangle_m.mass_angular_within_circle_fromIntegrate the mass profiles's convergence profile to compute the total mass within a circle of specified radius.
mass_integralIntegrand used by mass_angular_within_circle_from to compute the total projected mass within a circle.
Calculate the potential on a grid of (y,x) arc-second coordinates.
potential_funcReturns the integrand of the lensing potential at a single point, used in numerical integration schemes for computing the potential from the mass profile's convergence.
radial_deflection_fromradial_grid_fromConvert a grid of (y, x) coordinates, to their radial distances from the profile centre (e.g. :math: r = sqrt(x**2 + y**2)).
rotated_grid_from_reference_frame_fromRotate a grid of (y,x) coordinates which have been transformed to the elliptical reference frame of a profile back to the original unrotated coordinate grid reference frame.
transformed_from_reference_frame_grid_fromTransform a grid of (y,x) coordinates from the reference frame of the profile to the original observer reference frame.
transformed_to_reference_frame_grid_fromTransform a grid of (y,x) coordinates to the reference frame of the profile.
vmapped_deflections_fromAttributes
average_convergence_of_1_radiusThe radius a critical curve forms for this mass profile, e.g. where the mean convergence is equal to 1.0.
ellipticity_rescaleA rescaling factor applied to account for the ellipticity of the mass profile when computing the Einstein radius from the average convergence equals unity criterion.
- k_m_and_angle_m_from(xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>)[source]#
Return the multipole normalization
k_mand orientation angleangle_m.The multipole normalization and angle are computed from the multipole component parameters
(epsilon_1, epsilon_2)usingconvert.multipole_k_m_and_phi_m_from. The returned angle is converted from degrees to radians.The numerical backend can be selected via the
xpargument, allowing this method to be used with both NumPy and JAX (e.g. insidejax.jit-compiled code).- Parameters:
xp – Numerical backend module, typically
numpyorjax.numpy.- Returns:
k_m – The multipole normalization.
angle_m – The multipole orientation angle in radians.
- get_shape_angle(base_profile)[source]#
The shape angle is the offset between the angle of the ellipse and the angle of the multipole, this defines the shape that the multipole takes.
In the case of the m=4 multipole, angles of 0 indicate pure diskiness, angles +- 45 indicate pure boxiness.
- Parameters:
base_profile (
PowerLaw) – The base power-law mass profile that is perturbed by the multipole.- Return type:
The angle between the ellipse and the multipole, in degrees, between +- 180/m.
- jacobian(a_r, a_angle, polar_angle_grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>)[source]#
The Jacobian transformation from polar to cartesian coordinates.
- Parameters:
a_r (
ndarray) – Ask Arisa_angle (
ndarray) – Ask Arispolar_angle_grid (
ndarray) – The polar angle coordinates of the input (y,x) Cartesian grid of coordinates.
- deflections_yx_2d_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>, **kwargs)[source]#
Calculate the deflection angles on a grid of (y,x) arc-second coordinates.
For coordinates (0.0, 0.0) the analytic calculation of the deflection angle gives a NaN. Therefore, coordinates at (0.0, 0.0) are shifted slightly to (1.0e-8, 1.0e-8).
- Parameters:
grid (
Union[ndarray,Grid1D,Grid2D,Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the deflection angles are computed on.
- convergence_2d_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>, **kwargs)[source]#
Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates.
- Parameters:
grid (
Union[ndarray,Grid1D,Grid2D,Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the convergence is computed on.
- convergence_func(grid_radius, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>)[source]#
The radial (azimuthally-averaged) convergence of a pure multipole perturbation is identically zero — the cos(m(phi - phi_m)) term integrates to zero over angle for m >= 1, so the multipole adds no net azimuthally-symmetric mass.
This hook is reached only by radial integration (mass_integral -> mass_angular_within_circle_from); returning the zero monopole means a pure multipole correctly encloses zero net mass. .array is unwrapped first so the return is a plain array rather than an aa.ArrayIrregular.
- potential_2d_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>, **kwargs)[source]#
Calculate the potential on a grid of (y,x) arc-second coordinates.
- Parameters:
grid (
Union[ndarray,Grid2D,Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the deflection angles are computed on.