docs: def aniso_magic_nb(infile='specimens.txt', samp_file='samples.txt', site_file='sites.txt', verbose=True,
                     ipar=False, ihext=True, ivec=False, isite=False, iloc=False, iboot=False, vec=0,
                     Dir=[], PDir=[], crd="s", num_bootstraps=1000, dir_path=".", fignum=1,
                     save_plots=True, interactive=False, fmt="png"):
      """
      Makes plots of anisotropy eigenvectors, eigenvalues and confidence bounds
      All directions are on the lower hemisphere.
  
      Parameters
      __________
          infile : specimens formatted file with aniso_s data
          samp_file : samples formatted file with sample => site relationship
          site_file : sites formatted file with site => location relationship
          verbose : if True, print messages to output
          confidence bounds options:
              ipar : if True - perform parametric bootstrap - requires non-blank aniso_s_sigma
              ihext : if True - Hext ellipses
              ivec : if True - plot bootstrapped eigenvectors instead of ellipses
              isite : if True plot by site, requires non-blank samp_file
              #iloc : if True plot by location, requires non-blank samp_file, and site_file  NOT IMPLEMENTED
              iboot : if True - bootstrap ellipses
          vec : eigenvector for comparison with Dir
          Dir : [Dec,Inc] list for comparison direction
          PDir : [Pole_dec, Pole_Inc] for pole to plane for comparison
                green dots are on the lower hemisphere, cyan are on the upper hemisphere
          crd : ['s','g','t'], coordinate system for plotting whereby:
              s : specimen coordinates, aniso_tile_correction = -1, or unspecified
              g : geographic coordinates, aniso_tile_correction = 0
              t : tilt corrected coordinates, aniso_tile_correction = 100
          num_bootstraps : how many bootstraps to do, default 1000
          dir_path : directory path
          fignum : matplotlib figure number, default 1
          save_plots : bool, default True
              if True, create and save all requested plots
          interactive : bool, default False
              interactively plot and display for each specimen
              (this is best used on the command line only)
          fmt : str, default "svg"
              format for figures, [svg, jpg, pdf, png]
  
      """
      figs = {}
      saved = []
      # make sure boolean values are in integer form
      # for backwards compatibility
      ipar = int(ipar)
      ihext = int(ihext)
      ivec = int(ivec)
      isite = int(isite)
      #iloc = int(iloc) # NOT USED
      iboot = int(iboot)
      # fix directory
      input_dir_path = os.path.realpath(dir_path)
      # initialize some variables
      version_num = pmag.get_version()
      hpars, bpars = [], []
      # set aniso_tilt_correction value
      CS = -1  # specimen
      if crd == 'g':
          CS = 0
      if crd == 't':
          CS = 100
  
      #
      #
      # read in the data
  
      fnames = {'specimens': infile, 'samples': samp_file, 'sites': site_file}
      con = cb.Contribution(input_dir_path, read_tables=['specimens', 'samples', 'sites', 'contribution'],
                            custom_filenames=fnames)
      # get contribution id if available
      con_id = ""
      if 'contribution' in con.tables:
          if 'id' in con.tables['contribution'].df.columns:
              con_id = str(con.tables['contribution'].df['id'].values[0])
      # get other data
      con.propagate_location_to_specimens()
      spec_container = con.tables['specimens']
      spec_df = spec_container.df
      # use only anisotropy records
      spec_df = spec_df.dropna(subset=['aniso_s']).copy()
      if 'aniso_tilt_correction' not in spec_df.columns:
          spec_df['aniso_tilt_correction'] = -1  # assume specimen coordinates
      if "aniso_s_n_measurements" not in spec_df.columns:
          spec_df["aniso_s_n_measurements"] = "6"
      if "aniso_s_sigma" not in spec_df.columns:
          spec_df["aniso_sigma"] = "0"
      orlist = spec_df['aniso_tilt_correction'].dropna().unique()
      if CS not in orlist:
          if len(orlist) > 0:
              CS = orlist[0]
          else:
              CS = -1
          if CS == -1:
              crd = 's'
          if CS == 0:
              crd = 'g'
          if CS == 100:
              crd = 't'
          if verbose:
              print("desired coordinate system not available, using available: ", crd)
      cs_df = spec_df[spec_df['aniso_tilt_correction'] == CS]
      if isite:
          sites = cs_df['site'].unique()
          for site in list(sites):
              site_df = cs_df[cs_df.site == site]
              loc = ""
              if 'sites' in con.tables:
                  if 'location' in con.tables['sites'].df.columns:
                      locs = con.tables['sites'].df.loc[site, 'location'].dropna()
                      if any(locs):
                          loc = locs.iloc[0]
              figs = plot_aniso(fignum, site_df, Dir=Dir, PDir=PDir, ipar=ipar,
                                ihext=ihext, ivec=ivec, iboot=iboot,
                                vec=vec, num_bootstraps=num_bootstraps, title=site)
              files = {key: loc + "_" + site +"_" + crd + "_aniso-" + key + ".png" for (key, value) in figs.items()}
              if pmagplotlib.isServer:
                  for key in figs.keys():
                      files[key] = "LO:_" + loc + "_SI:_" + site +  '_TY:_aniso_' + key + '_.' + fmt
                      titles = {}
                      titles['data'] = "Eigenvectors"
                      titles['tcdf'] = "Eigenvalue Confidence"
                      titles['conf'] = "Confidence Ellipses"
                      for key in figs:
                          if key not in titles:
                              titles[key] = key
                  pmagplotlib.add_borders(figs, titles, con_id=con_id)
              if save_plots:
                  saved.extend(pmagplotlib.save_plots(figs, files))
              elif interactive:
                  pmagplotlib.draw_figs(figs)
                  ans = pmagplotlib.save_or_quit()
                  if ans == 'a':
                      saved.extend(pmagplotlib.save_plots(figs, files))
                  else:
                      continue
              else:
                  fignum += 2
                  if iboot:
                      fignum += 1
                  if len(Dir) > 0:
                      fignum += 1
      else:
          figs = plot_aniso(fignum, cs_df, Dir=Dir, PDir=PDir, ipar=ipar, ihext=ihext,
                            ivec=ivec, iboot=iboot, vec=vec, num_bootstraps=num_bootstraps)
          try:
              locs = cs_df['location'].unique()
          except:
              locs = [""]
          locs = "-".join(locs)
          files = {key:  locs + "_" + crd + "_aniso-" + key + ".png" for (key, value) in figs.items()}
          if pmagplotlib.isServer:
              for key in figs.keys():
                  files[key] = 'MC:_' + con_id + '_TY:_aniso_' + key + '_.' + fmt
                  titles = {}
                  titles['data'] = "Eigenvectors"
                  titles['tcdf'] = "Eigenvalue Confidence"
                  titles['conf'] = "Confidence Ellipses"
                  for key in figs:
                      if key not in titles:
                          titles[key] = key
              pmagplotlib.add_borders(figs, titles, con_id=con_id)
          if save_plots:
              saved.extend(pmagplotlib.save_plots(figs, files))
          elif interactive:
              pmagplotlib.draw_figs(figs)
              ans = pmagplotlib.save_or_quit()
              if ans == 'a':
                  saved.extend(pmagplotlib.save_plots(figs, files))
      return True, saved