Commit 6426857b authored by 3Yan's avatar 3Yan
Browse files

Minor fixes of DRL-Load procedure

* Now it accepts also files with 0 correction factors in daughter table.
parent 5e1d2ef1
......@@ -398,9 +398,9 @@ def load_drltables(parent, dataset, drls, drlspectrum):
for i in range(1, len(rawdata)):
rawline = rawdata[i].split(",")
n = len(rawline)
if n < 6 or not n % 2 == 0 or (rawline[3] not in map(
if n < 4 or not n % 2 == 0 or (rawline[3] not in map(
str,range(3))) or not (set(map(int, rawline[4:n:2]))
& set(range(-1, n))):
& set(range(-1, n)) or (n == 4)):
QtWidgets.QMessageBox.warning(
parent, "Load DRL config tables",
"Wrong or corrupted config file.\n"
......@@ -409,7 +409,8 @@ def load_drltables(parent, dataset, drls, drlspectrum):
return
for j, k in enumerate((names, masses, peak_widths,
states, *corrections)):
k.append(rawline[j])
if len(rawline) > j:
k.append(rawline[j])
for row in reversed(range(drls['pt'].rowCount())):
drls['dt'].removeRow(row)
drls['pt'].removeRow(row)
......@@ -420,7 +421,7 @@ def load_drltables(parent, dataset, drls, drlspectrum):
drls['pt'].item(i, 1).setText(masses[i])
drls['pt'].item(i, 2).setText(peak_widths[i])
# and after that the daughter table
drls['cors'].setValue(int(1 + (len(names) / 2)))
drls['cors'].setValue(int((len(corrections) / 2)))
for i in range(len(names)):
for j in range(int((len(rawline)-4)/2)):
drls['dt'].cellWidget(i, 1+j*2).setCurrentIndex(
......
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