autogalaxy.profiles.mass.gNFW#
- class gNFW[source]#
Bases:
AbstractgNFWThe elliptical NFW profiles, used to fit the dark matter halo of the lens.
- 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 * scale_radius)/lensing_critical_density)inner_slope (
float) – The inner slope of the dark matter haloscale_radius (
float) – The NFW scale radius as an angle on the sky in arc-seconds. For a regular NFW halo, the scale radius is roughly where the log-slope of the profile changes from -1 to -3.
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).
concentrationconcentration_funcconvergence_2d_fromCalculate the projected convergence at a given set of arc-second gridded coordinates.
Returns the gNFW convergence at the input elliptical radii (see the class docstring for the closed-form expression and its line-of-sight integral I(eta), eta = xi / r_s).
coord_func_fcoord_func_gVectorized version of the original looped coord_func_g_jit.
coord_func_hdeflections_2d_via_potential_2d_fromReturns the 2D deflection angles of the mass profile by numerically differentiating the lensing potential on the input grid.
Returns the 2D deflection angles of the mass profile from a 2D grid of Cartesian (y,x) coordinates.
delta_concentrationdensity_3d_funcdensity_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.
hasReturns True if any attribute of this profile is an instance of the input class cls, else False.
mass_angular_within_circle_fromIntegrate the mass profiles's convergence profile to compute the total mass within a circle of specified radius.
mass_at_200_solar_massesmass_integralIntegrand used by mass_angular_within_circle_from to compute the total projected mass within a circle.
Returns the 2D lensing potential via the same MGE decomposition used for the deflection angles, so that
grad(psi)is self-consistent withdeflections_yx_2d_from.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)).
radius_at_200Returns r_{200m} for this halo in arcseconds
rho_at_scale_radius_solar_mass_per_kpc3The Cosmic average density is defined at the redshift of the profile.
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.
convergence_table_epsrelconvergence_table_min_nodesconvergence_table_min_pointsconvergence_table_nodes_per_decadeconvergence_table_pad_decadesellipticity_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.
epsrellatent_parameters- deflections_yx_2d_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/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_mge_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>, **kwargs)[source]#
- potential_2d_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>, **kwargs)[source]#
Returns the 2D lensing potential via the same MGE decomposition used for the deflection angles, so that
grad(psi)is self-consistent withdeflections_yx_2d_from.This implementation is inherited by every elliptical and spherical gNFW/NFW variant (
NFW,gNFWSph, and the MCR / Virial-mass subclasses), none of which have a closed-form elliptical potential. The MGE decomposer expands the 3D density into a Gaussian sum and integrates each Gaussian’s analytic potential.
- convergence_func(grid_radius, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>)[source]#
Returns the gNFW convergence at the input elliptical radii (see the class docstring for the closed-form expression and its line-of-sight integral I(eta), eta = xi / r_s).
Small inputs integrate I(eta) with
scipy.integrate.quadonce per radius, in the numerically stable form of_convergence_integral_from. When there are at leastmax(convergence_table_min_points, n_nodes)finite positive radii in a 1D NumPy input, I(eta) is instead tabulated with the same stable integral (atconvergence_table_epsrel) on a log-spaced eta grid ofconvergence_table_nodes_per_decadenodes per decade spanning those radii, and interpolated in (log eta, log I) with a cubic spline (seeAbstractgNFWfor the accuracy of this scheme); both paths agree to ~1e-7. Radii that are zero, negative or non-finite are always integrated per radius with the original integrand form, so their output is unchanged.