Commit 13a16edf authored by 3Yan's avatar 3Yan
Browse files

DRL evolution - pt2

* Loading multicorrections
parent 419704a2
......@@ -314,12 +314,13 @@ def load_drltables(parent, dataset, drls, drlspectrum):
start_masses = []
end_masses = []
states = []
corrected_to = []
corr_factors = []
corrections = []
with open(filename, 'r') as cfile:
rawdata = cfile.read().splitlines()
for i in range(len(rawdata[0].split(","))-4):
corrections.append([])
for i in range(1, len(rawdata)):
rawline = rawdata[i].split(",")
# TODO: rawline[4] can be -1 - decide if accept this behaviour
......@@ -332,7 +333,7 @@ def load_drltables(parent, dataset, drls, drlspectrum):
" cancelling request".format(i+1))
return
for j, k in enumerate((names, start_masses, end_masses,
states, corrected_to, corr_factors)):
states, *corrections)):
k.append(rawline[j])
for row in reversed(range(drls['pt'].rowCount())):
drls['dt'].removeRow(row)
......@@ -345,10 +346,10 @@ def load_drltables(parent, dataset, drls, drlspectrum):
drls['pt'].item(i, 2).setText(end_masses[i])
# and after that the daughter table
for i in range(len(names)):
for j in range((len(names)-1)/2):
for j in range(int((len(rawline)-4)/2)):
drls['dt'].cellWidget(i, 1+j*2).setCurrentIndex(
int(corrected_to[i]))
drls['dt'].item(i, 2+j*2).setText(corr_factors[i])
int(corrections[0+j*2][i]))
drls['dt'].item(i, 2+j*2).setText(corrections[1+j*2][i])
drls['dt'].cellWidget(i, 0).setCheckState(int(states[i]))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment