docs: def dokent(data, NN):
      """
      gets Kent  parameters for data
      Parameters
      ___________________
      data :  nested pairs of [Dec,Inc]
      NN  : normalization
          NN is the number of data for Kent ellipse
          NN is 1 for Kent ellipses of bootstrapped mean directions
  
      Return
      kpars dictionary keys
          dec : mean declination
          inc : mean inclination
          n : number of datapoints
          Eta : major ellipse
          Edec : declination of major ellipse axis
          Einc : inclination of major ellipse axis
          Zeta : minor ellipse
          Zdec : declination of minor ellipse axis
          Zinc : inclination of minor ellipse axis
      """
      X, kpars = [], {}
      N = len(data)
      if N < 2:
          return kpars
  #
  #  get fisher mean and convert to co-inclination (theta)/dec (phi) in radians
  #
      fpars = fisher_mean(data)
      pbar = fpars["dec"] * np.pi / 180.
      tbar = (90. - fpars["inc"]) * np.pi / 180.
  #
  #   initialize matrices
  #
      H = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
      w = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
      b = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
      gam = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
      xg = []
  #
  #  set up rotation matrix H
  #
      H = [[np.cos(tbar) * np.cos(pbar), -np.sin(pbar), np.sin(tbar) * np.cos(pbar)], [np.cos(tbar)
                                                                                       * np.sin(pbar), np.cos(pbar), np.sin(pbar) * np.sin(tbar)], [-np.sin(tbar), 0., np.cos(tbar)]]
  #
  #  get cartesian coordinates of data
  #
      for rec in data:
          X.append(dir2cart([rec[0], rec[1], 1.]))
  #
  #   put in T matrix
  #
      T = Tmatrix(X)
      for i in range(3):
          for j in range(3):
              T[i][j] = old_div(T[i][j], float(NN))
  #
  # compute B=H'TH
  #
      for i in range(3):
          for j in range(3):
              for k in range(3):
                  w[i][j] += T[i][k] * H[k][j]
      for i in range(3):
          for j in range(3):
              for k in range(3):
                  b[i][j] += H[k][i] * w[k][j]
  #
  # choose a rotation w about North pole to diagonalize upper part of B
  #
      psi = 0.5 * np.arctan(2. * b[0][1] / (b[0][0] - b[1][1]))
      w = [[np.cos(psi), -np.sin(psi), 0],
           [np.sin(psi), np.cos(psi), 0], [0., 0., 1.]]
      for i in range(3):
          for j in range(3):
              gamtmp = 0.
              for k in range(3):
                  gamtmp += H[i][k] * w[k][j]
              gam[i][j] = gamtmp
      for i in range(N):
          xg.append([0., 0., 0.])
          for k in range(3):
              xgtmp = 0.
              for j in range(3):
                  xgtmp += gam[j][k] * X[i][j]
              xg[i][k] = xgtmp
  # compute asymptotic ellipse parameters
  #
      xmu, sigma1, sigma2 = 0., 0., 0.
      for i in range(N):
          xmu += xg[i][2]
          sigma1 = sigma1 + xg[i][0]**2
          sigma2 = sigma2 + xg[i][1]**2
      xmu = old_div(xmu, float(N))
      sigma1 = old_div(sigma1, float(N))
      sigma2 = old_div(sigma2, float(N))
      g = -2.0 * np.log(0.05) / (float(NN) * xmu**2)
      if np.sqrt(sigma1 * g) < 1:
          eta = np.arcsin(np.sqrt(sigma1 * g))
      if np.sqrt(sigma2 * g) < 1:
          zeta = np.arcsin(np.sqrt(sigma2 * g))
      if np.sqrt(sigma1 * g) >= 1.:
          eta = old_div(np.pi, 2.)
      if np.sqrt(sigma2 * g) >= 1.:
          zeta = old_div(np.pi, 2.)
  #
  #  convert Kent parameters to directions,angles
  #
      kpars["dec"] = fpars["dec"]
      kpars["inc"] = fpars["inc"]
      kpars["n"] = NN
      ZDir = cart2dir([gam[0][1], gam[1][1], gam[2][1]])
      EDir = cart2dir([gam[0][0], gam[1][0], gam[2][0]])
      kpars["Zdec"] = ZDir[0]
      kpars["Zinc"] = ZDir[1]
      kpars["Edec"] = EDir[0]
      kpars["Einc"] = EDir[1]
      if kpars["Zinc"] < 0:
          kpars["Zinc"] = -kpars["Zinc"]
          kpars["Zdec"] = (kpars["Zdec"] + 180.) % 360.
      if kpars["Einc"] < 0:
          kpars["Einc"] = -kpars["Einc"]
          kpars["Edec"] = (kpars["Edec"] + 180.) % 360.
      kpars["Zeta"] = zeta * 180. / np.pi
      kpars["Eta"] = eta * 180. / np.pi
      return kpars