autogalaxy.profiles.mass.NFWTruncatedSph#

class NFWTruncatedSph[source]#

Bases: AbstractgNFW

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

  • kappa_s (float) – The dimensionless convergence normalisation (\(\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.

  • truncation_radius (float) – The truncation radius \(r_t\), as an angle on the sky in arcseconds. The dimensionless truncation ratio is \(\tau = r_t / r_s\).

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

Calculate the projected convergence at a given set of arc-second gridded coordinates.

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

coord_func_k

coord_func_l

coord_func_m

deflection_func_sph

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 at a given set of arc-second gridded 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.

from_m200_concentration

Construct an NFWTruncatedSph from the halo virial mass M_200 and concentration rather than the lensing parameters (kappa_s, scale_radius, truncation_radius).

has

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

m200_concentration_from

Recover the virial mass M_200 and concentration from lensing parameters.

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_at_truncation_radius_solar_mass

mass_integral

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

mass_ratio_from_concentration_and_truncation_factor

Mass ratio of a truncated NFW halo to its untruncated M_200 value.

potential_2d_from

Returns the 2D lensing potential of the mass profile from a 2D grid of Cartesian (y,x) 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)).

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.

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

Calculate the deflection angles at a given set of arc-second gridded coordinates.

Parameters:

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

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

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

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

The lensing potential ψ(θ) is the gravitational (Shapiro) time-delay term. It quantifies how much the passage of light through the gravitational field delays its arrival relative to a straight-line path in empty space.

The potential enters directly into the Fermat potential:

φ(θ) = ½ |θ − β|² − ψ(θ)

which governs time delays between multiple lensed images of the same source.

Parameters:

grid (Union[ndarray, Grid2D, Grid2DIrregular]) – The 2D (y, x) coordinates where the lensing potential is evaluated.

Returns:

The lensing potential ψ(θ) at every coordinate on the input grid.

Return type:

aa.Array2D

coord_func_k(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]#
coord_func_l(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]#
coord_func_m(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]#
static radial_deflection_from(r, params, xp)[source]#
classmethod from_m200_concentration(centre=(0.0, 0.0), m200_solar_mass=1000000000.0, concentration=10.0, redshift_halo=0.5, redshift_source=1.0, cosmology=None, truncation_factor=100.0)[source]#

Construct an NFWTruncatedSph from the halo virial mass M_200 and concentration rather than the lensing parameters (kappa_s, scale_radius, truncation_radius).

The conversion follows the standard NFW lensing procedure (He et al. 2022, MNRAS 511 3046):

  1. Derive the NFW scale radius and characteristic density from M_200, the concentration, and the critical density at redshift_halo.

  2. Convert to the dimensionless convergence kappa_s using the critical surface density between redshift_halo and redshift_source.

  3. Express the scale radius in arc-seconds using the angular diameter distance to redshift_halo.

  4. Set the truncation radius to r_t where the mean enclosed density equals truncation_factor times the critical density (default is r_100 for truncation_factor=100).

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

  • m200_solar_mass (float) – Virial mass M_200 in solar masses.

  • concentration (float) – NFW concentration parameter c = r_200 / r_s.

  • redshift_halo (float) – Redshift of the line-of-sight halo.

  • redshift_source (float) – Redshift of the lensed background source.

  • cosmology (Optional[LensingCosmology]) – Cosmology used for distance and density calculations. Defaults to Planck15 if not supplied.

  • truncation_factor (float) – Overdensity threshold defining the truncation radius. The default value of 100 sets the truncation at r_100.

static m200_concentration_from(kappa_s, scale_radius, redshift_halo, redshift_source, cosmology=None)[source]#

Recover the virial mass M_200 and concentration from lensing parameters.

This is the inverse of from_m200_concentration. Given the dimensionless convergence kappa_s and the scale radius in arc-seconds, the characteristic NFW density and scale radius in kpc are recovered, and the concentration is solved numerically from the NFW overdensity equation.

Parameters:
  • kappa_s (float) – Dimensionless NFW convergence normalisation = rho_s * r_s / Sigma_crit.

  • scale_radius (float) – NFW scale radius in arc-seconds.

  • redshift_halo (float) – Redshift of the halo.

  • redshift_source (float) – Redshift of the background source.

  • cosmology (Optional[LensingCosmology]) – Cosmology used for distance and density calculations. Defaults to Planck15 if not supplied.

Returns:

(m200_solar_mass, concentration).

Return type:

Tuple[float, float]

static mass_ratio_from_concentration_and_truncation_factor(concentration, truncation_factor=100.0)[source]#

Mass ratio of a truncated NFW halo to its untruncated M_200 value.

The truncated NFW mass is:

M_tNFW = M_200 * tau_scale / c_scale

where:

tau_scale = tau^2/(tau^2+1)^2 * ((tau^2-1)*ln(tau) + tau*pi - (tau^2+1)) c_scale = ln(1+c) - c/(1+c)

and tau is the solution to the _concentration_at_overdensity_factor equation for the given concentration and truncation factor.

This is the function tabulated and cubic-spline interpolated as the scale_c(c) function in the los_pipes simulation code (He et al. 2022).

Parameters:
  • concentration (float) – NFW concentration parameter c = r_200 / r_s.

  • truncation_factor (float) – Overdensity threshold defining the truncation radius (default 100).

mass_at_truncation_radius_solar_mass(redshift_profile, redshift_source, redshift_of_cosmic_average_density='profile', cosmology=None, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>)[source]#