hmf.core.power_source¶
Sources of the linear matter power spectrum at z = 0.
MassVariance needs only four things from the
power spectrum, which make up the PowerSource protocol. The first three are
kernel-level (see hmf.core._kernels): plain floats and arrays in canonical
units, for library code.
ln_power_kernel(ln_k): the natural log of the linear power spectrum of one matter species at z = 0, with k in h/Mpc. Its amplitude is arbitrary: the normalisation to sigma_8 is a scalar applied later, byLinearPower(the amplitude of theMassFunctionbuilt on MassVariance), so only the shape matters and it has no fixed unit. ATabulatedPowergives its table in (Mpc/h)³, whileTransfer.power_source’s \(k^{n_s} T(k)^2\) is dimensionless;rho_mean0: the mean comoving density today of CDM + baryons, in M☉ h² / Mpc³ (rho_unit), whatever the species of the power. It converts between a halo’s mass and its Lagrangian radius, \(M = \tfrac{4\pi}{3}\bar\rho_{\rm cb} R^3\): haloes are made of CDM and baryons, as in hmf 3.x and the calibrations of the fits inhmf.core.fits. So the power of total matter and of CDM + baryons give the same R(M);table_range: theTableRangeof a table the user supplied, beyond whichln_power_kernelextrapolates, orNoneif it extrapolates no user table (a fitting formula, a Boltzmann code’s table, or a table that is not extrapolated).ln_power_kerneldoes not warn: the stage that evaluates it warns, withTableRange.warn_outside();_unit_context: theUnitContext(with its H0) used by the units boundary of the stages built on it (seeHasUnitContext). Every implementation must provide it, despite its leading underscore (seePowerSourcefor why).
Transfer.power_source implements it
for the power of a Transfer stage, and
TabulatedPower for a power spectrum given as a table.
Extrapolation warnings¶
Every path that evaluates a user-supplied table outside its range warns through
one mechanism, TableRange.warn_outside(): an
HMFExtrapolationWarning once per owner (with
warn_once()) and end of the table. The owner is the object
the table belongs to: the Transfer stage for its public
methods, and the power source for MassVariance
(which checks the extent of its k grid once) and for
TabulatedPower.power(). Extrapolation by design (a Boltzmann code’s tail, the
lazy extension of the mass lattice) has no TableRange, so it never warns.
Classes
|
A source of the linear matter power spectrum of one species at z = 0. |
|
The k range of a table the user supplied, beyond which it is extrapolated. |
|
A linear power spectrum at z = 0, given as a table. |