code: def save_to_eitdir(self, directory):
          
          if os.path.isdir(directory):
              raise Exception('output directory already exists')
  
          os.makedirs(directory)
          np.savetxt(directory + os.sep + 'frequencies.dat', self.frequencies)
  
          invmod_dir = directory + os.sep + 'invmod'
          os.makedirs(invmod_dir)
          for nr, key in enumerate(sorted(self.tds.keys())):
              outdir = invmod_dir + os.sep + '{0:02}_{1:.6f}'.format(nr, key)
              self.tds[key].save_to_tomodir(outdir)
docs: Save the eit data into a eit/sip directory structure
  
          Parameters
          ----------
          directory: string|path
              output directory