PrebuiltSubhaloModelFactory¶
- class halotools.empirical_models.PrebuiltSubhaloModelFactory(model_nickname, **kwargs)[source]¶
Bases:
SubhaloModelFactory
Factory class providing instances of
SubhaloModelFactory
models that come prebuilt with Halotools. For documentation on the methods bound toPrebuiltSubhaloModelFactory
, see the docstring ofSubhaloModelFactory
. For a tutorial on all prebuilt models, see Tutorial on models pre-built by Halotools.- Parameters:
- model_nicknamestring
String used to select the appropriate prebuilt model_dictionary that will be used to build the instance. See the
Examples
below. The list of available options are‘behroozi10’ (see Behroozi et al. (2010) Composite Model)
‘smhm_binary_sfr’ (see
smhm_binary_sfr_model_dictionary
)
- galaxy_selection_funcfunction object, optional
Function object that imposes a cut on the mock galaxies. Function should take a length-k Astropy table as a single positional argument, and return a length-k numpy boolean array that will be treated as a mask over the rows of the table. If not None, the mask defined by
galaxy_selection_func
will be applied to thegalaxy_table
after the table is generated by thepopulate_mock
method. Default is None.- halo_selection_funcfunction object, optional
Function object used to place a cut on the input
table
. If thehalo_selection_func
keyword argument is passed, the input to the function must be a single positional argument storing a length-N structured numpy array or Astropy table; the function output must be a length-N boolean array that will be used as a mask. Halos that are masked will be entirely neglected during mock population.
Examples
>>> model_instance = PrebuiltSubhaloModelFactory('behroozi10', redshift = 2)
Passing in
behroozi10
as themodel_nickname
argument triggers the factory to call thebehroozi10_model_dictionary
function. When doing so, the remaining arguments that were passed to thePrebuiltSubhaloModelFactory
will in turn be passed on tobehroozi10_model_dictionary
.Now that we have built an instance of a composite model, we can use it to populate any simulation in the Halotools cache:
>>> from halotools.sim_manager import CachedHaloCatalog >>> halocat = CachedHaloCatalog(simname = 'bolshoi', redshift = 2) >>> model_instance.populate_mock(halocat)
As described in the
populate_mock
docstring, calling thepopulate_mock
method creates amock
attribute bound to your model_instance. After you initially populate a halo catalog using thepopulate_mock
method, you can repopulate the halo catalog by calling thepopulate
method bound tomodel_instance.mock
.Attributes Summary
Attributes Documentation
- prebuilt_model_nickname_list = ['behroozi10']¶