save samples in hdf5