code: def mean_vector(lons, lats):
      
      xyz = sph2cart(lons, lats)
      xyz = np.vstack(xyz).T
      mean_vec = xyz.mean(axis=0)
      r_value = np.linalg.norm(mean_vec)
      mean_vec = cart2sph(*mean_vec)
      return mean_vec, r_value
docs: Returns the resultant vector from a series of longitudes and latitudes
  
      Parameters
      ----------
      lons : array-like
          A sequence of longitudes (in radians)
      lats : array-like
          A sequence of latitudes (in radians)
  
      Returns
      -------
      mean_vec : tuple
          (lon, lat) in radians
      r_value : number
          The magnitude of the resultant vector (between 0 and 1) This represents
          the degree of clustering in the data.