MassDefinition¶
- hmf.halos.mass_definitions.MassDefinition¶
Alias of
BaseMassDefinition, kept for backwards compatibility.Attributes
- MassDefinition.colossus_name¶
The name of the mass definition in Colossus format, if applicable.
- MassDefinition.references: ClassVar[tuple[str, ...]] = ()¶
References to cite when this model is used, each a formatted citation string. Subclasses inherit their parent’s references unless they set their own.
Methods
- MassDefinition.change_definition(m: ndarray, mdef, profile=None, c=None, z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
Change the spherical overdensity mass definition.
This requires using a profile, for which the halomod package must be used.
- Parameters:
m (float or array_like) – The halo mass to be changed, in \(M_\odot/h\). Must be broadcastable with c, if provided.
mdef (
MassDefinitionsubclass instance) – The mass definition to which to change.profile (
halomod.profiles.Profileinstance, optional) – An instantiated profile object from which to calculate the expected definition change. If not provided, a mocked NFW profile is used.c (float or array_like, optional) – The concentration(s) of the halos given. If not given, the concentrations will be automatically calculated using the profile object.
- Returns:
m_f (float or array_like) – The masses of the halos in the new definition.
r_f (float or array_like) – The radii of the halos in the new definition.
c_f (float or array_like) – The concentrations of the halos in the new definition.
- static MassDefinition.critical_density(z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
Get the critical density of the Universe at redshift z, [h^2 Msun/Mpc^3].
- classmethod MassDefinition.get_models() Mapping[str, type]¶
Get a read-only mapping of all implemented models for this component.
The mapping is a live view of the registry, so it shows models registered later, but it can not be used to add or remove models.
- MassDefinition.halo_density(z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
The density of haloes under this definition.
May not exist in some definitions. Units are \(M_\odot h^2/{\rm Mpc}^3\).
- MassDefinition.halo_overdensity_crit(z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
Compute the halo overdensity with respect to the critical density.
- MassDefinition.halo_overdensity_mean(z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
Compute the halo overdensity with respect to the mean density.
- MassDefinition.m_to_r(m, z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
Return the radius corresponding to m for this mass definition.
- Parameters:
m (float or array_like) – The mass to convert to radius. Should be in the same units (modulo volume) as
halo_density().
Notes
Computed as \(\left(\frac{3m}{4\pi \rho_{\rm halo}\right)\).
- classmethod MassDefinition.mean_density(z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
Get the mean density of the Universe at redshift z, [h^2 Msun / Mpc^3].
- MassDefinition.r_to_m(r, z=0, cosmo=FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, Tcmb0=<Quantity 2.7255 K>, Neff=3.046, m_nu=<Quantity [0., 0., 0.06] eV>, Ob0=0.04897))¶
Return the mass corresponding to r for this mass definition.
- Parameters:
r (float or array_like) – The radius to convert to mass. Units should be compatible with
halo_density().
Notes
Computed as \(\frac{4\pi r^3}{3} \rho_{\rm halo}\).