autogalaxy.profiles.mass.NFW#

class NFW[source]#

Bases: gNFW, MassProfileCSE

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

  • ell_comps (Tuple[float, float]) – The first and second ellipticity components of the elliptical coordinate system.

  • kappa_s (float) – The overall normalization of the dark matter halo (\(\kappa_s = \rho_s r_s / \Sigma_{\rm crit}\)).

  • scale_radius (float) – The NFW scale radius \(r_s\), as an angle on the sky in arcseconds.

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).

concentration

concentration_func

convergence_2d_from

Analytic calculation convergence from Heyrovský & Karamazov 2024

convergence_2d_via_cse_from

Calculate the projected 2D convergence from a grid of (y,x) arc second coordinates, by computing and summing the convergence of each individual cse used to decompose the mass profile.

convergence_cse_1d_from

One dimensional function which is solved to decompose a convergence profile in cored steep ellipsoids, given by equation (14) of Oguri 2021 (https://arxiv.org/abs/2106.11464).

convergence_func

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

coord_func_f

coord_func_g

Vectorized version of the original looped coord_func_g_jit.

coord_func_h

decompose_convergence_via_cse

Decompose the convergence of the elliptical NFW mass profile into cored steep elliptical (cse) profiles.

deflections_2d_via_analytic_from

Analytic calculation deflection angles from Heyrovský & Karamazov 2024 via Eq.

deflections_2d_via_cse_from

deflections_2d_via_mge_from

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_via_cse_from

Returns the deflection angles of a 1d cored steep ellisoid (CSE) profile, given by equation (19) and (20) of Oguri 2021 (https://arxiv.org/abs/2106.11464).

deflections_yx_2d_from

Returns the 2D deflection angles of the mass profile from a 2D grid of Cartesian (y,x) coordinates.

delta_concentration

density_3d_func

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.

mass_angular_within_circle_from

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

mass_at_200_solar_masses

mass_integral

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

potential_2d_from

Returns the 2D lensing potential via the same MGE decomposition used for the deflection angles, so that grad(psi) is self-consistent with deflections_yx_2d_from.

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)).

radius_at_200

Returns r_{200m} for this halo in arcseconds

rho_at_scale_radius_solar_mass_per_kpc3

The Cosmic average density is defined at the redshift of the profile.

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.

shear_yx_2d_from

Analytic calculation shear from Heyrovský & Karamazov 2024

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.

epsrel

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

Returns the 2D deflection angles of the mass profile from a 2D grid of Cartesian (y,x) coordinates.

The deflection angle α(θ) at image-plane position θ describes how a light ray is bent by the gravitational field of the lens. The source-plane position β is then:

β = θ − α(θ)

Deflection angles are the single most important output of a mass profile — every other lensing quantity (convergence, shear, magnification, critical curves, caustics) can be derived from them.

Parameters:

grid (Union[ndarray, Grid2D, Grid2DIrregular]) – The 2D (y, x) coordinates where the deflection angles are evaluated.

Returns:

The (y, x) deflection angles at every coordinate on the input grid.

Return type:

aa.VectorYX2D

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

Analytic calculation deflection angles from Heyrovský & Karamazov 2024 via Eq. 30 & 31

Parameters:

grid (Union[ndarray, Grid2D, Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the deflection angles are computed on.

deflections_2d_via_cse_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]#
convergence_2d_via_cse_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 projected 2D convergence from a grid of (y,x) arc second coordinates, by computing and summing the convergence of each individual cse used to decompose the mass profile.

The cored steep elliptical (cse) decomposition of a the elliptical NFW mass profile (e.g. decompose_convergence_via_cse) is using equation (12) of Oguri 2021 (https://arxiv.org/abs/2106.11464).

Parameters:

grid (Union[ndarray, 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]#

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 (float) – The radial distance from the profile centre at which the convergence is evaluated.

Returns:

The convergence at the input radial distance.

Return type:

float

decompose_convergence_via_cse(grid_radii, total_cses=30, sample_points=60)[source]#

Decompose the convergence of the elliptical NFW mass profile into cored steep elliptical (cse) profiles.

This uses an input function func which is specific to the elliptical NFW mass profile, and is defined by equation (12) of Oguri 2021 (https://arxiv.org/abs/2106.11464).

Parameters:
  • func – The function representing the profile that is decomposed into CSEs.

  • radii_min – The minimum radius to fit

  • radii_max – The maximum radius to fit

  • total_cses – The number of CSEs used to approximate the input func.

  • sample_points (int (should be larger than 'total_cses')) – The number of data points to fit

Returns:

A list of amplitudes and core radii of every cored steep elliptical (cse) the mass profile is decomposed into.

Return type:

Tuple[List, List]

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

Analytic calculation shear from Heyrovský & Karamazov 2024

Parameters:

grid (Union[ndarray, 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]#

Analytic calculation convergence from Heyrovský & Karamazov 2024

Parameters:

grid (Union[ndarray, Grid2D, Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the deflection angles are computed on.

Return type:

Convergence