galpy.util.coords.vxvyvz_to_galcenrect(vx, vy, vz, vsun=[0.0, 1.0, 0.0], Xsun=1.0, Zsun=0.0, _extra_rot=True)[source]

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

  • vx (float or numpy.ndarray) – U velocity.

  • vy (float or numpy.ndarray) – V velocity.

  • vz (float or numpy.ndarray) – W velocity.

  • vsun (float or numpy.ndarray, optional) – Velocity of the Sun in the GC frame (can also be array of same length as vx; 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.


Containing (vx,vy,vz)

Return type:



  • 2010-09-24 - Written - Bovy (NYU)

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

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

  • 2023-07-23 - Allowed Xsun/Zsun/vsun to be arrays- Bovy (UofT)