a fast subhalo sampler
SubGen
: a fast subhalo samplerSubGen
generates Monte-Carlo samples of dark matter subhaloes, according to the unified subhalo distribution model in Han et. al. (2015; http://arxiv.org/abs/1509.02175).
To get started, check example.py
. You only need to specify the host halo mass, and the number of subhaloes to sample.
You need a python installation with the core scientific packages: numpy
, matplotlib
and scipy
.
You also need the emcee
package(http://dan.iel.fm/emcee) for MCMC sampling. Try
easy_install numpy matplotlib scipy emcee
or
pip install numpy matplotlib scipy emcee
to install these dependences if you miss them.
m: subhalo mass, in unit of 10^10Msun/h. By default, disrupted subhaloes are also included in the sample (which may not be useful at all). You can suppress the creation of disrupted subhaloes, and only obtain survived population, by, e.g.,
sample=SubhaloSample(M=1e4, include_disruption=False)
mAcc: subhalo infall mass, in unit of 10^10Msun/h
weight: the number of appearances of this subhalo. This exists because the number of sampled subhaloes may not be the same as the expected number of subhaloes. The subhalo abundance can be correctly recovered when counting with this weight. By default, the weights are not uniform but determined by mass function in order to avoid the sample being dominated by low mass objects. If you want uniform weights, you can do, e.g.,
sample=SubhaloSample(M=1e4, weighted_sample=False).
For complete features, have a look at the docstrings and the source code (they are not long~).
Jiaxin Han (@Kambrian)[ICC, Durham] http://kambrian.github.io/SubGen