def errorCorrectScale(self):
"""
Error Correction: Scale
"""
rand_spectra = self.hsi.get_rand_spectra(5, pt_sz=3, quads=True,
full=False)
if _np.iscomplexobj(rand_spectra):
rand_spectra = rand_spectra.real
rng = self.hsi.freq.op_range_pix
plugin = _widgetSG(window_length=601, polyorder=2)
winPlotEffect = _DialogPlotEffect.dialogPlotEffect(rand_spectra,
x=self.hsi.f,
plugin=plugin,
parent=self)
if winPlotEffect is not None:
win_size = winPlotEffect.parameters['window_length']
order = winPlotEffect.parameters['polyorder']
scale_err_correct_sg = _ScaleErrCorrectSG(win_size=win_size,
order=order,
rng=rng)
scale_err_correct_sg.transform(self.hsi.data)
# Backup for Undo
self.bcpre.add_step(['ScaleErrorCorrectSG',
'win_size', win_size,
'order', order])
if self.ui.actionUndo_Backup_Enabled.isChecked():
try:
_BCPre.backup_pickle(self.hsi, self.bcpre.id_list[-1])
except:
print('Error in pickle backup (Undo functionality)')
else:
self.bcpre.backed_up()
self.changeSlider()
评论列表
文章目录