galpy.util.coords.galcenrect_to_vxvyvz

galpy.util.coords.galcenrect_to_vxvyvz(vXg, vYg, vZg, vsun=[0.0, 1.0, 0.0], Xsun=1.0, Zsun=0.0, _extra_rot=True)[source]

Transform rectangular Galactocentric coordinates to XYZ coordinates (wrt Sun) for velocities

Parameters:
  • vXg (float or numpy.ndarray) – Galactocentric x-velocity.

  • vYg (float or numpy.ndarray) – Galactocentric y-velocity.

  • vZg (float or numpy.ndarray) – Galactocentric z-velocity.

  • vsun (float or numpy.ndarray, optional) – Velocity of the Sun in the GC frame (can also be array of same length as vXg; shape [3,N]).

  • Xsun (float or numpy.ndarray, optional) – Cylindrical distance to the GC (can be array of same length as vXg).

  • Zsun (float or numpy.ndarray, optional) – Sun’s height above the midplane (can be array of same length as vXg).

  • _extra_rot (bool, optional) – If True, perform an extra tiny rotation to align the Galactocentric coordinate frame with astropy’s definition.

Returns:

Containing (vx,vy,vz)

Return type:

numpy.ndarray

Notes

  • 2011-02-24 - Written - Bovy (NYU)

  • 2016-05-12 - Edited to properly take into account the Sun’s vertical position; dropped Ysun keyword - Bovy (UofT)

  • 2017-10-24 - Allowed Xsun/Zsun/vsun to be arrays - Bovy (UofT)

  • 2018-04-18 - Tweaked to be consistent with astropy’s Galactocentric frame - Bovy (UofT)