code: def save_hdf(self, filename, path='', overwrite=False, append=False):
          
          if os.path.exists(filename):
              with pd.HDFStore(filename) as store:
                  if path in store:
                      if overwrite:
                          os.remove(filename)
                      elif not append:
                          raise IOError('{} in {} exists.  Set either overwrite or append option.'.format(path,filename))
  
          if self.samples is not None:
              self.samples.to_hdf(filename, path+'/samples')
          else:
              pd.DataFrame().to_hdf(filename, path+'/samples')
  
          self.obs.save_hdf(filename, path+'/obs', append=True)
  
          with pd.HDFStore(filename) as store:
              # store = pd.HDFStore(filename)
              attrs = store.get_storer('{}/samples'.format(path)).attrs
  
              attrs.ic_type = type(self.ic)
              attrs.ic_bands = list(self.ic.bands)
              attrs.use_emcee = self.use_emcee
              if hasattr(self, '_mnest_basename'):
                  attrs._mnest_basename = self._mnest_basename
  
              attrs._bounds = self._bounds
              attrs._priors = self._priors
  
              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,
          :class:`ObservationTree` is saved to /obs location under given path.
  
          :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.