Commit e31b645a authored by 3Yan's avatar 3Yan
Browse files

DRL - cut off

* added end-time cut off to the time selection in DRL
parent 621cdc88
......@@ -146,6 +146,10 @@ def update_drlspectrum(ds, drls, drlspectrum):
gt.pop_plot(drlspectrum, drls['graphlabels'])
drlspectrum.axvline(0, 0, 0.9, color="#FF000088", linestyle=":")
if drls['cutoff'].value() != 0:
drlspectrum.axvline(drls['cutoff'].value(), 0, 0.9,
color="#0000FF88", linestyle=":")
i = 0
for row in range(drls['dt'].rowCount()):
if drls['dt'].cellWidget(row, 0).checkState() == 2:
......@@ -466,7 +470,10 @@ def export_drlspectrum(parent, fn, ds, drls):
"No file opened. Nothing to export, canceling request")
return
names, times, intensities = get_daughterset(ds, drls)
subset = np.where(times > 0)[0]
if drls['cutoff'].value() == 0:
subset = np.where(times > 0)[0]
else:
subset = np.where((times > 0) & (times < drls['cutoff'].value()))[0]
times = times[subset]
intensities = list(map(lambda x: x[subset], intensities))
......@@ -503,7 +510,8 @@ def export_drlspectrum(parent, fn, ds, drls):
[names, intensities]]):
expf = open(exp_f_name[i], 'w')
expf.write("times, {}\n".format((",".join(table[0]))))
expf.write("timeshift = {}\n".format(drls['tshift'].value()))
expf.write("timeshift = {}, cutoff = {}\n".format(
drls['tshift'].value(), drls['cutoff'].value()))
for j in range(len(times)):
dataset = list()
dataset.append(times[j])
......@@ -638,8 +646,8 @@ def main_window(parent, ds, filename, cache):
# pt = parenttable
# dt = daughtertable
drls = dict(pt=None, dt=None, tshift=None, cors=None, rel=None,
checkAll=None)
drls = dict(pt=None, dt=None, tshift=None, cutoff=None, cors=None,
rel=None, checkAll=None)
window = QtWidgets.QMainWindow(
parent, windowTitle='Delayed reactant labeling')
......@@ -664,6 +672,9 @@ def main_window(parent, ds, filename, cache):
time_title = QtWidgets.QLabel("Time shift (min):")
drls['tshift'] = QtWidgets.QDoubleSpinBox(
minimum=-100, maximum=1440, decimals=3)
cutoff_title = QtWidgets.QLabel("Cut off (min):")
drls['cutoff'] = QtWidgets.QDoubleSpinBox(
minimum=0, maximum=1440, decimals=3)
drls['rel'] = QtWidgets.QCheckBox("Steady state approximation")
drls['checkAll'] = QtWidgets.QCheckBox("Select all")
drls['cors'] = QtWidgets.QSpinBox(minimum=0)
......@@ -718,6 +729,8 @@ def main_window(parent, ds, filename, cache):
item.row(), item.column(), ds, drls, chromplot))
drls['tshift'].valueChanged.connect(lambda: update_drlspectrum(
ds, drls, chromplot))
drls['cutoff'].valueChanged.connect(lambda: update_drlspectrum(
ds, drls, chromplot))
drls['cors'].valueChanged.connect(lambda: corcount_changed(
ds, drls, chromplot))
drls['rel'].stateChanged.connect(lambda: update_drlspectrum(
......@@ -771,6 +784,9 @@ def main_window(parent, ds, filename, cache):
graphparams_layout.addWidget(time_title)
graphparams_layout.addWidget(drls['tshift'])
graphparams_layout.addStretch(1)
graphparams_layout.addWidget(cutoff_title)
graphparams_layout.addWidget(drls['cutoff'])
graphparams_layout.addStretch(1)
graphparams_layout.addWidget(drls['rel'])
graphparams_layout.addStretch(1)
......
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