docs: def doaniscorr(PmagSpecRec, AniSpec):
      """
      takes the 6 element 's' vector and the Dec,Inc, Int 'Dir' data,
      performs simple anisotropy correction. returns corrected Dec, Inc, Int
      """
      AniSpecRec = {}
      for key in list(PmagSpecRec.keys()):
          AniSpecRec[key] = PmagSpecRec[key]
      Dir = np.zeros((3), 'f')
      Dir[0] = float(PmagSpecRec["specimen_dec"])
      Dir[1] = float(PmagSpecRec["specimen_inc"])
      Dir[2] = float(PmagSpecRec["specimen_int"])
  # check if F test passes!  if anisotropy_sigma available
      chi, chi_inv = check_F(AniSpec)
      if chi[0][0] == 1.:  # isotropic
          cDir = [Dir[0], Dir[1]]  # no change
          newint = Dir[2]
      else:
          X = dir2cart(Dir)
          M = np.array(X)
          H = np.dot(M, chi_inv)
          cDir = cart2dir(H)
          Hunit = [old_div(H[0], cDir[2]), old_div(H[1], cDir[2]), old_div(
              H[2], cDir[2])]  # unit vector parallel to Banc
          Zunit = [0, 0, -1.]  # unit vector parallel to lab field
          Hpar = np.dot(chi, Hunit)  # unit vector applied along ancient field
          Zpar = np.dot(chi, Zunit)  # unit vector applied along lab field
          # intensity of resultant vector from ancient field
          HparInt = cart2dir(Hpar)[2]
          # intensity of resultant vector from lab field
          ZparInt = cart2dir(Zpar)[2]
          newint = Dir[2] * ZparInt / HparInt
          if cDir[0] - Dir[0] > 90:
              cDir[1] = -cDir[1]
              cDir[0] = (cDir[0] - 180.) % 360.
      AniSpecRec["specimen_dec"] = '%7.1f' % (cDir[0])
      AniSpecRec["specimen_inc"] = '%7.1f' % (cDir[1])
      AniSpecRec["specimen_int"] = '%9.4e' % (newint)
      AniSpecRec["specimen_correction"] = 'c'
      if 'magic_method_codes' in list(AniSpecRec.keys()):
          methcodes = AniSpecRec["magic_method_codes"]
      else:
          methcodes = ""
      if methcodes == "":
          methcodes = "DA-AC-" + AniSpec['anisotropy_type']
      if methcodes != "":
          methcodes = methcodes + ":DA-AC-" + AniSpec['anisotropy_type']
      if chi[0][0] == 1.:  # isotropic
          # indicates anisotropy was checked and no change necessary
          methcodes = methcodes + ':DA-AC-ISO'
      AniSpecRec["magic_method_codes"] = methcodes.strip(":")
      return AniSpecRec