galpy.util.coords.galcenrect_to_XYZ

galpy.util.coords.galcenrect_to_XYZ(X, Y, Z, Xsun=1.0, Zsun=0.0, _extra_rot=True)[source]

Transform rectangular Galactocentric to XYZ coordinates (wrt Sun) coordinates.

Parameters:
  • X (float or numpy.ndarray) – Galactocentric rectangular coordinate.

  • Y (float or numpy.ndarray) – Galactocentric rectangular coordinate.

  • Z (float or numpy.ndarray) – Galactocentric rectangular coordinate.

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

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

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

Returns:

Containing (X,Y,Z)

Return type:

numpy.ndarray

Notes

  • 2011-02-23 - 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 to be arrays - Bovy (UofT)

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