use time for interpolation pf empty dsc reference to avoid infs
This commit is contained in:
parent
3ed7368bb0
commit
ef21d7c7f2
0
src/gui_qt/dsc/__init__.py
Normal file
0
src/gui_qt/dsc/__init__.py
Normal 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.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.back_button.clicked.connect(lambda: self.stackedWidget.setCurrentIndex((self.stackedWidget.currentIndex() + 2) % 3))
|
||||||
|
|
||||||
|
self.listWidget.itemChanged.connect(self.change_visibility)
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
self.clear()
|
self.clear()
|
||||||
self._colors = cycle(Tab10)
|
self._colors = cycle(Tab10)
|
||||||
|
@ -83,7 +83,7 @@ class QDSCReader(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
|
|
||||||
if opts[0] == 'i':
|
if opts[0] == 'i':
|
||||||
item.setFlags(QtCore.Qt.NoItemFlags)
|
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:
|
else:
|
||||||
item.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable)
|
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')
|
item.setText(f'{opts[2]:.2f} K to {opts[3]:.2f} K with {opts[1]} K/min')
|
||||||
|
@ -46,11 +46,9 @@ class DSCSample:
|
|||||||
if 'Heat from' in line:
|
if 'Heat from' in line:
|
||||||
match = DSCSample.NUMBER_RE.findall(line)
|
match = DSCSample.NUMBER_RE.findall(line)
|
||||||
self.steps.append(('h', float(match[3]), float(match[1])+273.15, float(match[2])+273.15))
|
self.steps.append(('h', float(match[3]), float(match[1])+273.15, float(match[2])+273.15))
|
||||||
|
|
||||||
elif 'Cool from' in line:
|
elif 'Cool from' in line:
|
||||||
match = DSCSample.NUMBER_RE.findall(line)
|
match = DSCSample.NUMBER_RE.findall(line)
|
||||||
self.steps.append(('c', float(match[3]), float(match[1])+273.15, float(match[2])+273.15))
|
self.steps.append(('c', float(match[3]), float(match[1])+273.15, float(match[2])+273.15))
|
||||||
|
|
||||||
elif 'Hold for' in line:
|
elif 'Hold for' in line:
|
||||||
match = DSCSample.NUMBER_RE.findall(line)
|
match = DSCSample.NUMBER_RE.findall(line)
|
||||||
self.steps.append(('i', float(match[2])+273.15, float(match[1])*60))
|
self.steps.append(('i', float(match[2])+273.15, float(match[1])*60))
|
||||||
@ -294,7 +292,7 @@ class DSCCalibrator:
|
|||||||
empty_y = empty_data[1]
|
empty_y = empty_data[1]
|
||||||
if self.sample.length(idx) != self.empty.length(idx_empty):
|
if self.sample.length(idx) != self.empty.length(idx_empty):
|
||||||
with np.errstate(all='ignore'):
|
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
|
sample_data[1] -= empty_y
|
||||||
drift_value = sample_data.copy()[(2, 1), :]
|
drift_value = sample_data.copy()[(2, 1), :]
|
||||||
|
Loading…
Reference in New Issue
Block a user