NFWDensityProfile#
- class profiles.density.NFWDensityProfile(**kwargs)[source]#
Navarro-Frenk-White (NFW) Density Profile.
This profile is commonly used in astrophysics to describe the dark matter halo density in a spherical, isotropic system [1]. It is derived from simulations of structure formation.
\[\rho(r) = \frac{\rho_0}{\frac{r}{r_s} \left(1 + \frac{r}{r_s}\right)^2}\]where:
\(\rho_0\) is the central density.
\(r_s\) is the scale radius.
Parameters
Parameters for NFWDensityProfile
#Name
Symbol
Description
rho_0
\(\rho_0\)
Central density
r_s
\(r_s\)
Scale radius
References
Example
>>> import matplotlib.pyplot as plt >>> from pisces.profiles.density import ( ... NFWDensityProfile, ... )
>>> r = np.linspace(0.1, 10, 100) >>> profile = NFWDensityProfile(rho_0=1.0, r_s=1.0) >>> rho = profile(r)
>>> _ = plt.loglog(r, rho, "k-", label="NFW Profile") >>> _ = plt.xlabel("Radius (r)") >>> _ = plt.ylabel("Density (rho)") >>> _ = plt.legend() >>> plt.show()
(
Source code
,png
,hires.png
,pdf
)Methods
__init__
(**kwargs)Initialize a profile instance with specific parameter values.
compute_circular_velocity
(r[, units, G])Compute the circular velocity at radius \(r\).
Compute the spherical overdensity profile relative to the critical density at redshift \(z\).
Find the radius enclosing a target overdensity relative to the critical density at redshift \(z\).
compute_deflection_angle
(R[, mode, units, ...])Compute the gravitational lensing deflection angle at projected radius \(R\).
compute_einstein_radius
(z_lens, z_source[, ...])Compute the Einstein ring angular radius \(\\theta_E\) for a perfectly aligned source-lens system.
compute_enclosed_mass
(r[, units])Numerically compute the enclosed mass \(M(r)\) within radius \(r\).
compute_escape_velocity
(r[, units, G])Compute the escape velocity at radius \(r\).
compute_fractional_mass_radius
(rmin, rmax[, ...])Find the radius enclosing a given fraction of the total mass.
compute_gravitational_field
(r[, units, G])Numerically compute the gravitational field \(g(r)\) at radius \(r\).
compute_gravitational_potential
(r[, units, G])Numerically compute the gravitational potential \(\Phi(r)\).
compute_lensing_convergence
(R, z_lens, z_source)Compute the lensing convergence \(\kappa(R)\) at projected radius \(R\).
compute_surface_density
(R[, units])Numerically compute the projected surface density at radius R from the origin.
compute_total_mass
([units])Numerically compute the total mass of the profile by integrating to infinity.
from_dict
(data)Reconstruct a profile instance from a dictionary.
from_hdf5
(h5obj[, name])Reconstruct a profile from HDF5 attributes.
from_json
(filepath)Reconstruct a profile from a JSON file.
from_yaml
(filepath)Reconstruct a profile from a YAML file.
get_derived_profile
(profile_name, **kwargs)Access and instantiate a derived profile by name.
get_expression_latex
([substitute])Return the LaTeX representation of the profile's symbolic expression.
get_output_units
(*argu)Determine the output units of the operation given some set of input units.
Return a LaTeX table of the profile parameters.
lambdify_expression
(expression)Convert a symbolic expression into a callable function.
List all available derived profiles for this instance.
substitute_expression
(expression)Replace symbolic parameters with numerical values in an expression.
to_dict
()Serialize this profile to a minimal dictionary representation.
to_hdf5
(h5obj[, name])Store profile metadata into an HDF5 object as attributes.
to_json
(filepath, **kwargs)Serialize the profile to a JSON file.
to_yaml
(filepath, **kwargs)Serialize the profile to a YAML file.
Attributes
Get the available derived profile classes for this instance.
Get the symbolic representations of the coordinate system parameters.
The parameters of this coordinate system.
The symbols representing each of the coordinate axes in this coordinate system.
The axes names present in this coordinate system.