Package: halomod
halomodis a python application that provides a flexible and simple interface for
dealing with the Halo Model of Dark Matter Halos, built onhmf.It also has a full-feature web application athttps://thehalomod.app– check it out!Full DocumentationRead the docs.FeaturesAll the features ofhmf(several transfer function models, 15+ HMF fitting functions,
efficient caching etc.)Extended components for halo model:10+halo biasmodels, plus scale-dependent bias from Tinker (2005).3+ basicconcentration-mass-redshift relations, including the analytic Bullock (2001) modelSeveral plug-and-playhalo-exclusionmodels (including ng-matched from Tinker+2005).5+ built-inHOD parametrisations.Many built-inhalo profiles, including NFW, generalised NFW, Hernquist etc.Support forWDM models.All basic quantities such as 3D correlations and power spectra, and projected 2PCF.Several derived quantities (eg. effective bias, satellite fraction).All models/components specifically written to be easily extendable.Simple routine for populating a halo catalogue with galaxies via a HOD.CLI script for producing any quantity included.Usagehalomodcan be used interactively (for instance inipythonor ajupyternotebook)
or in a script.
To use interactively, inipythondo something like the following:>>> from halomod import HaloModel
>>> hm = HaloModel()  # Construct the object
>>> help(hm)          # Lists many of the available quantities.
>>> galcorr = hm.corr_auto_tracer
>>> bias = hm.bias
>>> ...All parameters toHaloModelhave defaults so none need to be specified. There are
quite a few thatcanbe specified however. Check the docstring to see the
details. Furthermore, ashalomodextends the functionality ofhmf, almost all parameters accepted byhmf.MassFunction()can be used (check its docstring).To change the parameters (cosmological or otherwise), one should use theupdate()method, if aHaloModel()object already exists. For example>>> hm.update(rmin=0.1,rmax=1.0,rnum=100) #update scale vector
>>> corr_2h = hm.corr_2h_auto_tracer #The 2-halo term of the galaxy correlation functionSinceHaloModelis a sub-class ofMassFunction, all the quantities associated
with the hmf are also included, so for example>>> mass_variance = hm.sigma
>>> mass_function = hm.dndm
>>> linear_power = hm.powerAny parameter which defines a model choice (eg. a bias model) is named<component>_model,
so for example, the bias model is calledbias_model.Everymodel has an associated
parameter called<component>_params, which is a dictionary of parameters to that
model. The available choices for this dictionary depend on the model chosen (so that the
Sheth-Tormen HMF has a different set of parameters than does the Tinker+2008 model).
Within the constructed object, the actual model is instantiated and saved as<component>, so that this object can be accessed, and several internal methods can
be called.Someof these are exposed directly by theHaloModelclass (eg. one can
callhm.n_satdirectly, which itself calls a method of thehm.hodcomponent).Using the CLIYou can also runhalomodfrom the command-line. For basic usage, do:halomod run --helpConfiguration for the run can be specified on the CLI or via a TOML file (recommended).
An example TOML file can be found inexamples/example_run_config.toml.
Any parameter specifiable in the TOML file can alternatively be specified on the commmand
line after an isolated double-dash, eg.:halomod run -- z=1.0 hmf_model='SMT01' bias_model='Tinker10'AcknowledgmentsThanks to Florian Beutler, Chris Blake and David Palamara
who have all contributed significantly to the ideas, implementation and testing
of this code.Some parts of the code have been adapted from, influenced by or tested against:chomp (https://github.com/JoeMcEwen/chomp)AUM  (https://github.com/surhudm/aum)HMcode (https://github.com/alexander-mead/HMcode/)Along with these, several other private codes have been compared to.AttributionPlease citeMurray, Power and Robotham (2013)and/orhttps://ascl.net/1412.006(whichever is more appropriate)Murray, Diemer and Chen (2020)if you find this code useful in your research. Please also consider starring the GitHub repository.