enforce_periodicity_of_box

halotools.empirical_models.enforce_periodicity_of_box(coords, box_length, check_multiple_box_lengths=False, **kwargs)[source] [edit on github]

Function used to apply periodic boundary conditions of the simulation, so that mock galaxies all lie in the range [0, Lbox].

Parameters:

coords : array_like

float or ndarray containing a set of points with values ranging between [-box_length, 2*box_length]

box_length : float

the size of simulation box (currently hard-coded to be Mpc/h units)

velocity : array_like, optional

velocity in the same dimension as the input coords.

check_multiple_box_lengths : bool, optional

If True, an exception will be raised if the points span a range of more than 2Lbox. Default is False.

Returns:

periodic_coords : array_like

array with values and shape equal to input coords, but with periodic boundary conditions enforced