From 3b797a05598e541e1e81fdc214ecd7b8ddca9765 Mon Sep 17 00:00:00 2001 From: jkuhl-uni Date: Tue, 20 Dec 2022 15:47:36 +0100 Subject: [PATCH] better indexing --- pyerrors/input/openQCD.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyerrors/input/openQCD.py b/pyerrors/input/openQCD.py index 0a88dc18..0aa7ecb5 100644 --- a/pyerrors/input/openQCD.py +++ b/pyerrors/input/openQCD.py @@ -1074,8 +1074,8 @@ def read_ms5_xsf(path, prefix, qc, corr): tmpcorr = asascii[1+2*tmax*placesBI.index(corr):1+2*tmax*placesBI.index(corr)+2*tmax] corrres = [[],[]] for i in range(len(tmpcorr)): corrres[i%2].append(tmpcorr[i]) - for t in range(tmax): realsamples[t].append(corrres[0][t]) - for t in range(tmax): imagsamples[t].append(corrres[1][t]) + for t in range(int(len(tmpcorr)/2)): realsamples[t].append(corrres[0][t]) + for t in range(int(len(tmpcorr)/2)): imagsamples[t].append(corrres[1][t]) else: tmpcorr = asascii[1+2*tmax*len(placesBI):1+2*tmax*len(placesBI)+2] corrres = [[],[]] @@ -1084,7 +1084,7 @@ def read_ms5_xsf(path, prefix, qc, corr): realObs = [] imagObs = [] compObs = [] - for t in range(tmax): realObs.append(Obs([realsamples[t]], names = [prefix], idl = [cnfgs])) - for t in range(tmax): imagObs.append(Obs([imagsamples[t]], names = [prefix], idl = [cnfgs])) - for t in range(tmax): compObs.append(CObs(realObs[t], imagObs[t])) + for t in range(int(len(tmpcorr)/2)): realObs.append(Obs([realsamples[t]], names = [prefix], idl = [cnfgs])) + for t in range(int(len(tmpcorr)/2)): imagObs.append(Obs([imagsamples[t]], names = [prefix], idl = [cnfgs])) + for t in range(int(len(tmpcorr)/2)): compObs.append(CObs(realObs[t], imagObs[t])) return Corr(compObs) \ No newline at end of file