From 34ed2588aa8de62f20824fd8d8b4824572efa4bf Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Wed, 20 Oct 2021 11:56:54 +0100 Subject: [PATCH] additional check on momentum of ExternalLeg added --- pyerrors/input/hadrons.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)