mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 23:00:25 +01:00
enable idl_offsets in rwms method
This commit is contained in:
parent
02872bc461
commit
3381589617
1 changed files with 11 additions and 2 deletions
|
@ -23,6 +23,8 @@ def read_rwms(path, prefix, version='2.0', names=None, **kwargs):
|
||||||
list which contains the last config to be read for each replicum
|
list which contains the last config to be read for each replicum
|
||||||
postfix : str
|
postfix : str
|
||||||
postfix of the file to read, e.g. '.ms1' for openQCD-files
|
postfix of the file to read, e.g. '.ms1' for openQCD-files
|
||||||
|
idl_offsets : list
|
||||||
|
offsets to the idl range of obs. Useful for the case that the measurements of rwms are only starting at cfg. 20
|
||||||
"""
|
"""
|
||||||
known_oqcd_versions = ['1.4', '1.6', '2.0']
|
known_oqcd_versions = ['1.4', '1.6', '2.0']
|
||||||
if not (version in known_oqcd_versions):
|
if not (version in known_oqcd_versions):
|
||||||
|
@ -165,13 +167,20 @@ def read_rwms(path, prefix, version='2.0', names=None, **kwargs):
|
||||||
deltas[k].append(tmp_array[k][r_start[rep]:r_stop[rep]])
|
deltas[k].append(tmp_array[k][r_start[rep]:r_stop[rep]])
|
||||||
|
|
||||||
print(',', nrw, 'reweighting factors with', nsrc, 'sources')
|
print(',', nrw, 'reweighting factors with', nsrc, 'sources')
|
||||||
|
if "idl_offsets" in kwargs:
|
||||||
|
idl_offsets = kwargs.get("idl_offsets")
|
||||||
|
else:
|
||||||
|
idl_offsets = np.ones(nrw, dtype = int)
|
||||||
result = []
|
result = []
|
||||||
for t in range(nrw):
|
for t in range(nrw):
|
||||||
|
idl = []
|
||||||
|
for rep in range(replica):
|
||||||
|
idl.append(range(idl_offsets[rep],len(deltas[t][rep]+idl_offsets[rep])))
|
||||||
if names is None:
|
if names is None:
|
||||||
result.append(Obs(deltas[t], rep_names))
|
result.append(Obs(deltas[t], rep_names, idl = idl))
|
||||||
else:
|
else:
|
||||||
print(names)
|
print(names)
|
||||||
result.append(Obs(deltas[t], names))
|
result.append(Obs(deltas[t], names, idl = idl))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue