code: def Rz_to_coshucosv(R,z,delta=1.,oblate=False):
      
      if oblate:
          d12= (R+delta)**2.+z**2.
          d22= (R-delta)**2.+z**2.
      else:
          d12= (z+delta)**2.+R**2.
          d22= (z-delta)**2.+R**2.
      coshu= 0.5/delta*(sc.sqrt(d12)+sc.sqrt(d22))
      cosv=  0.5/delta*(sc.sqrt(d12)-sc.sqrt(d22))
      if oblate: # cosv is currently really sinv
          cosv= sc.sqrt(1.-cosv**2.)
      return (coshu,cosv)
docs: NAME:
  
         Rz_to_coshucosv
  
      PURPOSE:
  
         calculate prolate confocal cosh(u) and cos(v) coordinates from R,z, and delta
  
      INPUT:
  
         R - radius
  
         z - height
  
         delta= focus
  
         oblate= (False) if True, compute oblate confocal coordinates instead of prolate
      OUTPUT:
  
         (cosh(u),cos(v))
  
      HISTORY:
  
         2012-11-27 - Written - Bovy (IAS)
  
         2017-10-11 - Added oblate coordinates - Bovy (UofT)