hmf.helpers.sample.dndm_from_sample¶
- hmf.helpers.sample.dndm_from_sample(m, V, nm=None, bins=50)[source]¶
Generate a binned dn/dm from a sample of halo masses.
- Parameters
m (array_like) – A sample of masses
V (float) – Physical volume of the sample
nm (array_like) – A multiplicity of each of the masses – useful for samples from simulations in which the number of unique masses is much smaller than the total sample.
bins (int or array) – Specifies bins (in log10-space!) for the sample. See numpy.histogram for more details.
- Returns
centres (array_like) – The centres of the bins.
hist (array_like) – The value of dn/dm in each bin.
Notes
The “centres” of the bins are located as the midpoint in log10-space.
If one does not have the volume, it can be calculated as N/n(>mmin).