halomod.tools.populate¶
- halomod.tools.populate(centres: ndarray, masses: ndarray, halomodel=None, profile: Profile | None = None, hodmod: HOD | None = None, edges: ndarray | None = None, rng=None)[source]¶
Populate a series of DM halos with a tracer, given a HOD model.
- Parameters:
centres ((N,3)-array) – The cartesian co-ordinates of the centres of the halos
masses (array_like) – The masses (in M_sun/h) of the halos
halomodel (type
halomod.HaloModel
) – A HaloModel object. One can either use this, or both halo_profile and hodmod arguments.profile (type
halo_profile.Profile
, optional) – A density halo_profile to use. Only required ifhalomodel
not given.hodmod (object of type
hod.HOD
, optional) – A HOD model to use to populate the dark matter. Only required ifhalomodel
not given.edges (float, len(2) iterable, or (2,3)-array) – Periodic box edges. If float, defines the upper limit of cube, with lower limit at zero. If len(2) iterable, defines edges of cube. If (2,3)-array, specifies edges of arbitrary rectangular prism.
- Returns:
pos (array) – (N,3)-array of positions of galaxies.
halo (array) – (N)-array of associated haloes (by index)
H (int) – Number of central galaxies. The first H galaxies in pos/halo correspond to centrals.