From d8e5de6b7aa41fd7fe78056996942c3c48424cf8 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Mon, 11 Sep 2023 19:50:58 +0200 Subject: [PATCH] T1+T2 calculation now always iterates over all args that can be from data --- src/gui_qt/main/management.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gui_qt/main/management.py b/src/gui_qt/main/management.py index 5470c44..2f87e87 100644 --- a/src/gui_qt/main/management.py +++ b/src/gui_qt/main/management.py @@ -1176,21 +1176,23 @@ class UpperManagement(QtCore.QObject): _x = x1 = self.data[params[0]].x x2 = opts['val2'] - sd = opts['spec_dens'] - sd_param = [self.data[p].y.real if isinstance(p, str) else p for p in opts['sd_param'][0]] - sd.convert(_x, *sd_param, from_=opts['tau_type'], to_='raw') + sd_param = list(zip(*[self.data[p].y.real if isinstance(p, str) else [p]*len(_x) for p in opts['sd_param'][0]])) relax = Relaxation() - relax.set_distribution(sd, parameter=sd_param, keywords=opts['sd_param'][1]) + relax.set_distribution(sd, keywords=opts['sd_param'][1]) - cp_param = [self.data[p].y.real if isinstance(p, str) else p for p in opts['cp_param'][0]] - relax.set_coupling(opts['coup'], parameter=cp_param, keywords=opts['cp_param'][1]) + cp_param = list(zip(*[self.data[p].y.real if isinstance(p, str) else [p]*len(_x) for p in opts['cp_param'][0]])) + # relax.set_coupling(opts['coup'], parameter=cp_param, keywords=opts['cp_param'][1]) - if opts['out'] == 't1': - y = relax.t1(x2, _x) - else: - y = relax.t2(x2, _x) + relax_func = relax.t1 if opts['out'] == 't1' else relax.t2 + y = np.zeros(_x.size) + + for i in range(_x.size): + _x[i] = sd.convert(_x[i], *sd_param[i], from_=opts['tau_type'], to_='raw') + relax.dist_parameter = sd_param[i] + relax.set_coupling(opts['coup'], parameter=cp_param[i], keywords=opts['cp_param'][1]) + y[i] = relax_func(x2, _x[i]) pts = Points(x1, y, name=sd.name) pts.meta.update(opts)