diff --git a/pyerrors/input/hadrons.py b/pyerrors/input/hadrons.py index 4bdb177f..a9e220b9 100644 --- a/pyerrors/input/hadrons.py +++ b/pyerrors/input/hadrons.py @@ -85,15 +85,20 @@ def read_ExternalLeg_hd5(path, filestem, ens_id, order='F'): files = _get_files(path, filestem) + mom = None + corr_data = [] for hd5_file in files: file = h5py.File(path + '/' + hd5_file, "r") raw_data = file['ExternalLeg/corr'][0][0].view('complex') corr_data.append(raw_data) + if mom is not None: + assert np.allclose(mom, np.array(str(file['ExternalLeg/info'].attrs['pIn'])[3:-2].strip().split(' '), dtype=int)) + else: + mom = np.array(str(file['ExternalLeg/info'].attrs['pIn'])[3:-2].strip().split(' '), dtype=int) file.close() corr_data = np.array(corr_data) - mom = np.array(str(file['ExternalLeg/info'].attrs['pIn'])[3:-2].strip().split(' '), dtype=int) rolled_array = np.rollaxis(corr_data, 0, 5)