nbodykit.source.catalog.hod

Functions

find_object_dtypes(data) Utility function to convert ‘O’ data types to strings
gal_type_integers(galtab) Convert centrals to 0 and satellites to 1

Classes

HODBase(halos[, seed, use_cache, comm]) A base class to be used for HOD population of a halo catalog.
HODCatalog(halos[, logMmin, sigma_logM, …]) A CatalogSource that uses the HOD prescription of Zheng et al 2007 to populate an input halo catalog with galaxies.
class nbodykit.source.catalog.hod.HODBase(halos, seed=None, use_cache=False, comm=None, **params)[source]

A base class to be used for HOD population of a halo catalog.

The user must supply the __makemodel__() function, which returns the halotools composite HOD model.

This abstraction allows the user to potentially implement several different types of HOD models quickly, while using the population framework of this base class.

Attributes

Index The attribute giving the global index rank of each particle in the list.
attrs A dictionary storing relevant meta-data about the CatalogSource.
columns All columns in the CatalogSource, including those hard-coded into the class’s defintion and override columns provided by the user.
csize The total, collective size of the CatalogSource, i.e., summed across all ranks.
hardcolumns The union of the columns in the file and any transformed columns.
size The number of objects in the CatalogSource on the local rank.
use_cache If set to True, use the built-in caching features of dask to cache data in memory.

Methods

Position() Galaxy positions, in units of Mpc/h
Selection() A boolean column that selects a subset slice of the CatalogSource.
Value() When interpolating a CatalogSource on to a mesh, the value of this array is used as the Value that each particle contributes to a given mesh cell.
Velocity() Galaxy velocity, in units of km/s
VelocityOffset() The RSD velocity offset, in units of Mpc/h
Weight() The column giving the weight to use for each particle on the mesh.
compute(*args, **kwargs) Our version of dask.compute() that computes multiple delayed dask collections at once.
copy() Return a shallow copy of the object, where each column is a reference of the corresponding column in self.
get_hardcolumn(col) Return a column from the underlying data array/dict.
gslice(start, stop[, end, redistribute]) Execute a global slice of a CatalogSource.
make_column(array) Utility function to convert an array-like object to a dask.array.Array.
read(columns) Return the requested columns as dask arrays.
repopulate([seed]) Update the HOD parameters and then re-populate the mock catalog
save(output, columns[, datasets, header]) Save the CatalogSource to a bigfile.BigFile.
sort(keys[, reverse, usecols]) Return a CatalogSource, sorted globally across all MPI ranks in ascending order by the input keys.
to_mesh([Nmesh, BoxSize, dtype, interlaced, …]) Convert the CatalogSource to a MeshSource, using the specified parameters.
view([type]) Return a “view” of the CatalogSource object, with the returned type set by type.
Position()[source]

Galaxy positions, in units of Mpc/h

Velocity()[source]

Galaxy velocity, in units of km/s

VelocityOffset()[source]

The RSD velocity offset, in units of Mpc/h

This multiplies Velocity by 1 / (a*100*E(z)) = 1 / (a H(z)/h)

__makemodel__()[source]

Abstract class to be overwritten by user; this should return the HOD model instance that will be used to do the mock population.

See the documentation for more details.

Returns:the halotools object implementing the HOD model
Return type:HodModelFactory
__makesource__()[source]

Make the source of galaxies by performing the halo HOD population

Note

The mock population is only done by the root, and the resulting catalog is then distributed evenly amongst the available ranks

repopulate(seed=None, **params)[source]

Update the HOD parameters and then re-populate the mock catalog

Warning

This operation is done in-place, so the size of the Source changes

Parameters:
  • seed (int, optional) – the new seed to use when populating the mock
  • params – key/value pairs of HOD parameters to update
class nbodykit.source.catalog.hod.HODCatalog(halos, logMmin=13.031, sigma_logM=0.38, alpha=0.76, logM0=13.27, logM1=14.08, seed=None, use_cache=False, comm=None)[source]

A CatalogSource that uses the HOD prescription of Zheng et al 2007 to populate an input halo catalog with galaxies.

The mock population is done using halotools. See the documentation for halotools.empirical_models.Zheng07Cens and halotools.empirical_models.Zheng07Sats for further details regarding the HOD.

