code: def calculate_mean(self, pars_for_mean, calculation_type):
          
  
          if len(pars_for_mean) == 0:
              return({})
  
          elif len(pars_for_mean) == 1:
              return ({"dec": float(pars_for_mean[0]['dec']), "inc": float(pars_for_mean[0]['inc']), "calculation_type": calculation_type, "n": 1})
  
  #        elif calculation_type =='Bingham':
  #            data=[]
  #            for pars in pars_for_mean:
  #                # ignore great circle
  #                if 'direction_type' in pars.keys() and 'direction_type'=='p':
  #                    continue
  #                else:
  #                    data.append([pars['dec'],pars['inc']])
  #            mpars=pmag.dobingham(data)
  
          elif calculation_type == 'Fisher':
              mpars = pmag.dolnp(pars_for_mean, 'direction_type')
  
          elif calculation_type == 'Fisher by polarity':
              mpars = pmag.fisher_by_pol(pars_for_mean)
              for key in list(mpars.keys()):
                  mpars[key]['n_planes'] = 0
                  mpars[key]['calculation_type'] = 'Fisher'
  
          mpars['calculation_type'] = calculation_type
  
          return mpars
docs: Uses pmag.dolnp or pmag.fisher_by_pol to do a fisher mean or fisher
          mean by polarity on the list of dictionaries in pars for mean
  
          Parameters
          ----------
          pars_for_mean : list of dictionaries with all data to average
          calculation_type : type of mean to take (options: Fisher,
          Fisher by polarity)
  
          Returns
          -------
          mpars : dictionary with information of mean or empty dictionary
  
          TODO : put Bingham statistics back in once a method for displaying
          them is figured out