AnalyticDensityProf

class halotools.empirical_models.AnalyticDensityProf(cosmology, redshift, mdef, halo_boundary_key=None, **kwargs)[source]

Bases: object

Container class for any analytical radial profile model.

See Source code notes on AnalyticDensityProf for a review of the mathematics of halo profiles, and a thorough description of how the relevant equations are implemented in the AnalyticDensityProf source code.

Notes

The primary behavior of the AnalyticDensityProf class is governed by the dimensionless_mass_density method. The AnalyticDensityProf class has no implementation of its own of dimensionless_mass_density, but does implement all other behaviors that derive from dimensionless_mass_density. Thus for users who wish to define their own profile class, defining the dimensionless_mass_density of the profile is the necessary and sufficient ingredient.

Parameters:
cosmologyobject

Instance of an cosmology object.

redshift: array_like

Can be a scalar or a numpy array.

mdef: str

String specifying the halo mass definition, e.g., ‘vir’ or ‘200m’.

halo_boundary_keystr, optional

Default behavior is to use the column associated with the input mdef.

Methods Summary

circular_velocity(radius, total_mass, ...)

The circular velocity, \(V_{\rm cir} \equiv \sqrt{GM(<r)/r}\), as a function of halo-centric distance r.

cumulative_mass_PDF(scaled_radius, *prof_params)

The fraction of the total mass enclosed within dimensionless radius,

dimensionless_circular_velocity(...)

Circular velocity scaled by the virial velocity, \(V_{\rm cir}(x) / V_{\rm vir}\), as a function of dimensionless position \(\tilde{r} = r / R_{\rm vir}\).

dimensionless_mass_density(scaled_radius, ...)

Physical density of the halo scaled by the density threshold of the mass definition:

enclosed_mass(radius, total_mass, *prof_params)

The mass enclosed within the input radius.

halo_mass_to_halo_radius(total_mass)

Spherical overdensity radius as a function of the input mass.

halo_radius_to_halo_mass(radius)

Spherical overdensity mass as a function of the input radius.

mass_density(radius, mass, *prof_params)

Physical density of the halo at the input radius, given in units of \(h^{3}/{\rm Mpc}^{3}\).

rmax(total_mass, *prof_params)

Radius at which the halo attains its maximum circular velocity.

virial_velocity(total_mass)

The circular velocity evaluated at the halo boundary, \(V_{\rm vir} \equiv \sqrt{GM_{\rm halo}/R_{\rm halo}}\).

vmax(total_mass, *prof_params)

Maximum circular velocity of the halo profile.

Methods Documentation

circular_velocity(radius, total_mass, *prof_params)[source]

The circular velocity, \(V_{\rm cir} \equiv \sqrt{GM(<r)/r}\), as a function of halo-centric distance r.

Parameters:
radiusarray_like

Halo-centric distance in Mpc/h units; can be a scalar or numpy array

total_massarray_like

Total mass of the halo; can be a scalar or numpy array of the same dimension as the input radius.

*prof_paramsarray_like, optional

Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
vc: array_like

The circular velocity in km/s; has the same dimensions as the input radius.

Notes

See Spatial Profiles of Halos for derivations and implementation details.

cumulative_mass_PDF(scaled_radius, *prof_params)[source]

The fraction of the total mass enclosed within dimensionless radius,

\(P_{\rm prof}(<\tilde{r}) \equiv M_{\Delta}(<\tilde{r}) / M_{\Delta},\) where \(\tilde{r} \equiv r / R_{\Delta}\).

Parameters:
scaled_radiusarray_like

Halo-centric distance r scaled by the halo boundary \(R_{\Delta}\), so that \(0 <= \tilde{r} \equiv r/R_{\Delta} <= 1\). Can be a scalar or numpy array.

*prof_paramsarray_like, optional

Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
p: array_like

The fraction of the total mass enclosed within radius x, in \(M_{\odot}/h\); has the same dimensions as the input x.

Notes

See Spatial Profiles of Halos for derivations and implementation details.

dimensionless_circular_velocity(scaled_radius, *prof_params)[source]

Circular velocity scaled by the virial velocity, \(V_{\rm cir}(x) / V_{\rm vir}\), as a function of dimensionless position \(\tilde{r} = r / R_{\rm vir}\).

Parameters:
scaled_radiusarray_like

Halo-centric distance r scaled by the halo boundary \(R_{\Delta}\), so that \(0 <= \tilde{r} \equiv r/R_{\Delta} <= 1\). Can be a scalar or numpy array.

*prof_paramsarray_like, optional

Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
vcirarray_like

Circular velocity scaled by the virial velocity, \(V_{\rm cir}(x) / V_{\rm vir}\).

Notes

See Spatial Profiles of Halos for derivations and implementation details.

dimensionless_mass_density(scaled_radius, *prof_params)[source]

Physical density of the halo scaled by the density threshold of the mass definition:

