reposition_satellites_from_radial_vectors

halotools.utils.reposition_satellites_from_radial_vectors(satellite_position, orig_radial_vector, new_radial_vector, Lbox)[source] [edit on github]

Given original and new host-centric coordinates for satellites, reposition the satellites to their new spatial coordinates, accounting for periodic boundary conditions.

Parameters:

satellite_position : ndarray

Numpy array of shape (nsats, 3)

orig_radial_vector : ndarray

Numpy array of shape (nsats, 3)

new_radial_vector : ndarray

Numpy array of shape (nsats, 3)

Lbox : scalar or 3-element tuple

periodic boundary conditions

Returns:

new_satellite_position : ndarray

Numpy array of shape (nsats, 3)

Examples

>>> nsats = int(1e3)
>>> Lbox = 1
>>> satellite_position = np.random.uniform(0, Lbox, nsats*3).reshape((nsats, 3))
>>> orig_radial_vector = np.random.uniform(-0.1, 0.1, nsats*3).reshape((nsats, 3))
>>> new_radial_vector = np.random.uniform(-0.1, 0.1, nsats*3).reshape((nsats, 3))
>>> new_satellite_position = reposition_satellites_from_radial_vectors(satellite_position, orig_radial_vector, new_radial_vector, Lbox)