code: def get_sb_df(df, mm97=False):
      
      df['delta'] = 90.-df.vgp_lat
      Sp2 = np.sum(df.delta**2)/(df.shape[0]-1)
      if 'dir_k' in df.columns and mm97:
          ks = df.dir_k
          Ns = df.dir_n
          Ls = np.radians(df.lat)
          A95s = 140./np.sqrt(ks*Ns)
          Sw2_n = 0.335*(A95s**2)*(2.*(1.+3.*np.sin(Ls)**2) /
                                   (5.-3.*np.sin(Ls)**2))
          return np.sqrt(Sp2-Sw2_n.mean())
      else:
          return np.sqrt(Sp2)
docs: Calculates Sf for a dataframe with VGP Lat., and optional Fisher's k, site latitude and N information can be used to correct for within site scatter (McElhinny & McFadden, 1997)
  
      Parameters
      _________
      df : Pandas Dataframe with columns
          REQUIRED:
          vgp_lat :  VGP latitude
          ONLY REQUIRED for MM97 correction:
          dir_k : Fisher kappa estimate
          dir_n : number of specimens (samples) per site
          lat : latitude of the site
      mm97 : if True, will do the correction for within site scatter
  
      Returns:
      _______
      Sf : Sf