halomod.profiles.Hernquist¶
- class halomod.profiles.Hernquist(cm_relation, mdef=<hmf.halos.mass_definitions.SOMean object>, z=0.0, cosmo=FlatLambdaCDM(name='Planck15', H0=<Quantity 67.74 km / (Mpc s)>, Om0=0.3075, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.0486), nu_fn=<function Profile.<lambda>>, **model_parameters)[source]¶
Bases:
ProfileHalo Density Profile of Hernquist(1990).
See documentation for
Profilefor information on input parameters. This model has no free parameters.Notes
This is an empirical form proposed in [1], with the formula
\[\rho(r) = \frac{\rho_s}{r/R_s\big(1+r/R_s\big)^3}\]References
[1]Hernquist, L., “An Analytical Model for Spherical Galaxies and Bulges”, https://ui.adsabs.harvard.edu/abs/1990ApJ…356..359H.
- cdf(r, c=None, m=None, coord='r')¶
The cumulative distribution function, \(m(<x)/m_v\).
- Parameters:
r (float or array_like) – The radial location – units defined by
coordc (float or array_like, optional) – The halo_concentration. Only used if m not provided
m (float or array_like, optional) – The mass of the halo. Defines the halo_concentration if provided.
coord (str, {
"x","r","s"}) – What the radial coordinate represents.rrepresents physical co-ordinates [units Mpc/h].xis in units of the scale radius (r_vir = c), andsis in units of the virial radius (r_vir = 1).
- cm_relation(m: [<class 'float'>, <class 'numpy.ndarray'>]) [<class 'float'>, <class 'numpy.ndarray'>]¶
The halo_concentration-mass relation.
- classmethod get_models() dict[str, type]¶
Get a dictionary of all implemented models for this component.
- halo_mass_to_radius(m, at_z=False)¶
Return the halo radius corresponding to
m.Note that this is the radius corresponding to the halo at redshift zero, even if the redshift of the profile is not zero.
- halo_radius_to_mass(r, at_z=False)¶
Return the halo mass corresponding to
r.
- lam(r, m, norm='m', c=None, coord='r')¶
The density halo_profile convolved with itself.
- Parameters:
r (float or array of floats) – The radial location(s). The units vary according to
coordm (float or array of floats) – The mass(es) of the halo(s)
norm (str, {
None,``m``,``rho``}) – Normalisation of the density.c (float or array of floats, default
None) – Concentration(s) of the halo(s). Must be same length asm.coord (str, {
r,``x``,``s``}) – What the radial coordinate represents.rrepresents physical co-ordinates [units Mpc/h].xis in units of the scale radius (r_vir = c), andsis in units of the virial radius (r_vir = 1).
- populate(n, m, c=None, centre=None, rng=None)¶
Populate a halo with the current halo profile of mass
mwithntracers.- Parameters:
n (int) – Number of tracers to place down
m (float) – Mass of the halo.
c (float, optional) – Concentration of the halo. Will be calculated if not given.
centre (3-array) – (x,y,z) co-ordinates of centre of halo. Default is zero.
- Returns:
pos – Array of positions of the tracers, centred around (0,0,0).
- Return type:
(N,3)-array
- rho(r, m, norm=None, c=None, coord='r')¶
The density at radius r of a halo of mass m.
- Parameters:
r (float or array of floats) – The radial location(s). The units vary according to
coordm (float or array of floats) – The mass(es) of the halo(s)
norm (str, {
m,``rho``}) – Normalisation of the density.c (float or array of floats, default
None) – Concentration(s) of the halo(s). Must be same length asm.coord (str, {
r,``x``,``s``}) – What the radial coordinate represents.rrepresents physical co-ordinates [units Mpc/h].xis in units of the scale radius (x(r_vir) = c), andsis in units of the virial radius (s(r_vir) = 1).
- scale_radius(m: float | ndarray, at_z: bool = False) float | ndarray¶
Return the scale radius for a halo of mass m.
The scale radius is defined as \(r_s = r_vir(m) / c(m)\).
- Parameters:
m – Mass of the halo(s), in units of
M_sun / h.at_z – If true, return the redshift-dependent configuration-space scale radius of the halo. Otherwise, return the redshift-independent Lagrangian-space scale radius (based on an initial density patch).
- Returns:
The scale radius, same type as
m.- Return type:
r_s
- u(k, m, norm='m', c=None, coord='k')¶
The (optionally normalised) Fourier-transform of the density halo_profile.
- Parameters:
k (float or array of floats) – The radial wavenumber(s). The units vary according to
coordm (float or array of floats) – The mass(es) of the halo(s)
norm (str, {
None,``m``,``rho``}) – Normalisation of the density.c (float or array of floats, default
None) – Concentration(s) of the halo(s). Must be same length asm.coord (str, {
k,``kappa``}) – What the radial coordinate represents.rrepresents physical wavenumbers [units h/Mpc].kappais in units of the scale radius, kappa = k*rs.
- virial_velocity(m=None, r=None)¶
Return the virial velocity for a halo of mass
m.Either m or r must be passed. If both are passed,
mis preferentially used.- Parameters:
m (array_like, optional) – Masses of halos.
r (array_like, optional) – Radii of halos.