separated hdf5 and pickle outputs into different functions