The dimensionless_mass_density is defined as \(\tilde{\rho}_{\rm prof}(\tilde{r}) \equiv \rho_{\rm prof}(\tilde{r}) / \rho_{\rm thresh}\), where \(\tilde{r}\equiv r/R_{\Delta}\). The quantity \(\rho_{\rm thresh}\) is a function of the halo mass definition, cosmology and redshift, and is computed via the density_threshold function. The quantity \(\rho_{\rm prof}\) is the physical mass density of the halo profile and is computed via the mass_density function.

See Spatial Profiles of Halos for derivations and implementation details.

Parameters:
scaled_radiusarray_like

Halo-centric distance r scaled by the halo boundary \(R_{\Delta}\), so that \(0 <= \tilde{r} \equiv r/R_{\Delta} <= 1\). Can be a scalar or numpy array.

*prof_paramsarray_like, optional

Any additional array or sequence of arrays necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
dimensionless_density: array_like

Dimensionless density of a dark matter halo at the input scaled_radius, normalized by the density_threshold \(\rho_{\rm thresh}\) for the halo mass definition, cosmology, and redshift. Result is an array of the dimension as the input scaled_radius.

Notes

All of the behavior of a subclass of AnalyticDensityProf is determined by dimensionless_mass_density. This is numerically convenient, because mass densities in physical units are astronomically large numbers, whereas dimensionless_mass_density is of order \(\mathcal{O}(1-100)\). This also saves users writing their own subclass from having to worry over factors of little h, how profile normalization scales with the mass definition, etc. Once a model’s dimensionless_mass_density is specified, all the other functionality is derived from this definition.

See Spatial Profiles of Halos for derivations and implementation details.

enclosed_mass(radius, total_mass, *prof_params)[source]

The mass enclosed within the input radius.

\(M(<r) = 4\pi\int_{0}^{r}dr'r'^{2}\rho(r)\).

Parameters:
radiusarray_like

Halo-centric distance in Mpc/h units; can be a scalar or numpy array

total_massarray_like

Total mass of the halo; can be a scalar or numpy array of the same dimension as the input radius.

*prof_paramsarray_like, optional

Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
enclosed_mass: array_like

The mass enclosed within radius r, in \(M_{\odot}/h\); has the same dimensions as the input radius.

Notes

See Spatial Profiles of Halos for derivations and implementation details.

halo_mass_to_halo_radius(total_mass)[source]

Spherical overdensity radius as a function of the input mass.

Note that this function is independent of the form of the density profile.

Parameters:
total_mass: array_like

Total halo mass in \(M_{\odot}/h\); can be a number or a numpy array.

Returns:
radiusarray_like

Radius of the halo in Mpc/h units. Will have the same dimension as the input total_mass.

Notes

The behavior of this function derives from halo_mass_to_halo_radius.

halo_radius_to_halo_mass(radius)[source]

Spherical overdensity mass as a function of the input radius.

Note that this function is independent of the form of the density profile.

Parameters:
radiusarray_like

Radius of the halo in Mpc/h units; can be a number or a numpy array.

Returns:
total_mass: array_like

Total halo mass in \(M_{\odot}/h\). Will have the same dimension as the input radius.

Notes

The behavior of this function derives from halo_radius_to_halo_mass.

mass_density(radius, mass, *prof_params)[source]

Physical density of the halo at the input radius, given in units of \(h^{3}/{\rm Mpc}^{3}\).

Parameters:
radiusarray_like

Halo-centric distance in Mpc/h units; can be a scalar or numpy array

massarray_like

Total mass of the halo; can be a scalar or numpy array of the same dimension as the input radius.

*prof_paramsarray_like, optional

Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
density: array_like

Physical density of a dark matter halo of the input mass at the input radius. Result is an array of the dimension as the input radius, reported in units of \(h^{3}/Mpc^{3}\).

Notes

See Spatial Profiles of Halos for derivations and implementation details.

rmax(total_mass, *prof_params)[source]

Radius at which the halo attains its maximum circular velocity.

Parameters:
total_mass: array_like

Total halo mass in \(M_{\odot}/h\); can be a number or a numpy array.

*prof_paramsarray_like

Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
rmaxarray_like

\(R_{\rm max}\) in Mpc/h.

Notes

See Spatial Profiles of Halos for derivations and implementation details.

virial_velocity(total_mass)[source]

The circular velocity evaluated at the halo boundary, \(V_{\rm vir} \equiv \sqrt{GM_{\rm halo}/R_{\rm halo}}\).

Parameters:
total_massarray_like

Total mass of the halo; can be a scalar or numpy array.

Returns:
vvirarray_like

Virial velocity in km/s.

Notes

See Spatial Profiles of Halos for derivations and implementation details.

vmax(total_mass, *prof_params)[source]

Maximum circular velocity of the halo profile.

Parameters:
total_mass: array_like

Total halo mass in \(M_{\odot}/h\); can be a number or a numpy array.

*prof_paramsarray_like

Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration.

Returns:
vmaxarray_like

\(V_{\rm max}\) in km/s.

Notes

See Spatial Profiles of Halos for derivations and implementation details.