autogalaxy.profiles.mass.PowerLawMultipole#

class PowerLawMultipole[source]#

Bases: MassProfile

Abstract class for elliptical mass profiles.

Parameters:
  • centre (Tuple[float, float]) – The (y,x) arc-second coordinates of the profile centre.

  • ell_comps – The first and second ellipticity components of the elliptical coordinate system.

Methods

angle

The 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_radians

The 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_from

The angle between each angle theta on the grid and the profile, in radians.

axis_ratio

The ratio of the minor-axis to major-axis (b/a) of the ellipse defined by profile (0.0 > q > 1.0).

convergence_2d_from

Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates.

convergence_func

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_from

Returns the 2D deflection angles of the mass profile by numerically differentiating the lensing potential on the input grid.

deflections_yx_2d_from

Calculate the deflection angles on a grid of (y,x) arc-second coordinates.

density_between_circular_annuli

Calculate the mass between two circular annuli and compute the density by dividing by the annuli surface area.

eccentric_radii_grid_from

Convert 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_from

Convert a grid of (y,x) coordinates to their elliptical radii values: :math: (x^2 + (y^2/q))^0.5

extract_attribute

Returns an attribute of a class and its children profiles in the galaxy as a ValueIrregular or Grid2DIrregular object.

get_shape_angle

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.

has

Returns True if any attribute of this profile is an instance of the input class cls, else False.

jacobian

The Jacobian transformation from polar to cartesian coordinates.

k_m_and_angle_m_from

Return the multipole normalization k_m and orientation angle angle_m.

mass_angular_within_circle_from

Integrate the mass profiles's convergence profile to compute the total mass within a circle of specified radius.

mass_integral

Integrand used by mass_angular_within_circle_from to compute the total projected mass within a circle.

potential_2d_from

Calculate the potential on a grid of (y,x) arc-second coordinates.

potential_func

Returns 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_from

radial_grid_from

Convert 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_from

Rotate 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_from

Transform a grid of (y,x) coordinates from the reference frame of the profile to the original observer reference frame.

transformed_to_reference_frame_grid_from

Transform a grid of (y,x) coordinates to the reference frame of the profile.

vmapped_deflections_from

Attributes

average_convergence_of_1_radius

The radius a critical curve forms for this mass profile, e.g. where the mean convergence is equal to 1.0.

ellipticity_rescale

A 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_m and orientation angle angle_m.

The multipole normalization and angle are computed from the multipole component parameters (epsilon_1, epsilon_2) using convert.multipole_k_m_and_phi_m_from. The returned angle is converted from degrees to radians.

The numerical backend can be selected via the xp argument, allowing this method to be used with both NumPy and JAX (e.g. inside jax.jit-compiled code).

Parameters:

xp – Numerical backend module, typically numpy or jax.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 Aris

  • a_angle (ndarray) – Ask Aris

  • polar_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.