# AnalyticDensityProf¶

class halotools.empirical_models.AnalyticDensityProf(cosmology, redshift, mdef, **kwargs)[source] [edit on github]

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: cosmology : object 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’.

Methods Summary

 circular_velocity(radius, total_mass, …) The circular velocity, $$V_{\rm cir} \equiv \sqrt{GM( Methods Documentation circular_velocity(radius, total_mass, *prof_params)[source] [edit on github] The circular velocity, \(V_{\rm cir} \equiv \sqrt{GM(<r)/r}$$, as a function of halo-centric distance r.

Parameters: radius : array_like Halo-centric distance in Mpc/h units; can be a scalar or numpy array total_mass : array_like Total mass of the halo; can be a scalar or numpy array of the same dimension as the input radius. *prof_params : array_like, optional Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration. 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] [edit on github]

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_radius : array_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_params : array_like, optional Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration. 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] [edit on github]

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_radius : array_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_params : array_like, optional Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration. vcir : array_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] [edit on github]

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_radius : array_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_params : array_like, optional Any additional array or sequence of arrays necessary to specify the shape of the radial profile, e.g., halo concentration. 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] [edit on github]

The mass enclosed within the input radius.

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

Parameters: radius : array_like Halo-centric distance in Mpc/h units; can be a scalar or numpy array total_mass : array_like Total mass of the halo; can be a scalar or numpy array of the same dimension as the input radius. *prof_params : array_like, optional Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration. 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] [edit on github]

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. radius : array_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] [edit on github]

Spherical overdensity mass as a function of the input radius.

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

Parameters: radius : array_like Radius of the halo in Mpc/h units; can be a number or a numpy array. 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] [edit on github]

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

Parameters: radius : array_like Halo-centric distance in Mpc/h units; can be a scalar or numpy array mass : array_like Total mass of the halo; can be a scalar or numpy array of the same dimension as the input radius. *prof_params : array_like, optional Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration. 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] [edit on github]

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_params : array_like Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration. rmax : array_like $$R_{\rm max}$$ in Mpc/h.

Notes

See Spatial Profiles of Halos for derivations and implementation details.

virial_velocity(total_mass)[source] [edit on github]

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

Parameters: total_mass : array_like Total mass of the halo; can be a scalar or numpy array. vvir : array_like Virial velocity in km/s.

Notes

See Spatial Profiles of Halos for derivations and implementation details.

vmax(total_mass, *prof_params)[source] [edit on github]

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_params : array_like Any additional array(s) necessary to specify the shape of the radial profile, e.g., halo concentration. vmax : array_like $$V_{\rm max}$$ in km/s.

Notes

See Spatial Profiles of Halos for derivations and implementation details.