diff --git a/QtPyLoT.py b/QtPyLoT.py index adda0de4..bedca1c7 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -365,20 +365,21 @@ class MainWindow(QMainWindow): if not key.startswith('freq'): return True return False - kwargs = {} - freq = self.getFilterOptions().getFreq() - if freq is not None and len(freq) > 1: - kwargs['freqmin'] = freq[0] - kwargs['freqmax'] = freq[1] - elif freq is not None and len(freq) == 1: - kwargs['freq'] = freq - - if hasfreq(kwargs): - kwargs['type'] = self.getFilterOptions().getFilterType() - kwargs['corners'] = self.getFilterOptions().getOrder() - self.getData().filter(kwargs) + if self.filterAction.isChecked(): + kwargs = {} + freq = self.getFilterOptions().getFreq() + if freq is not None and len(freq) > 1: + kwargs['freqmin'] = freq[0] + kwargs['freqmax'] = freq[1] + elif freq is not None and len(freq) == 1: + kwargs['freq'] = freq + if hasfreq(kwargs): + kwargs['type'] = self.getFilterOptions().getFilterType() + kwargs['corners'] = self.getFilterOptions().getOrder() self.getData().filterWFData(kwargs) + else: self.getData().resetWFData() + self.plotWaveformData() def adjustFilterOptions(self): filteroptions = None @@ -412,6 +413,8 @@ class MainWindow(QMainWindow): emsg.showMessage('Error: {0}'.format(e)) else: self.updateStatus('Filter loaded ...') + if self.filterAction.isChecked(): + self.filterWaveformData() def getSeismicPhase(self): return self.seismicPhase diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index 95b33700..1af5a0ea 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -130,18 +130,15 @@ class Data(object): self.wforiginal = None if fnames is not None: self.appendWFData(fnames) - self.orig = self.getWFData().copy() + self.wforiginal = self.getWFData().copy() self.dirty = False def appendWFData(self, fnames): - - if self.dirty is not False: - self.resetWFData() - assert isinstance(fnames, list), "input parameter 'fnames' is " \ "supposed to be of type 'list' " \ - "but is actually".format(type( - fnames)) + "but is actually".format(type(fnames)) + if self.dirty: + self.resetWFData() warnmsg = '' for fname in fnames: @@ -156,7 +153,6 @@ class Data(object): warnmsg = 'WARNING: unable to read\n' + warnmsg print warnmsg - def getWFData(self): return self.wfdata