hmfast.halos.massdef.mass_translator

hmfast.halos.massdef.mass_translator(mass_def_old, mass_def_new, concentration, max_iter=20)[source]

Build a mass-conversion callable for fixed source and target definitions.

Conversions between overdensity thresholds \(\Delta\) are performed by solving

\[\frac{M_{\Delta}}{M_{\Delta'}} = \frac{f(c_{\Delta})} {f\!\left[c_{\Delta} \frac{r_{\Delta'}}{r_{\Delta}}\right]},\]

where

\[f(x) = \ln(1+x) - \frac{x}{1+x}.\]

Reference-only conversions use

\[\Delta_{\mathrm{m}}(z) = \frac{\Delta_{\mathrm{c}}(z)}{\Omega_m(z)},\]

while virial overdensities are computed from

\[\Delta_{\mathrm{vir,c}}(z) = 18\pi^2 + 82x - 39x^2, \qquad x = \Omega_m(z) - 1.\]
Parameters:
mass_def_oldMassDefinition

Source mass definition.

mass_def_newMassDefinition

Target mass definition.

concentrationConcentration

Concentration relation calibrated for the source mass definition. When the returned callable is evaluated, this object is used to compute \(c_{\Delta}\) internally for mass_def_old.

max_iterint, optional

Maximum number of root-finder iterations.

Returns:
callable

Function f(cosmology, m, z) that converts masses from mass_def_old to mass_def_new.