docs: def process_data_for_mean(data, direction_type_key):
      """
      takes list of dicts with dec and inc as well as direction_type if possible or method_codes and sorts the data into lines and planes and process it for fisher means
  
      @param: data - list of dicts with dec inc and some manner of PCA type info
      @param: direction_type_key - key that indicates the direction type variable in the dictionaries of data
      @return: tuple with values - (
                                  list of lists with [dec, inc, 1.] for all lines
                                  number of line
                                  list of lists with [EL,EM,EN] of all planes
                                  number of planes
                                  list of sum of the cartezian components of all lines
                                  )
      """
      dec_key, inc_key, meth_key = 'dec', 'inc', 'magic_method_codes'  # data model 2.5
      if 'dir_dec' in data[0].keys():  # this is data model 3.0
          dec_key, inc_key, meth_key = 'dir_dec', 'dir_inc', 'method_codes'
  
      n_lines, n_planes = 0, 0
      L, fdata = [], []
      E = [0, 0, 0]
  
      # sort data  into lines and planes and collect cartesian coordinates
      for rec in data:
          cart = dir2cart([float(rec[dec_key]), float(rec[inc_key])])[0]
          if direction_type_key in list(rec.keys()):
              if rec[direction_type_key] == 'p':  # this is a pole to a plane
                  n_planes += 1
                  L.append(cart)  # this is the "EL, EM, EN" array of MM88
              else:  # this is a line
                  n_lines += 1
                  # collect data for fisher calculation
                  fdata.append([float(rec[dec_key]), float(rec[inc_key]), 1.])
                  E[0] += cart[0]
                  E[1] += cart[1]
                  E[2] += cart[2]
          elif 'method_codes' in list(rec.keys()):
              if "DE-BFP" in rec[meth_key]:  # this is a pole to a plane
                  n_planes += 1
                  L.append(cart)  # this is the "EL, EM, EN" array of MM88
              else:  # this is a line
                  n_lines += 1
                  # collect data for fisher calculation
                  fdata.append([rec[dec_key], rec[inc_key], 1.])
                  E[0] += cart[0]
                  E[1] += cart[1]
                  E[2] += cart[2]
          elif meth_key in list(rec.keys()):
              if "DE-BFP" in rec[meth_key]:  # this is a pole to a plane
                  n_planes += 1
                  L.append(cart)  # this is the "EL, EM, EN" array of MM88
              else:  # this is a line
                  n_lines += 1
                  # collect data for fisher calculation
                  fdata.append([rec[dec_key], rec[inc_key], 1.])
                  E[0] += cart[0]
                  E[1] += cart[1]
                  E[2] += cart[2]
          else:
                  # EVERYTHING IS A LINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
              n_lines += 1
              # collect data for fisher calculation
              fdata.append([rec[dec_key], rec[inc_key], 1.])
              E[0] += cart[0]
              E[1] += cart[1]
              E[2] += cart[2]
  
      return fdata, n_lines, L, n_planes, E