Mock Universe and Mock Halo Functions

Mock universe generator

The mock_uni module contains a function based on the third-party nbodykit package to generate a mock Universe whose density distribution is lognormal-distributed given an input redshift, box size and dark matter number density.

Note

Additional package to install: nbodykit.

mock_tools.mock_uni.createLogNormUni(L_BOX, nbar, redshift, Nmesh, UNIT_MASS)[source]

Create mock simulation box by Poisson-sampling a lognormal density distribution

The Poisson-sampled distribution is evolved according to the Zeldovich (1LPT) prescription up until redshift redshift under the constraint of an ‘EisensteinHu’ power spectrum

Parameters
  • L_BOX (float) – size of to-be-obtained simulation box

  • nbar (float) – number density of points (i.e. sampling density / resolution) in box, units: 1/(Mpc/h)**3 Note: nbar is assumed to be constant across the box

  • redshift (float) – redshift of interest

  • Nmesh (int) – the mesh size to use when generating the density and displacement fields, which are Poisson-sampled to particles

  • UNIT_MASS (float) – in units of solar masses / h. Returned masses will have units UNIT_MASS*(solar_mass)/h

Returns

total number of particles, xyz-coordinates of DM particles, xyz-values of DM particle velocities, masses of the DM particles (all identical)

Return type

int, (N,) floats, (N,) floats, (N,) floats, (N,) floats, (N,) floats, (N,) floats, (N,) floats

Mock halo generator

The mock_halo_gen module provides a function to generate mock halos given a total mass and resolution as well as halo density and shape profile specifications.

mock_tools.mock_halo_gen.genHalo(tot_mass, res, model_pars, profile, a, b, c)[source]

Mock halo generator

Create mock halo of mass tot_mass consisting of approximately res particles. The model_pars array contains the parameters for the profile model given in profile.

Parameters
  • tot_mass (float) – total target mass of halo, in units of M_sun*h^2/Mpc^3

  • res (int) – halo resolution

  • model_pars (dictionary of length 4, 2 or 1) – parameters (except for rho_s which will be deduced from tot_mass) in density profile model

  • a (float array, units are Mpc/h) – major axis array

  • b (float array, units are Mpc/h) – intermediate axis array

  • c (float array, units are Mpc/h) – minor axis array

Returns

halo_x, halo_y, halo_z: arrays containing positions of halo particles, mass_ptc: mass of each DM ptc in units of M_sun/h, rho_s: rho_s parameter in profile model

Return type

3 (N,) float arrays, 2 floats