The columns generated in this catalog are:

  1. Position: the galaxy position
  2. Velocity: the galaxy velocity
  3. VelocityOffset: the RSD velocity offset, in units of distance
  4. conc_NFWmodel: the concentration of the halo
  5. gal_type: the galaxy type, 0 for centrals and 1 for satellites
  6. halo_id: the global ID of the halo this galaxy belongs to, between 0 and csize
  7. halo_local_id: the local ID of the halo this galaxy belongs to, between 0 and size
  8. halo_mvir: the halo mass
  9. halo_nfw_conc: alias of conc_NFWmodel
  10. halo_num_centrals: the number of centrals that this halo hosts, either 0 or 1
  11. halo_num_satellites: the number of satellites that this halo hosts
  12. halo_rvir: the halo radius
  13. halo_upid: equal to -1; should be ignored by the user
  14. halo_vx, halo_vy, halo_vz: the three components of the halo velocity
  15. halo_x, halo_y, halo_z: the three components of the halo position
  16. host_centric_distance: the distance from this galaxy to the center of the halo
  17. vx, vy, vz: the three components of the galaxy velocity, equal to Velocity
  18. x,y,z: the three components of the galaxy position, equal to Position

For futher details, please see the documentation.

Note

Default HOD values are from Reid et al. 2014

Parameters:
  • halos (UserSuppliedHaloCatalog) – the halotools table holding the halo data; this object must have the following attributes: cosmology, Lbox, redshift
  • logMmin (float, optional) – Minimum mass required for a halo to host a central galaxy
  • sigma_logM (float, optional) – Rate of transition from <Ncen>=0 –> <Ncen>=1
  • alpha (float, optional) – Power law slope of the relation between halo mass and <Nsat>
  • logM0 (float, optional) – Low-mass cutoff in <Nsat>
  • logM1 (float, optional) – Characteristic halo mass where <Nsat> begins to assume a power law form
  • seed (int, optional) – the random seed to generate deterministic mocks

References

Zheng et al. (2007), arXiv:0703457

Attributes

Index The attribute giving the global index rank of each particle in the list.
attrs A dictionary storing relevant meta-data about the CatalogSource.
columns All columns in the CatalogSource, including those hard-coded into the class’s defintion and override columns provided by the user.
csize The total, collective size of the CatalogSource, i.e., summed across all ranks.
hardcolumns The union of the columns in the file and any transformed columns.
size The number of objects in the CatalogSource on the local rank.
use_cache If set to True, use the built-in caching features of dask to cache data in memory.

Methods

Position() Galaxy positions, in units of Mpc/h
Selection() A boolean column that selects a subset slice of the CatalogSource.
Value() When interpolating a CatalogSource on to a mesh, the value of this array is used as the Value that each particle contributes to a given mesh cell.
Velocity() Galaxy velocity, in units of km/s
VelocityOffset() The RSD velocity offset, in units of Mpc/h
Weight() The column giving the weight to use for each particle on the mesh.
compute(*args, **kwargs) Our version of dask.compute() that computes multiple delayed dask collections at once.
copy() Return a shallow copy of the object, where each column is a reference of the corresponding column in self.
get_hardcolumn(col) Return a column from the underlying data array/dict.
gslice(start, stop[, end, redistribute]) Execute a global slice of a CatalogSource.
make_column(array) Utility function to convert an array-like object to a dask.array.Array.
read(columns) Return the requested columns as dask arrays.
repopulate([seed]) Update the HOD parameters and then re-populate the mock catalog
save(output, columns[, datasets, header]) Save the CatalogSource to a bigfile.BigFile.
sort(keys[, reverse, usecols]) Return a CatalogSource, sorted globally across all MPI ranks in ascending order by the input keys.
to_mesh([Nmesh, BoxSize, dtype, interlaced, …]) Convert the CatalogSource to a MeshSource, using the specified parameters.
view([type]) Return a “view” of the CatalogSource object, with the returned type set by type.
__makemodel__()[source]

Return the Zheng 07 HOD model.

This model evaluates Eqs. 2 and 5 of Zheng et al. 2007

nbodykit.source.catalog.hod.find_object_dtypes(data)[source]

Utility function to convert ‘O’ data types to strings

nbodykit.source.catalog.hod.gal_type_integers(galtab)[source]

Convert centrals to 0 and satellites to 1 in the input galaxy Table

This operatio is done in place