hmf.helpers.sample.sample_mf¶
- hmf.helpers.sample.sample_mf(N, log_mmin, sort=False, **mf_kwargs)[source]¶
Create a sample of halo masses from a theoretical mass function.
- Parameters
N (int) – Number of samples to draw
log_mmin (float) – Log10 of the minimum mass to sample [Msun/h]
sort (bool, optional) – Whether to sort (in descending order of mass) the output masses.
mf_kwargs (keywords) – Anything passed to
hmf.MassFunction
to create the mass function which is sampled.
- Returns
m (array_like) – The masses
hmf (hmf.MassFunction instance) – The instance used to define the mass function.
Examples
Simplest example:
>>> m,hmf = sample_mf(1e5,11.0)
Or change the mass function:
>>> m,hmf = sample_mf(1e6,10.0,hmf_model="PS",Mmax=17)