FilterOptions class has new method parseFilterOptions which establishes a valid keyword arguments dictionary to be parsed to the obspy.core.stream.Stream 's filter method

This commit is contained in:
Sebastian Wehling-Benatelli 2015-06-22 10:59:14 +02:00
parent ff52ec5410
commit 245a7455ff

View File

@ -206,6 +206,19 @@ class FilterOptions(object):
order=self.getOrder())
return hrs
def parseFilterOptions(self):
if self.getFilterType():
robject = {'type':self.getFilterType()}
robject['order'] = self.getOrder()
if len(self.getFreq()) > 1:
robject['freqmin'] = self.getFreq()[0]
robject['freqmax'] = self.getFreq()[1]
else:
robject['freq'] = self.getFreq() if type(self.getFreq()) is \
float else self.getFreq()[0]
return robject
return None
def getFreq(self):
return self.__getattribute__('_freq')