Behroozi¶
- class hmf.core.fits.Behroozi(*, A_200=0.1858659, A_300=0.1995973, A_400=0.2115659, A_600=0.2184113, A_800=0.2480968, A_1200=0.2546053, A_1600=0.26, A_2400=0.26, A_3200=0.26, a_200=1.466904, a_300=1.521782, a_400=1.559186, a_600=1.614585, a_800=1.869936, a_1200=2.128056, a_1600=2.301275, a_2400=2.529241, a_3200=2.661983, b_200=2.571104, b_300=2.254217, b_400=2.048674, b_600=1.869559, b_800=1.588649, b_1200=1.507134, b_1600=1.464374, b_2400=1.436827, b_3200=1.40521, c_200=1.193958, c_300=1.270316, c_400=1.335191, c_600=1.446266, c_800=1.581345, c_1200=1.79505, c_1600=1.965613, c_2400=2.237466, c_3200=2.439729, A_exp=0.14, a_exp=0.06)[source]¶
The Behroozi, Wechsler & Conroy (2013) mass function.
\(f(\sigma)\) is that of
Tinker08(evaluated at the virial overdensity), andmodify_dndm_kernel()applies the empirical high-redshift correction of App. G to the mass function:\[n(>M) = \theta(M, z)\, n_{\rm T08}(>M), \qquad \theta = 10^{\alpha(z)(M/M_\star)^{\gamma(z)}},\]with \(M_\star = 10^{11.5}\,M_\odot\) (eqs. G2-G3).
- Parameters:
A_200 (float, default 0.1858659) – The amplitude A at Delta = 200.
A_300 (float, default 0.1995973) – The amplitude A at Delta = 300.
A_400 (float, default 0.2115659) – The amplitude A at Delta = 400.
A_600 (float, default 0.2184113) – The amplitude A at Delta = 600.
A_800 (float, default 0.2480968) – The amplitude A at Delta = 800.
A_1200 (float, default 0.2546053) – The amplitude A at Delta = 1200.
A_1600 (float, default 0.26) – The amplitude A at Delta = 1600.
A_2400 (float, default 0.26) – The amplitude A at Delta = 2400.
A_3200 (float, default 0.26) – The amplitude A at Delta = 3200.
a_200 (float, default 1.466904) – The slope a at Delta = 200.
a_300 (float, default 1.521782) – The slope a at Delta = 300.
a_400 (float, default 1.559186) – The slope a at Delta = 400.
a_600 (float, default 1.614585) – The slope a at Delta = 600.
a_800 (float, default 1.869936) – The slope a at Delta = 800.
a_1200 (float, default 2.128056) – The slope a at Delta = 1200.
a_1600 (float, default 2.301275) – The slope a at Delta = 1600.
a_2400 (float, default 2.529241) – The slope a at Delta = 2400.
a_3200 (float, default 2.661983) – The slope a at Delta = 3200.
b_200 (float, default 2.571104) – The scale b at Delta = 200.
b_300 (float, default 2.254217) – The scale b at Delta = 300.
b_400 (float, default 2.048674) – The scale b at Delta = 400.
b_600 (float, default 1.869559) – The scale b at Delta = 600.
b_800 (float, default 1.588649) – The scale b at Delta = 800.
b_1200 (float, default 1.507134) – The scale b at Delta = 1200.
b_1600 (float, default 1.464374) – The scale b at Delta = 1600.
b_2400 (float, default 1.436827) – The scale b at Delta = 2400.
b_3200 (float, default 1.40521) – The scale b at Delta = 3200.
c_200 (float, default 1.193958) – The cut-off c at Delta = 200.
c_300 (float, default 1.270316) – The cut-off c at Delta = 300.
c_400 (float, default 1.335191) – The cut-off c at Delta = 400.
c_600 (float, default 1.446266) – The cut-off c at Delta = 600.
c_800 (float, default 1.581345) – The cut-off c at Delta = 800.
c_1200 (float, default 1.79505) – The cut-off c at Delta = 1200.
c_1600 (float, default 1.965613) – The cut-off c at Delta = 1600.
c_2400 (float, default 2.237466) – The cut-off c at Delta = 2400.
c_3200 (float, default 2.439729) – The cut-off c at Delta = 3200.
A_exp (float, default 0.14) – A(z) = A (1+z)^-A_exp.
a_exp (float, default 0.06) – a(z) = a (1+z)^-a_exp.
Model metadata
- alias: ClassVar[str | None] = 'Behroozi'¶
The short name the model is registered under, if any. Set by the
aliasclass keyword; never inherited.
- calibration_domain: ClassVar[Domain | None] = Domain(bounds=(('z', Interval(lower=0.0, upper=9.0, unit=None, lower_open=False, upper_open=False)),), source='Behroozi et al. 2013, App. G: the correction is fit to the Consuelo simulation (Omega_m = 0.25, sigma_8 = 0.8, n_s = 1; Sec. 4) over a = 0.1-1, i.e. z ~ 0-9 (Fig. 23), with n(>M) at M = 10^11.5-10^13 Msun (Fig. 23, right). The range of sigma, and of masses for dn/dM: not stated. Tinker08 is applied at the virial overdensity, outside its calibrated Delta range at z >~ 1, deliberately.')¶
Where the fit was calibrated against simulations, with its source;
Nonefor a fit that was not calibrated (e.g. an analytic one).
- measured_mass_definition: ClassVar[MeasuredMassDefinition] = MeasuredMassDefinition(kind='so_virial', linking_length=None, overdensity=None, preferred=None, note='Behroozi et al. 2013, Sec. 4: Bryan & Norman (1998) virial SO, ROCKSTAR.')¶
The halo mass definition the fit was measured in.
- modifies_dndm: ClassVar[bool] = True¶
Whether
modify_dndm_kernel()changes the mass function (see “Post-processing the mass function” in themodule documentation); if False, it is the identity.
- normalized¶
Whether \(f\) integrates to 1 over \(\ln\sigma^{-1}\) (all mass in haloes).
- parameter_source: ClassVar[str] = 'Behroozi et al. 2013 (arXiv v2), App. G, eqs. G2-G3 (the correction); f(sigma) parameters from Tinker et al. 2008, Table 2.'¶
The exact source (paper, version, table or equation) of the parameter defaults, e.g. “Tinker et al. 2008, ApJ 688, 709 (published), Table 2”.
- references: ClassVar[tuple[str, ...]] = ('Behroozi, P. S., Wechsler, R. H., Conroy, C., 2013. ApJ 770, 57. https://doi.org/10.1088/0004-637X/770/1/57', 'Tinker, J., et al., 2008. ApJ 688, 709. https://doi.org/10.1086/591439')¶
References to cite when the model is used, each a formatted citation.
- requires: ClassVar[frozenset[str]] = frozenset({'delta_halo', 'z'})¶
The inputs (from
INPUTS) thatfsigma()needs, besides sigma.
- simulations: ClassVar[SimulationDetails | None] = SimulationDetails(box_size=<Quantity [420.] Mpc / littleh>, n_particles=(2744000000,), omega_m=(0.25,), omega_b=None, sigma_8=(0.8,), h=(0.7,), n_s=(1.0,), softening=<Quantity [0.008] Mpc / littleh>, transfer=None, z_start=None, initial_conditions=('2LPT',), halo_finder='ROCKSTAR', n_min=None, z_range=(0.0, 9.0), names=('Consuelo',), notes="The correction is fitted to Consuelo only, after an incompleteness correction (App. G1). Bolshoi (250 Mpc/h, 2048^3, Omega_m = 0.27, sigma_8 = 0.82) is shown for comparison. Softening: 'eight times worse' than Bolshoi's 1 kpc/h.", source='Behroozi et al. 2013 (arXiv v2), Sec. 4 and App. G.')¶
The simulations the fit was calibrated on (None for a fit to no simulations).
- valid_domain: ClassVar[Domain] = Domain(bounds=(('delta_halo', Interval(lower=75.0, upper=30000.0, unit=None, lower_open=True, upper_open=False)), ('sigma', Interval(lower=0.0, upper=inf, unit=None, lower_open=True, upper_open=True)), ('z', Interval(lower=0.0, upper=inf, unit=None, lower_open=False, upper_open=True))), source='sigma > 0, z >= 0, and 75 < Delta <= 3e4: eq. 8 needs Delta > 75, and the spline of the default parameters keeps all of them > 0 only for 42.7 < Delta < 3.07e4. Parameters that are not > 0 raise in any case.')¶
fsigma()raises outside it.- Type:
Where the formula is defined or sensible
Methods
- check_required(x: FitInputs) None¶
Raise if an input needed to evaluate the fit is missing from
x.- Raises:
ValueError – If an input in
requires(or needed to checkvalid_domain) is missing.
- check_valid(x: FitInputs) None¶
Raise if any input is outside
valid_domain.- Raises:
DomainError – Always, if any value is outside the valid domain: this does not depend on any policy.
- classmethod coerce(value: object) Self¶
Convert a value to a model of this kind: the converter of a model field.
- Parameters:
value – An instance of
cls, which is returned as it is; or a name, import path or class thatget()accepts, which is looked up and instantiated with its default parameters.- Returns:
An instance of
cls.- Return type:
- Raises:
ModelNotFoundError – If
valueis a name that no model of this kind is known by.TypeError – If
valueis of any other type, or names a class that is not a concrete subclass ofcls.
Examples
>>> from hmf.core.filters import Filter, TopHat >>> Filter.coerce("TopHat") == TopHat() True
- classmethod domain_inputs() frozenset[str]¶
The inputs (besides sigma) needed to evaluate the fit and check both domains.
- classmethod fields_info() tuple[FieldInfo, ...]¶
Describe this class’s fields, without creating an instance.
- Returns:
The name, type, default and documentation of each field.
- Return type:
tuple of FieldInfo
- fsigma(sigma: ArrayLike, *, z: ArrayLike | None = None, omega_m_z: ArrayLike | None = None, delta_halo: ArrayLike | None = None, delta_c: ArrayLike | None = None, n_eff: ArrayLike | None = None, m: ArrayLike | None = None) ndarray[tuple[Any, ...], dtype[float64]]¶
The multiplicity function, \(f(\sigma) = \nu f(\nu)\).
mmust be a Quantity (seehmf.core.units); every other input is dimensionless. Code that already has plain arrays in canonical units callsfsigma_kernel()orevaluate_fsigma()instead (see “Evaluating a fit” in themodule documentation). It applies no calibration policy (seeevaluate_fsigma()for that), but always checksvalid_domain.- Parameters:
sigma – \(\sigma(m, z)\).
z – Redshift.
omega_m_z – \(\Omega_m(z)\).
delta_halo – The halo overdensity relative to the mean density.
delta_c – The critical overdensity for collapse.
n_eff – The effective spectral index.
m – The halo mass, a Quantity (e.g. in
Msun_h).
- Returns:
\(f(\sigma)\) (dimensionless), broadcast over the inputs.
- Return type:
- Raises:
ValueError – If an input the fit requires is not given.
UnitBoundaryError – If
mis not a Quantity.DomainError – If any input is outside
valid_domain, or makes the fit’s parameters unphysical.
- fsigma_kernel(x: FitInputs) ndarray[tuple[Any, ...], dtype[float64]]¶
fsigma()at kernel level, from inputs that are plain arrays.The inputs are in canonical units (the mass in Msun/h); see
hmf.core._kernels. It checks the valid domain, asfsigma()does, and applies no calibration policy (seeevaluate_fsigma()).- Parameters:
x – The inputs.
- Return type:
- Raises:
ValueError – If an input the fit requires is not in
x.DomainError – As for
fsigma().
- classmethod get(name: str | type[Model]) type[Self]¶
Look up a model of this kind.
- Parameters:
name – An alias (
"Tinker08"), a qualified name ("hmf.core.fits:Tinker08"), an import path to a class not yet imported ("pkg.mod:Cls"or"pkg.mod.Cls"), or a class.- Returns:
The model class (not an instance). It is always a subclass of
cls.- Return type:
- Raises:
ModelNotFoundError – If no model of this kind is known by
name, even after loading thehmf.modelsentry points and tryingnameas an import path.TypeError – If
nameresolves to something that is not a concrete subclass ofcls.
- classmethod get_aliases() Mapping[str, str]¶
Return a read-only mapping from alias to qualified name, for this kind.
- classmethod get_models() Mapping[str, type[Self]]¶
Return the registered models of this kind, by qualified name.
Plugins advertised in the
hmf.modelsentry-point group are loaded first.- Returns:
A read-only mapping from qualified name to class. Called on a kind, it is a live view of the registry. Called on a non-kind subclass, it holds only the models that subclass it.
- Return type:
Mapping
- in_calibration_domain(x: FitInputs) bool | ndarray[tuple[Any, ...], dtype[bool]]¶
Whether each input is inside
calibration_domain.- Parameters:
x – The inputs, from
inputs().- Returns:
A bool if every input is a scalar, else the broadcast array.
Trueif the fit has no calibration domain (it isNone).- Return type:
bool or numpy.ndarray of bool
- Raises:
ValueError – If an input needed to check the domain was not given.
- inputs(sigma: ArrayLike, *, z: ArrayLike | None = None, omega_m_z: ArrayLike | None = None, delta_halo: ArrayLike | None = None, delta_c: ArrayLike | None = None, n_eff: ArrayLike | None = None, m: ArrayLike | None = None) FitInputs¶
Collect the inputs, checking that the required ones are given.
Parameters are as for
fsigma()(mis a Quantity). Code that already has plain arrays in canonical units buildsFitInputsdirectly (see “Evaluating a fit” in themodule documentation).- Returns:
The inputs as plain arrays, in canonical units.
- Return type:
- Raises:
ValueError – If an input in
requires(or needed to checkvalid_domain) is missing.
- modify_dndm(m: Any, dndm: Any, *, z: ArrayLike, ngtm: Any, H0: Any, omega_m0: ArrayLike) Any¶
Map the mass function computed from
fsigma()to the fit’s.The identity unless
modifies_dndm(see “Post-processing the mass function” in themodule documentation). Every fit takes the same arguments, whether it uses them or not. This method converts them and callsmodify_dndm_kernel(), which a mass-functionStagecalls directly.- Parameters:
m – Halo masses, a Quantity: in h-units, or physical units (converted with
H0).dndm – The mass function from
fsigma(), a Quantity (number density per mass).z – Redshift.
ngtm – The cumulative mass function n(>m) from
fsigma(), a Quantity.H0 – The Hubble constant, a scalar Quantity (e.g.
70 * H0_unit). It converts physical units, and gives h to fits whose formula is in physical units.omega_m0 – The density parameter of CDM + baryons today.
- Returns:
The fit’s mass function, in
dndm_unit.- Return type:
Quantity
- modify_dndm_kernel(m: ArrayLike, dndm: ArrayLike, *, z: ArrayLike, ngtm: ArrayLike, h: ArrayLike, omega_m0: ArrayLike) ndarray[tuple[Any, ...], dtype[float64]]¶
modify_dndm()at kernel level, on plain arrays.A pure kernel in canonical units (see
hmf.core._kernels): the identity, unless the fit setsmodifies_dndm(its class documentation describes the correction). All arguments broadcast. It checks the arguments that say where the mass function is evaluated (m,z,h,omega_m0), from their extent;dndmandngtmare values it maps, and may be NaN (e.g. masked by a domain policy).- Parameters:
- Returns:
The fit’s mass function, in h^4 / (Msun Mpc^3).
- Return type:
- Raises:
DomainError – If an
m,horomega_m0is not finite and > 0, or azis not finite and >= 0.
- parameters(delta_halo: ArrayLike, z: ArrayLike) tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]]¶
The parameters \((A, a, b, c)\) at overdensity
delta_haloandz.- Parameters:
delta_halo – The halo overdensity relative to the mean density (> 75).
z – Redshift.
- Returns:
A, a, b, c, broadcast over the inputs.
- Return type:
- Raises:
DomainError – If any parameter is not finite and > 0 (the spline extrapolates them far outside the tabulated overdensities).