tools¶
A collection of functions which do some of the core work of the HMF calculation.
The routines here could be made more ‘elegant’ by taking MassFunction or Transfer objects as arguments, but we keep them simple for the sake of flexibility.
-
hmf.tools.
check_kr
(min_m, max_m, mean_dens, mink, maxk)¶ Check the bounds of the product of k*r
If the bounds are not high/low enough, then there can be information loss in the calculation of the mass variance. This routine returns a warning indicating the necessary adjustment for requisite accuracy.
See http://arxiv.org/abs/1306.6721 for details.
-
hmf.tools.
d_plus
(z, cdict, getvec=False)¶ Finds the factor \(D^+(a)\), from Lukic et. al. 2007, eq. 8.
Uses simpson’s rule to integrate, with 1000 steps.
Parameters: z : float
The redshift
cosmo :
hmf.cosmo.Cosmology()
objectCosmological parameters
Returns: dplus : float
The un-normalised growth factor.
-
hmf.tools.
growth_factor
(z, cdict, getvec=False)¶ Calculate \(d(a) = D^+(a)/D^+(a=1)\), from Lukic et. al. 2007, eq. 7.
Parameters: z : float
The redshift
cosmo :
hmf.cosmo.Cosmology()
objectCosmological parameters
Returns: growth : float
The normalised growth factor.
-
hmf.tools.
normalize
(norm_sigma_8, unn_power, lnk, mean_dens)¶ Normalize the power spectrum to a given \(\sigma_8\)
Parameters: norm_sigma_8 : float
The value of \(\sigma_8\) to normalize to.
unn_power : array_like
The natural logarithm of the unnormalised power spectrum
lnk : array_like
The natural logarithm of the values of k/h at which unn_power is defined.
mean_dens : float
The mean density of the Universe.
Returns: power : array_like
An array of the same length as unn_power in which the values are normalised to :math:``sigma_8`
normalisation : float
The normalisation constant.