pynbody.analysis.halo.vel_center#
- pynbody.analysis.halo.vel_center(sim, cen_size='1 kpc', return_cen=False, move_all=True, **kwargs)[source]#
Recenter the snapshot on the center of mass velocity inside a sphere of specified radius
Attempts to use the star particles, falling back to gas or dark matter if necessary.
- Parameters:
sim (SimSnap) – The simulation snapshot to center
cen_size (str or float, optional) – The size of the sphere to use for the velocity centering. Default is 1 kpc.
return_cen (bool, optional) – If True, only return the velocity center without actually moving the snapshot. Default is False.
move_all (bool, optional) – If True (default), move the entire snapshot. Otherwise only move the particles in the halo passed in.
retcen (bool, optional) – Deprecated alias for return_cen
- Returns:
Normally, a transformation object that can be used to revert the transformation. However, if return_cen is True, a SimArray containing the velocity center coordinates is returned instead, and the snapshot is not transformed.
- Return type: