code: def galcencyl_to_XYZ(R,phi,Z,Xsun=1.,Zsun=0.,_extra_rot=True):
      
      Xr,Yr,Zr= cyl_to_rect(R,phi,Z)
      return galcenrect_to_XYZ(Xr,Yr,Zr,Xsun=Xsun,Zsun=Zsun,
                               _extra_rot=_extra_rot)
docs: NAME:
  
         galcencyl_to_XYZ
  
      PURPOSE:
  
         transform cylindrical Galactocentric coordinates to XYZ coordinates (wrt Sun)
  
      INPUT:
  
         R, phi, Z - Galactocentric cylindrical coordinates
  
         Xsun - cylindrical distance to the GC (can be array of same length as R)
         
         Zsun - Sun's height above the midplane (can be array of same length as R)
  
         _extra_rot= (True) if True, perform an extra tiny rotation to align the Galactocentric coordinate frame with astropy's definition
  
      OUTPUT:
  
         X,Y,Z
  
      HISTORY:
  
         2011-02-23 - Written - Bovy (NYU)
  
         2017-10-24 - Allowed Xsun/Zsun to be arrays - Bovy (UofT)