From a3a1df9027be11f1437f96361daad75cae0c894a Mon Sep 17 00:00:00 2001 From: fjosw Date: Tue, 7 Feb 2023 13:01:35 +0000 Subject: [PATCH] Documentation updated --- docs/pyerrors/input/openQCD.html | 394 ++++++++++++++++--------------- 1 file changed, 202 insertions(+), 192 deletions(-) diff --git a/docs/pyerrors/input/openQCD.html b/docs/pyerrors/input/openQCD.html index 9cef2ade..b8974f9d 100644 --- a/docs/pyerrors/input/openQCD.html +++ b/docs/pyerrors/input/openQCD.html @@ -1157,105 +1157,110 @@ 1061 found = [] 1062 files = [] 1063 names = [] -1064 for (dirpath, dirnames, filenames) in os.walk(path + "/"): -1065 found.extend(filenames) -1066 break +1064 +1065 if "names" in kwargs: +1066 names = kwargs.get("names") 1067 -1068 for f in found: -1069 if fnmatch.fnmatch(f, prefix + "*.ms5_xsf_" + qc + ".dat"): -1070 files.append(f) -1071 if not sep == "": -1072 names.append(prefix + "|r" + f.split(".")[0].split(sep)[1]) -1073 else: -1074 names.append(prefix) -1075 files = sorted(files) -1076 -1077 if "names" in kwargs: -1078 names = kwargs.get("names") -1079 else: -1080 names = sorted(names) -1081 -1082 cnfgs = [] -1083 realsamples = [] -1084 imagsamples = [] -1085 repnum = 0 -1086 for file in files: -1087 with open(path + "/" + file, "rb") as fp: -1088 -1089 t = fp.read(8) -1090 kappa = struct.unpack('d', t)[0] -1091 t = fp.read(8) -1092 csw = struct.unpack('d', t)[0] -1093 t = fp.read(8) -1094 dF = struct.unpack('d', t)[0] -1095 t = fp.read(8) -1096 zF = struct.unpack('d', t)[0] -1097 -1098 t = fp.read(4) -1099 tmax = struct.unpack('i', t)[0] -1100 t = fp.read(4) -1101 bnd = struct.unpack('i', t)[0] +1068 for (dirpath, dirnames, filenames) in os.walk(path + "/"): +1069 found.extend(filenames) +1070 break +1071 +1072 for f in found: +1073 if fnmatch.fnmatch(f, prefix + "*.ms5_xsf_" + qc + ".dat"): +1074 files.append(f) +1075 if "names" not in kwargs: +1076 if not sep == "": +1077 se = f.split(".")[0] +1078 for s in f.split(".")[1:-1]: +1079 se += "." + s +1080 names.append(se.split(sep)[0] + "|r" + se.split(sep)[1]) +1081 else: +1082 names.append(prefix) +1083 +1084 names = sorted(names) +1085 files = sorted(files) +1086 +1087 cnfgs = [] +1088 realsamples = [] +1089 imagsamples = [] +1090 repnum = 0 +1091 for file in files: +1092 with open(path + "/" + file, "rb") as fp: +1093 +1094 t = fp.read(8) +1095 kappa = struct.unpack('d', t)[0] +1096 t = fp.read(8) +1097 csw = struct.unpack('d', t)[0] +1098 t = fp.read(8) +1099 dF = struct.unpack('d', t)[0] +1100 t = fp.read(8) +1101 zF = struct.unpack('d', t)[0] 1102 -1103 placesBI = ["gS", "gP", -1104 "gA", "gV", -1105 "gVt", "lA", -1106 "lV", "lVt", -1107 "lT", "lTt"] -1108 placesBB = ["g1", "l1"] -1109 -1110 # the chunks have the following structure: -1111 # confignumber, 10x timedependent complex correlators as doubles, 2x timeindependent complex correlators as doubles -1112 -1113 chunksize = 4 + (8 * 2 * tmax * 10) + (8 * 2 * 2) -1114 packstr = '=i' + ('d' * 2 * tmax * 10) + ('d' * 2 * 2) -1115 cnfgs.append([]) -1116 realsamples.append([]) -1117 imagsamples.append([]) -1118 for t in range(tmax): -1119 realsamples[repnum].append([]) -1120 imagsamples[repnum].append([]) -1121 -1122 while True: -1123 cnfgt = fp.read(chunksize) -1124 if not cnfgt: -1125 break -1126 asascii = struct.unpack(packstr, cnfgt) -1127 cnfg = asascii[0] -1128 cnfgs[repnum].append(cnfg) -1129 -1130 if corr not in placesBB: -1131 tmpcorr = asascii[1 + 2 * tmax * placesBI.index(corr):1 + 2 * tmax * placesBI.index(corr) + 2 * tmax] -1132 else: -1133 tmpcorr = asascii[1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr):1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr) + 2] +1103 t = fp.read(4) +1104 tmax = struct.unpack('i', t)[0] +1105 t = fp.read(4) +1106 bnd = struct.unpack('i', t)[0] +1107 +1108 placesBI = ["gS", "gP", +1109 "gA", "gV", +1110 "gVt", "lA", +1111 "lV", "lVt", +1112 "lT", "lTt"] +1113 placesBB = ["g1", "l1"] +1114 +1115 # the chunks have the following structure: +1116 # confignumber, 10x timedependent complex correlators as doubles, 2x timeindependent complex correlators as doubles +1117 +1118 chunksize = 4 + (8 * 2 * tmax * 10) + (8 * 2 * 2) +1119 packstr = '=i' + ('d' * 2 * tmax * 10) + ('d' * 2 * 2) +1120 cnfgs.append([]) +1121 realsamples.append([]) +1122 imagsamples.append([]) +1123 for t in range(tmax): +1124 realsamples[repnum].append([]) +1125 imagsamples[repnum].append([]) +1126 +1127 while True: +1128 cnfgt = fp.read(chunksize) +1129 if not cnfgt: +1130 break +1131 asascii = struct.unpack(packstr, cnfgt) +1132 cnfg = asascii[0] +1133 cnfgs[repnum].append(cnfg) 1134 -1135 corrres = [[], []] -1136 for i in range(len(tmpcorr)): -1137 corrres[i % 2].append(tmpcorr[i]) -1138 for t in range(int(len(tmpcorr) / 2)): -1139 realsamples[repnum][t].append(corrres[0][t]) -1140 for t in range(int(len(tmpcorr) / 2)): -1141 imagsamples[repnum][t].append(corrres[1][t]) -1142 repnum += 1 -1143 -1144 s = "Read correlator " + corr + " from " + str(repnum) + " replika with " + str(len(realsamples[0][t])) -1145 for rep in range(1, repnum): -1146 s += ", " + str(len(realsamples[rep][t])) -1147 s += " samples" -1148 print(s) -1149 print("Asserted run parameters:\n T:", tmax, "kappa:", kappa, "csw:", csw, "dF:", dF, "zF:", zF, "bnd:", bnd) -1150 -1151 # we have the data now... but we need to re format the whole thing and put it into Corr objects. -1152 -1153 compObs = [] -1154 -1155 for t in range(int(len(tmpcorr) / 2)): -1156 compObs.append(CObs(Obs([realsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs), -1157 Obs([imagsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs))) -1158 -1159 if len(compObs) == 1: -1160 return compObs[0] -1161 else: -1162 return Corr(compObs) +1135 if corr not in placesBB: +1136 tmpcorr = asascii[1 + 2 * tmax * placesBI.index(corr):1 + 2 * tmax * placesBI.index(corr) + 2 * tmax] +1137 else: +1138 tmpcorr = asascii[1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr):1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr) + 2] +1139 +1140 corrres = [[], []] +1141 for i in range(len(tmpcorr)): +1142 corrres[i % 2].append(tmpcorr[i]) +1143 for t in range(int(len(tmpcorr) / 2)): +1144 realsamples[repnum][t].append(corrres[0][t]) +1145 for t in range(int(len(tmpcorr) / 2)): +1146 imagsamples[repnum][t].append(corrres[1][t]) +1147 repnum += 1 +1148 +1149 s = "Read correlator " + corr + " from " + str(repnum) + " replika with " + str(len(realsamples[0][t])) +1150 for rep in range(1, repnum): +1151 s += ", " + str(len(realsamples[rep][t])) +1152 s += " samples" +1153 print(s) +1154 print("Asserted run parameters:\n T:", tmax, "kappa:", kappa, "csw:", csw, "dF:", dF, "zF:", zF, "bnd:", bnd) +1155 +1156 # we have the data now... but we need to re format the whole thing and put it into Corr objects. +1157 +1158 compObs = [] +1159 +1160 for t in range(int(len(tmpcorr) / 2)): +1161 compObs.append(CObs(Obs([realsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs), +1162 Obs([imagsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs))) +1163 +1164 if len(compObs) == 1: +1165 return compObs[0] +1166 else: +1167 return Corr(compObs) @@ -2349,105 +2354,110 @@ projection to the topological charge sector defined by target 1062 found = [] 1063 files = [] 1064 names = [] -1065 for (dirpath, dirnames, filenames) in os.walk(path + "/"): -1066 found.extend(filenames) -1067 break +1065 +1066 if "names" in kwargs: +1067 names = kwargs.get("names") 1068 -1069 for f in found: -1070 if fnmatch.fnmatch(f, prefix + "*.ms5_xsf_" + qc + ".dat"): -1071 files.append(f) -1072 if not sep == "": -1073 names.append(prefix + "|r" + f.split(".")[0].split(sep)[1]) -1074 else: -1075 names.append(prefix) -1076 files = sorted(files) -1077 -1078 if "names" in kwargs: -1079 names = kwargs.get("names") -1080 else: -1081 names = sorted(names) -1082 -1083 cnfgs = [] -1084 realsamples = [] -1085 imagsamples = [] -1086 repnum = 0 -1087 for file in files: -1088 with open(path + "/" + file, "rb") as fp: -1089 -1090 t = fp.read(8) -1091 kappa = struct.unpack('d', t)[0] -1092 t = fp.read(8) -1093 csw = struct.unpack('d', t)[0] -1094 t = fp.read(8) -1095 dF = struct.unpack('d', t)[0] -1096 t = fp.read(8) -1097 zF = struct.unpack('d', t)[0] -1098 -1099 t = fp.read(4) -1100 tmax = struct.unpack('i', t)[0] -1101 t = fp.read(4) -1102 bnd = struct.unpack('i', t)[0] +1069 for (dirpath, dirnames, filenames) in os.walk(path + "/"): +1070 found.extend(filenames) +1071 break +1072 +1073 for f in found: +1074 if fnmatch.fnmatch(f, prefix + "*.ms5_xsf_" + qc + ".dat"): +1075 files.append(f) +1076 if "names" not in kwargs: +1077 if not sep == "": +1078 se = f.split(".")[0] +1079 for s in f.split(".")[1:-1]: +1080 se += "." + s +1081 names.append(se.split(sep)[0] + "|r" + se.split(sep)[1]) +1082 else: +1083 names.append(prefix) +1084 +1085 names = sorted(names) +1086 files = sorted(files) +1087 +1088 cnfgs = [] +1089 realsamples = [] +1090 imagsamples = [] +1091 repnum = 0 +1092 for file in files: +1093 with open(path + "/" + file, "rb") as fp: +1094 +1095 t = fp.read(8) +1096 kappa = struct.unpack('d', t)[0] +1097 t = fp.read(8) +1098 csw = struct.unpack('d', t)[0] +1099 t = fp.read(8) +1100 dF = struct.unpack('d', t)[0] +1101 t = fp.read(8) +1102 zF = struct.unpack('d', t)[0] 1103 -1104 placesBI = ["gS", "gP", -1105 "gA", "gV", -1106 "gVt", "lA", -1107 "lV", "lVt", -1108 "lT", "lTt"] -1109 placesBB = ["g1", "l1"] -1110 -1111 # the chunks have the following structure: -1112 # confignumber, 10x timedependent complex correlators as doubles, 2x timeindependent complex correlators as doubles -1113 -1114 chunksize = 4 + (8 * 2 * tmax * 10) + (8 * 2 * 2) -1115 packstr = '=i' + ('d' * 2 * tmax * 10) + ('d' * 2 * 2) -1116 cnfgs.append([]) -1117 realsamples.append([]) -1118 imagsamples.append([]) -1119 for t in range(tmax): -1120 realsamples[repnum].append([]) -1121 imagsamples[repnum].append([]) -1122 -1123 while True: -1124 cnfgt = fp.read(chunksize) -1125 if not cnfgt: -1126 break -1127 asascii = struct.unpack(packstr, cnfgt) -1128 cnfg = asascii[0] -1129 cnfgs[repnum].append(cnfg) -1130 -1131 if corr not in placesBB: -1132 tmpcorr = asascii[1 + 2 * tmax * placesBI.index(corr):1 + 2 * tmax * placesBI.index(corr) + 2 * tmax] -1133 else: -1134 tmpcorr = asascii[1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr):1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr) + 2] +1104 t = fp.read(4) +1105 tmax = struct.unpack('i', t)[0] +1106 t = fp.read(4) +1107 bnd = struct.unpack('i', t)[0] +1108 +1109 placesBI = ["gS", "gP", +1110 "gA", "gV", +1111 "gVt", "lA", +1112 "lV", "lVt", +1113 "lT", "lTt"] +1114 placesBB = ["g1", "l1"] +1115 +1116 # the chunks have the following structure: +1117 # confignumber, 10x timedependent complex correlators as doubles, 2x timeindependent complex correlators as doubles +1118 +1119 chunksize = 4 + (8 * 2 * tmax * 10) + (8 * 2 * 2) +1120 packstr = '=i' + ('d' * 2 * tmax * 10) + ('d' * 2 * 2) +1121 cnfgs.append([]) +1122 realsamples.append([]) +1123 imagsamples.append([]) +1124 for t in range(tmax): +1125 realsamples[repnum].append([]) +1126 imagsamples[repnum].append([]) +1127 +1128 while True: +1129 cnfgt = fp.read(chunksize) +1130 if not cnfgt: +1131 break +1132 asascii = struct.unpack(packstr, cnfgt) +1133 cnfg = asascii[0] +1134 cnfgs[repnum].append(cnfg) 1135 -1136 corrres = [[], []] -1137 for i in range(len(tmpcorr)): -1138 corrres[i % 2].append(tmpcorr[i]) -1139 for t in range(int(len(tmpcorr) / 2)): -1140 realsamples[repnum][t].append(corrres[0][t]) -1141 for t in range(int(len(tmpcorr) / 2)): -1142 imagsamples[repnum][t].append(corrres[1][t]) -1143 repnum += 1 -1144 -1145 s = "Read correlator " + corr + " from " + str(repnum) + " replika with " + str(len(realsamples[0][t])) -1146 for rep in range(1, repnum): -1147 s += ", " + str(len(realsamples[rep][t])) -1148 s += " samples" -1149 print(s) -1150 print("Asserted run parameters:\n T:", tmax, "kappa:", kappa, "csw:", csw, "dF:", dF, "zF:", zF, "bnd:", bnd) -1151 -1152 # we have the data now... but we need to re format the whole thing and put it into Corr objects. -1153 -1154 compObs = [] -1155 -1156 for t in range(int(len(tmpcorr) / 2)): -1157 compObs.append(CObs(Obs([realsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs), -1158 Obs([imagsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs))) -1159 -1160 if len(compObs) == 1: -1161 return compObs[0] -1162 else: -1163 return Corr(compObs) +1136 if corr not in placesBB: +1137 tmpcorr = asascii[1 + 2 * tmax * placesBI.index(corr):1 + 2 * tmax * placesBI.index(corr) + 2 * tmax] +1138 else: +1139 tmpcorr = asascii[1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr):1 + 2 * tmax * len(placesBI) + 2 * placesBB.index(corr) + 2] +1140 +1141 corrres = [[], []] +1142 for i in range(len(tmpcorr)): +1143 corrres[i % 2].append(tmpcorr[i]) +1144 for t in range(int(len(tmpcorr) / 2)): +1145 realsamples[repnum][t].append(corrres[0][t]) +1146 for t in range(int(len(tmpcorr) / 2)): +1147 imagsamples[repnum][t].append(corrres[1][t]) +1148 repnum += 1 +1149 +1150 s = "Read correlator " + corr + " from " + str(repnum) + " replika with " + str(len(realsamples[0][t])) +1151 for rep in range(1, repnum): +1152 s += ", " + str(len(realsamples[rep][t])) +1153 s += " samples" +1154 print(s) +1155 print("Asserted run parameters:\n T:", tmax, "kappa:", kappa, "csw:", csw, "dF:", dF, "zF:", zF, "bnd:", bnd) +1156 +1157 # we have the data now... but we need to re format the whole thing and put it into Corr objects. +1158 +1159 compObs = [] +1160 +1161 for t in range(int(len(tmpcorr) / 2)): +1162 compObs.append(CObs(Obs([realsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs), +1163 Obs([imagsamples[rep][t] for rep in range(repnum)], names=names, idl=cnfgs))) +1164 +1165 if len(compObs) == 1: +1166 return compObs[0] +1167 else: +1168 return Corr(compObs)