autogalaxy.profiles.mass.PowerLawBroken#

class PowerLawBroken[source]#

Bases: MassProfile

Ell, homoeoidal mass model with an inner_slope and outer_slope, continuous in density across break_radius. Position angle is defined to be zero on x-axis and +ve angle rotates the lens anticlockwise

The grid variable is a tuple of (theta_1, theta_2), where each theta_1, theta_2 is itself a 2D array of the x and y coordinates respectively.~

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 dimensionless density kappa=Sigma/Sigma_c (eq.

convergence_func

Returns the convergence of the mass profile as a function of the radial coordinate.

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

Returns the complex deflection angle from eq.

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.

has

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

hyp2f1_series

Computes eq.

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

The lensing potential is not available for the broken power law.

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.

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]#

Returns the convergence of the mass profile as a function of the radial coordinate.

This is used to integrate the convergence profile to compute enclosed masses and the Einstein radius.

Parameters:

grid_radius – The radial distance from the profile centre at which the convergence is evaluated.

Returns:

The convergence at the input radial distance.

Return type:

float

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 dimensionless density kappa=Sigma/Sigma_c (eq. 1)

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]#

The lensing potential is not available for the broken power law.

It would be computed by decomposing the projected convergence into Gaussians via potential_2d_via_mge_from (three_D=False), but that decomposition integrates the convergence along a complex contour and therefore requires an analytic convergence profile. The broken power law’s convergence is piecewise — a slope discontinuity at break_radius — so it is non-analytic and the MGE potential is numerically invalid (wrong by many orders of magnitude). A correct potential would integrate this profile’s own analytic deflection field (eq. 18-19) along radial lines, which is not yet implemented.

convergence_2d_from, deflections_yx_2d_from, and convergence_func (and hence the Einstein-radius / enclosed-mass integrals) are all available and correct.

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'>, max_terms=20, **kwargs)[source]#

Returns the complex deflection angle from eq. 18 and 19

static hyp2f1_series(t, q, r, z, max_terms=20, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>)[source]#

Computes eq. 26 for a radius r, slope t, axis ratio q, and coordinates z.