code: def save_hdf(self, filename, path='', overwrite=False, append=False):
          
          
          if os.path.exists(filename):
              store = pd.HDFStore(filename)
              if path in store:
                  store.close()
                  if overwrite:
                      os.remove(filename)
                  elif not append:
                      raise IOError('{} in {} exists.  Set either overwrite or append option.'.format(path,filename))
              else:
                  store.close()
  
          self.samples.to_hdf(filename, '{}/samples'.format(path))
  
          store = pd.HDFStore(filename)
          attrs = store.get_storer('{}/samples'.format(path)).attrs
          attrs.properties = self.properties
          attrs.ic_type = type(self.ic)
          attrs.maxAV = self.maxAV
          attrs.max_distance = self.max_distance
          attrs.min_logg = self.min_logg
  
          attrs.use_emcee = self.use_emcee
          attrs._mnest_basename = self._mnest_basename
  
          attrs.name = self.name
  
          store.close()
docs: Saves object data to HDF file (only works if MCMC is run)
  
          Samples are saved to /samples location under given path,
          and object properties are also attached, so suitable for
          re-loading via :func:`StarModel.load_hdf`.
          
          :param filename:
              Name of file to save to.  Should be .h5 file.
  
          :param path: (optional)
              Path within HDF file structure to save to.
  
          :param overwrite: (optional)
              If ``True``, delete any existing file by the same name
              before writing.
  
          :param append: (optional)
              If ``True``, then if a file exists, then just the path
              within the file will be updated.