code: def cyl_to_spher(R,Z, phi):
      
      theta = nu.arctan2(R, Z)
      r = (R**2 + Z**2)**.5
      return (r,theta, phi)
docs: NAME:
  
         cyl_to_spher
  
      PURPOSE:
  
         convert from cylindrical to spherical coordinates
  
      INPUT:
  
         R, Z, phi- cylindrical coordinates
  
      OUTPUT:
  
         R, theta, phi - spherical coordinates
  
      HISTORY:
  
         2016-05-16 - Written - Aladdin