use time for interpolation pf empty dsc reference to avoid infs

This commit is contained in:
Dominik Demuth 2023-07-11 20:31:21 +02:00
parent 3ed7368bb0
commit ef21d7c7f2
4 changed files with 4 additions and 4 deletions

View File

View File

@ -86,6 +86,8 @@ class TgCalculator(QtWidgets.QWizard, Ui_DSCEvalDialog):
self.next_button.clicked.connect(lambda: self.stackedWidget.setCurrentIndex((self.stackedWidget.currentIndex() + 1) % 3))
self.back_button.clicked.connect(lambda: self.stackedWidget.setCurrentIndex((self.stackedWidget.currentIndex() + 2) % 3))
self.listWidget.itemChanged.connect(self.change_visibility)
def __call__(self):
self.clear()
self._colors = cycle(Tab10)

View File

@ -83,7 +83,7 @@ class QDSCReader(QtWidgets.QDialog, Ui_Dialog):
if opts[0] == 'i':
item.setFlags(QtCore.Qt.NoItemFlags)
item.setText(f'{opts[1]:.2f} K for {opts[1] / 60:.0f} min')
item.setText(f'{opts[1]:.2f} K for {opts[2] / 60:.0f} min')
else:
item.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable)
item.setText(f'{opts[2]:.2f} K to {opts[3]:.2f} K with {opts[1]} K/min')

View File

@ -46,11 +46,9 @@ class DSCSample:
if 'Heat from' in line:
match = DSCSample.NUMBER_RE.findall(line)
self.steps.append(('h', float(match[3]), float(match[1])+273.15, float(match[2])+273.15))
elif 'Cool from' in line:
match = DSCSample.NUMBER_RE.findall(line)
self.steps.append(('c', float(match[3]), float(match[1])+273.15, float(match[2])+273.15))
elif 'Hold for' in line:
match = DSCSample.NUMBER_RE.findall(line)
self.steps.append(('i', float(match[2])+273.15, float(match[1])*60))
@ -294,7 +292,7 @@ class DSCCalibrator:
empty_y = empty_data[1]
if self.sample.length(idx) != self.empty.length(idx_empty):
with np.errstate(all='ignore'):
empty_y = interp1d(empty_data[0], empty_data[1], fill_value='extrapolate')(sample_data[0])
empty_y = interp1d(empty_data[2], empty_data[1], fill_value='extrapolate')(sample_data[2])
sample_data[1] -= empty_y
drift_value = sample_data.copy()[(2, 1), :]