additional check on momentum of ExternalLeg added

This commit is contained in:
Fabian Joswig 2021-10-20 11:56:54 +01:00
parent d8c4f03a07
commit 34ed2588aa

View file

@ -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)