pyccl.halos.massdef module
- pyccl.halos.massdef.mass2radius_lagrangian(cosmo, M)[source]
Returns Lagrangian radius for a halo of mass \(M\). The Lagrangian radius is defined as that enclosing the mass of the halo assuming a homogeneous Universe.
\[R = \left(\frac{3\,M}{4\pi\,\rho_{M,0}}\right)^{1/3}\]
- pyccl.halos.massdef.convert_concentration(cosmo, *, c_old, Delta_old, Delta_new)[source]
Computes the concentration parameter for a different mass definition. This is done assuming an NFW profile. The output concentration
c_new
is found by solving the equation:\[f(c_{\rm old}) \Delta_{\rm old} = f(c_{\rm new}) \Delta_{\rm new}\]where
\[f(x) = \frac{x^3}{\log(1+x) - x/(1+x)}.\]- Parameters:
- Returns:
concentration parameter for the new mass definition.
- Return type:
(
float
or array)
- class pyccl.halos.massdef.MassDef(self, Delta, rho_type)[source]
Bases:
CCLAutoRepr
,CCLNamedClass
Halo mass definition. Halo masses are defined in terms of an overdensity parameter \(\Delta\) and an associated density \(X\) (either the matter density or the critical density):
\[M_\Delta = \frac{4 \pi}{3} \Delta\,\rho_X\, R_\Delta^3\]where \(R_\Delta\) is the halo radius. This object also holds methods to translate between \(R_\Delta\) and \(M_\Delta\), and to translate masses between different definitions if a concentration-mass relation is provided.
You may also define halo masses based on a Friends-of-Friends algorithm, in which case simply pass
Delta='fof'
below.- Parameters:
- property name
Give a name to this mass definition.
- get_Delta_vir(cosmo, a)[source]
Computes the virial collapse density contrast with respect to the critical density assuming a \(\Lambda\) CDM model. We use the fitting function from Bryan and Norman 1998. The virial overdensity is returned for the density type of this object’s mass definition (e.g. ‘critical’ or ‘matter’).
- get_mass(cosmo, R, a)[source]
Translates a halo radius into a mass
\[M_\Delta = \frac{4 \pi}{3} \Delta\,\rho_X\, R_\Delta^3\]
- get_radius(cosmo, M, a)[source]
Translates a halo mass into a radius
\[R_\Delta = \left(\frac{3M_\Delta}{4 \pi \rho_X\,\Delta}\right)^{1/3}\]
- classmethod create_instance(input_)[source]
Process the input and generate an object of the class. Input can be an instance of the class, or a name string. Optional
**kwargs
may be passed.
- classmethod from_specs(mass_def=None, *, mass_function=None, halo_bias=None, concentration=None)[source]
Instantiate mass definition and halo model ingredients.
Unspecified halo model ingredients are ignored.
mass_def
is always instantiated.- Parameters:
mass_def (
MassDef
,str
orNone
) – Mass definition. If a string, instantiate from its name. If None, obtain the one from the first specified halo model ingredient.mass_function (
MassFunc
orstr
) – Mass function subclass. Strings are auto-instantiated usingmass_def
.None
values are ignored.halo_bias (
HaloBias
orstr
) – Halo bias subclass. Strings are auto-instantiated usingmass_def
.None
values are ignored.concentration (
Concentration
orstr
) – Concentration subclass. Strings are auto-instantiated usingmass_def
.None
values are ignored.
- Returns:
Tuple of up to 4 elements.
mass_def :
MassDef
mass_function :
MassFunc
, if specifiedhalo_bias :
HaloBias
, if specifiedconcentration :
Concentration
, if specified
- pyccl.halos.massdef.mass_translator(*, mass_in, mass_out, concentration)[source]
Translate between mass definitions, assuming an NFW profile.
Returns a function that can be used to translate between halo masses according to two different definitions.
- Parameters:
- Returns:
Function that ranslates between two masses. The returned function
f
can be called as:f(cosmo, M, a)
, wherecosmo
is aCosmology
object,M
is a mass (or array of masses), anda
is a scale factor.