skypy.halos.mass.subhalo_mass_sampler

skypy.halos.mass.subhalo_mass_sampler(halo_mass, nsubhalos, alpha, beta, x, m_min, resolution=100)[source] [edit on github]

Subhalo mass sampler. This function samples the original, unstriped masses of subhaloes from the subhalo mass function of their parent halo with a constant mass stripping factor given by equation (1) in [1] and the upper subhalo mass limit from [2].

Parameters:
halo_mass(nm, ) array_like

The mass of the halo parent, in units of solar mass.

nsubhalos: (nm, ) array_like

Array of the number of subhalos assigned to parent halos with mass halo_mass.

alpha, betafloat

Parameters that determines the subhalo Schechter function. Its the amplitude is defined by equation 2 in [1].

xfloat

Parameter that accounts for the added mass of the original, unstripped subhalos.

m_minfloat

Original mass of the least massive subhalo, in units of solar mass. Current stripped mass is given by \(m_{min} / x\).

resolution: int, optional

Resolution of the inverse transform sampling spline. Default is 100.

Returns:
sample: (nh, ) array_like

List of original masses drawn from the subhalo mass function for each parent halo, in units of solar mass. The length corresponds to the total number of subhalos for all parent halos, i.e. np.sum(nsubhalos).

References

[1]

Vale, A. and Ostriker, J.P. (2004), arXiv: astro-ph/0402500.

[2]

Vale, A. and Ostriker, J.P. (2004), arXiv: astro-ph/0511816.

Examples

>>> import numpy as np
>>> from skypy.halos import mass

This example samples 100 subhalos for a parent halo of mass 1.0E12 Msun:

>>> halo, min_sh = 1.0e12, 1.0e6
>>> alpha, beta, gamma_M = 1.9, 1.0, 0.3
>>> x = 3
>>> nsh = 100
>>> sh = mass.subhalo_mass_sampler(halo, nsh, alpha, beta, x, min_sh)