Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 804727f

Browse files
FIX:4th order polyfit
1 parent 9eb4fd5 commit 804727f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

PythonGUI_apps/UV_Vis_analysis/uv_vis_analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ def plot_absorbance(self):
105105
if self.ui.fourth_orderpoly_radioButton.isChecked():
106106
p = (np.polyfit(self.Wavelength[(self.Wavelength>self.correction_region_min) & (self.Wavelength<self.correction_region_max)],
107107
self.Absorbance[(self.Wavelength>self.correction_region_min) & (self.Wavelength<self.correction_region_max)],4))
108-
p_val = np.polyval(p,self.Wavelength)
109-
self.plotted_absorbance = self.Absorbance - p_val
108+
p_val = np.polyval(p,self.Wavelength[(self.Wavelength>self.correction_region_min) & (self.Wavelength<self.correction_region_max)])
109+
self.plotted_absorbance[(self.Wavelength>self.correction_region_min) & (self.Wavelength<self.correction_region_max)] = self.Absorbance[(self.Wavelength>self.correction_region_min) & (self.Wavelength<self.correction_region_max)] - p_val
110110
elif self.ui.mean_radioButton.isChecked():
111111
self.plotted_absorbance = self.Absorbance - np.mean(self.Absorbance[(self.Wavelength>self.correction_region_min) & (self.Wavelength<self.correction_region_max)])
112112
self.absorbance_plot.plot(self.Wavelength, self.plotted_absorbance, pen='r', clear=True)

0 commit comments

Comments
 (0)