minor fixes

This commit is contained in:
Вадим Силаев 2022-12-18 14:15:09 +03:00
parent c01b53403b
commit 65b04a31de
2 changed files with 12 additions and 12 deletions

View File

@ -2,8 +2,8 @@ from scipy.optimize import curve_fit
from numpy import tanh
def probe(x, I_0, k_0, A):
return I_0 * tanh(k_0 / I_0 * x) + A * x
def probe(x, I_0, T_e, A):
return I_0 * tanh(x / T_e) + A * x
def fit(x, y):

View File

@ -159,7 +159,7 @@ class Part1(QtWidgets.QWidget):
timer = QtCore.QTimer(self)
timer.timeout.connect(self.upd_plot)
timer.start(3000)
timer.start(1000)
@QtCore.Slot()
def save_plot(self):
@ -302,9 +302,9 @@ class Part2(QtWidgets.QWidget):
self.pixmap0 = QtGui.QPixmap('tmpplots/tmpplot2.jpg')
self.pixmap = self.pixmap0.scaledToHeight(3 * h)
self.plot1 = QtWidgets.QLabel(self)
self.plot1.setPixmap(self.pixmap)
self.plot1.setGeometry(QtCore.QRect(h, h + 20, 4 * h, 3 * h))
self.plot2 = QtWidgets.QLabel(self)
self.plot2.setPixmap(self.pixmap)
self.plot2.setGeometry(QtCore.QRect(h, h + 20, 4 * h, 3 * h))
self.text = QtWidgets.QLabel(self)
self.text.setText("<html><p align=\"left\"><span style=\" font-size:10pt;\">Перед проведением измерений "
@ -338,7 +338,7 @@ class Part2(QtWidgets.QWidget):
timer = QtCore.QTimer(self)
timer.timeout.connect(self.upd_plot)
timer.start(3000)
timer.start(1000)
timer2 = QtCore.QTimer(self)
timer2.timeout.connect(self.cur_check)
@ -364,20 +364,20 @@ class Part2(QtWidgets.QWidget):
r"C:\Users\Vadim\Desktop\experiment2.xlsx", "Table (.xlsx)")
if check:
data = {'U_1, В': plots.vol[1][0], 'I_1, мкА': plots.cur[1][0]}
I_0, k_0, A = [], [], []
I_0, T_e, A = [], [], []
params = fitting.fit(plots.vol[1][0], plots.cur[1][0])
I_0.append(params[0])
k_0.append(params[1])
T_e.append(params[1])
A.append(params[2])
for i in range(len(plots.vol[1]) - 1):
mes = {'U_' + str(i+2) + ', В': plots.vol[1][i + 1], 'I_' + str(i + 2) + ', мкА': plots.cur[1][i + 1]}
data.update(mes)
params = fitting.fit(plots.vol[1][i + 1], plots.cur[1][i + 1])
I_0.append(params[0])
k_0.append(params[1])
T_e.append(params[1])
A.append(params[2])
data.update({'I_0, мкА': I_0, 'T_e, K': k_0, 'A, мкА/В': A})
data.update({'I_0, мкА': I_0, 'T_e, K': T_e, 'A, мкА/В': A})
df = pd.DataFrame(dict([(k, pd.Series(v)) for k, v in data.items()]))
df.to_excel(file, index=False)
@ -402,7 +402,7 @@ class Part2(QtWidgets.QWidget):
self.points.setText('Измеренных точек в текущей серии: ' + str(self.n))
self.pixmap0 = QtGui.QPixmap('tmpplots/tmpplot2.jpg')
self.pixmap = self.pixmap0.scaledToHeight(0.6 * self.q.height())
self.plot1.setPixmap(self.pixmap)
self.plot2.setPixmap(self.pixmap)
def upd_plot(self):
if self.started: