PrebuiltHodModelFactory¶
- class halotools.empirical_models.PrebuiltHodModelFactory(model_nickname, **kwargs)[source]¶
Bases:
HodModelFactoryFactory class providing instances of
HodModelFactorymodels that come prebuilt with Halotools. For documentation on the methods bound toPrebuiltHodModelFactory, see the docstring ofHodModelFactory. 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
Examplesbelow. The list of available options are‘zheng07’ (see Zheng et al. (2007) Composite Model for a tutorial)
‘leauthaud11’ (see Leauthaud et al. (2011) Composite Model)
‘tinker13’ (see Tinker et al. (2013) Composite Model)
‘hearin15’ (see Hearin et al. (2015) Composite Model)
‘cacciato09’ (see Cacciato et al. (2009) Composite Model)
‘zu_mandelbaum15’ (see Zu & Mandelbaum et al. (2015) Composite Model)
‘zu_mandelbaum16’ (see Zu & Mandelbaum et al. (2016) Composite Model)
- halo_selection_funcfunction object, optional
Function object used to place a cut on the input
table. If thehalo_selection_funckeyword 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
>>> from halotools.empirical_models import PrebuiltHodModelFactory >>> model_instance = PrebuiltHodModelFactory('zheng07')
Passing in
zheng07as themodel_nicknameargument triggers the factory to call thezheng07_model_dictionaryfunction. When doing so, the remaining arguments that were passed to thePrebuiltHodModelFactorywill in turn be passed on tozheng07_model_dictionary.>>> model_instance = PrebuiltHodModelFactory('zheng07', threshold=-20) >>> model_instance = PrebuiltHodModelFactory('zheng07', threshold=-20, modulate_with_cenocc=True)
This same syntax applies to all pre-built models.
>>> model_instance = PrebuiltHodModelFactory('hearin15', threshold = 10.5, redshift = 2)
Once you have built an instance of a composite model, you 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_mockdocstring, calling thepopulate_mockmethod creates amockattribute bound to your model_instance. After you initially populate a halo catalog using thepopulate_mockmethod, you can repopulate the halo catalog by calling thepopulatemethod bound tomodel_instance.mock.Attributes Summary
Attributes Documentation
- prebuilt_model_nickname_list = ('zheng07', 'leauthaud11', 'tinker13', 'hearin15', 'zu_mandelbaum15', 'zu_mandelbaum16', 'cacciato09')¶