mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
infos parsed and added as tag in hadrons.read_meson_hd5
This commit is contained in:
parent
61cd8d9415
commit
3466558c94
1 changed files with 7 additions and 1 deletions
|
@ -64,11 +64,15 @@ def read_meson_hd5(path, filestem, ens_id, meson='meson_0', tree='meson'):
|
||||||
files = _get_files(path, filestem)
|
files = _get_files(path, filestem)
|
||||||
|
|
||||||
corr_data = []
|
corr_data = []
|
||||||
|
infos = []
|
||||||
for hd5_file in files:
|
for hd5_file in files:
|
||||||
file = h5py.File(path + '/' + hd5_file, "r")
|
file = h5py.File(path + '/' + hd5_file, "r")
|
||||||
raw_data = list(file[tree + '/' + meson + '/corr'])
|
raw_data = list(file[tree + '/' + meson + '/corr'])
|
||||||
real_data = [o[0] for o in raw_data]
|
real_data = [o[0] for o in raw_data]
|
||||||
corr_data.append(real_data)
|
corr_data.append(real_data)
|
||||||
|
if not infos:
|
||||||
|
for k, i in file[tree + '/' + meson].attrs.items():
|
||||||
|
infos.append(k + ': ' + i[0].decode())
|
||||||
file.close()
|
file.close()
|
||||||
corr_data = np.array(corr_data)
|
corr_data = np.array(corr_data)
|
||||||
|
|
||||||
|
@ -76,7 +80,9 @@ def read_meson_hd5(path, filestem, ens_id, meson='meson_0', tree='meson'):
|
||||||
for c in corr_data.T:
|
for c in corr_data.T:
|
||||||
l_obs.append(Obs([c], [ens_id]))
|
l_obs.append(Obs([c], [ens_id]))
|
||||||
|
|
||||||
return Corr(l_obs)
|
corr = Corr(l_obs)
|
||||||
|
corr.tag = ", ".join(infos)
|
||||||
|
return corr
|
||||||
|
|
||||||
|
|
||||||
def read_ExternalLeg_hd5(path, filestem, ens_id, order='F'):
|
def read_ExternalLeg_hd5(path, filestem, ens_id, order='F'):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue