hmfast.halos.massdef.MassDefinition
- class hmfast.halos.massdef.MassDefinition(delta=200, reference='critical')[source]
Bases:
objectMass definition for halos specified by an overdensity threshold and a reference density.
For example, \(M_{200c}\) corresponds to
MassDefinition(delta=200, reference="critical"), while \(M_{200m}\) corresponds toMassDefinition(delta=200, reference="mean"). The special valuedelta='vir'denotes the redshift-dependent virial overdensity and can only be used withreference='critical'.- Attributes:
- deltaint, float, or str
Overdensity threshold used to define the halo boundary. This can be a numeric value such as
200or500, or the string'vir'for the redshift-dependent virial overdensity. The value'vir'is only valid withreference='critical'.- referencestr
Reference density associated with
delta, either'critical'or'mean'.
- Raises:
- ValueError
If an invalid combination of delta and reference is provided, or if either parameter is set to an unsupported value.
Methods
r_delta(cosmology, m, z)Compute the halo radius \(r_\Delta\) associated with a halo mass.
- r_delta(cosmology, m, z)[source]
Compute the halo radius \(r_\Delta\) associated with a halo mass.
\[r_\Delta = \left[\frac{3M}{4\pi \Delta \rho_{\mathrm{ref}}(z)}\right]^{1/3}\]- Parameters:
- cosmologyCosmology
Cosmology object used to evaluate the reference density.
- mfloat or array-like
Halo mass enclosed within the overdensity radius, in \(M_\odot\).
- zfloat or array-like
Redshift at which to compute the radius.
- Returns:
- float or array-like
Radius \(r_\Delta\) within which the mean enclosed density is \(\Delta \rho_{\mathrm{ref}}(z)\), in physical \(\mathrm{Mpc}\). With shape \((N_m, N_z)\), where singleton dimensions get squeezed before return.