[refactor] removed unused parameter "data" from calcCF methods
This commit is contained in:
parent
431dbe8924
commit
e1b0d48527
@ -59,7 +59,7 @@ class CharacteristicFunction(object):
|
|||||||
self.setOrder(order)
|
self.setOrder(order)
|
||||||
self.setFnoise(fnoise)
|
self.setFnoise(fnoise)
|
||||||
self.setARdetStep(t2)
|
self.setARdetStep(t2)
|
||||||
self.calcCF(self.getDataArray())
|
self.calcCF()
|
||||||
self.arpara = np.array([])
|
self.arpara = np.array([])
|
||||||
self.xpred = np.array([])
|
self.xpred = np.array([])
|
||||||
|
|
||||||
@ -211,17 +211,15 @@ class CharacteristicFunction(object):
|
|||||||
data = self.orig_data.copy()
|
data = self.orig_data.copy()
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def calcCF(self, data=None):
|
def calcCF(self):
|
||||||
self.cf = data
|
pass
|
||||||
|
|
||||||
|
|
||||||
class AICcf(CharacteristicFunction):
|
class AICcf(CharacteristicFunction):
|
||||||
|
|
||||||
def calcCF(self, data):
|
def calcCF(self):
|
||||||
"""
|
"""
|
||||||
Function to calculate the Akaike Information Criterion (AIC) after Maeda (1985).
|
Function to calculate the Akaike Information Criterion (AIC) after Maeda (1985).
|
||||||
:param data: data, time series (whether seismogram or CF)
|
|
||||||
:type data: tuple
|
|
||||||
:return: AIC function
|
:return: AIC function
|
||||||
:rtype:
|
:rtype:
|
||||||
"""
|
"""
|
||||||
@ -259,13 +257,11 @@ class HOScf(CharacteristicFunction):
|
|||||||
"""
|
"""
|
||||||
super(HOScf, self).__init__(data, cut, pickparams["tlta"], pickparams["hosorder"])
|
super(HOScf, self).__init__(data, cut, pickparams["tlta"], pickparams["hosorder"])
|
||||||
|
|
||||||
def calcCF(self, data):
|
def calcCF(self):
|
||||||
"""
|
"""
|
||||||
Function to calculate skewness (statistics of order 3) or kurtosis
|
Function to calculate skewness (statistics of order 3) or kurtosis
|
||||||
(statistics of order 4), using one long moving window, as published
|
(statistics of order 4), using one long moving window, as published
|
||||||
in Kueperkoch et al. (2010), or order 2, i.e. STA/LTA.
|
in Kueperkoch et al. (2010), or order 2, i.e. STA/LTA.
|
||||||
:param data: data, time series (whether seismogram or CF)
|
|
||||||
:type data: tuple
|
|
||||||
:return: HOS cf
|
:return: HOS cf
|
||||||
:rtype:
|
:rtype:
|
||||||
"""
|
"""
|
||||||
@ -342,12 +338,10 @@ class ARZcf(CharacteristicFunction):
|
|||||||
super(ARZcf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Parorder"],
|
super(ARZcf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Parorder"],
|
||||||
fnoise=pickparams["addnoise"])
|
fnoise=pickparams["addnoise"])
|
||||||
|
|
||||||
def calcCF(self, data):
|
def calcCF(self):
|
||||||
"""
|
"""
|
||||||
function used to calculate the AR prediction error from a single vertical trace. Can be used to pick
|
function used to calculate the AR prediction error from a single vertical trace. Can be used to pick
|
||||||
P onsets.
|
P onsets.
|
||||||
:param data:
|
|
||||||
:type data: ~obspy.core.stream.Stream
|
|
||||||
:return: ARZ cf
|
:return: ARZ cf
|
||||||
:rtype:
|
:rtype:
|
||||||
"""
|
"""
|
||||||
@ -478,14 +472,12 @@ class ARHcf(CharacteristicFunction):
|
|||||||
super(ARHcf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Sarorder"],
|
super(ARHcf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Sarorder"],
|
||||||
fnoise=pickparams["addnoise"])
|
fnoise=pickparams["addnoise"])
|
||||||
|
|
||||||
def calcCF(self, data):
|
def calcCF(self):
|
||||||
"""
|
"""
|
||||||
Function to calculate a characteristic function using autoregressive modelling of the waveform of
|
Function to calculate a characteristic function using autoregressive modelling of the waveform of
|
||||||
both horizontal traces.
|
both horizontal traces.
|
||||||
The waveform is predicted in a moving time window using the calculated AR parameters. The difference
|
The waveform is predicted in a moving time window using the calculated AR parameters. The difference
|
||||||
between the predicted and the actual waveform servers as a characteristic function.
|
between the predicted and the actual waveform servers as a characteristic function.
|
||||||
:param data: wavefor stream
|
|
||||||
:type data: ~obspy.core.stream.Stream
|
|
||||||
:return: ARH cf
|
:return: ARH cf
|
||||||
:rtype:
|
:rtype:
|
||||||
"""
|
"""
|
||||||
@ -634,14 +626,12 @@ class AR3Ccf(CharacteristicFunction):
|
|||||||
super(AR3Ccf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Sarorder"],
|
super(AR3Ccf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Sarorder"],
|
||||||
fnoise=pickparams["addnoise"])
|
fnoise=pickparams["addnoise"])
|
||||||
|
|
||||||
def calcCF(self, data):
|
def calcCF(self):
|
||||||
"""
|
"""
|
||||||
Function to calculate a characteristic function using autoregressive modelling of the waveform of
|
Function to calculate a characteristic function using autoregressive modelling of the waveform of
|
||||||
all three traces.
|
all three traces.
|
||||||
The waveform is predicted in a moving time window using the calculated AR parameters. The difference
|
The waveform is predicted in a moving time window using the calculated AR parameters. The difference
|
||||||
between the predicted and the actual waveform servers as a characteristic function
|
between the predicted and the actual waveform servers as a characteristic function
|
||||||
:param data: stream holding all three traces
|
|
||||||
:type data: ~obspy.core.stream.Stream
|
|
||||||
:return: AR3C cf
|
:return: AR3C cf
|
||||||
:rtype:
|
:rtype:
|
||||||
"""
|
"""
|
||||||
|
@ -173,7 +173,7 @@ class AICPicker(AutoPicker):
|
|||||||
nn = np.isnan(self.cf)
|
nn = np.isnan(self.cf)
|
||||||
if len(nn) > 1:
|
if len(nn) > 1:
|
||||||
self.cf[nn] = 0
|
self.cf[nn] = 0
|
||||||
# taper AIC-CF to get rid off side maxima
|
# taper AIC-CF to get rid of side maxima
|
||||||
tap = np.hanning(len(self.cf))
|
tap = np.hanning(len(self.cf))
|
||||||
aic = tap * self.cf + max(abs(self.cf))
|
aic = tap * self.cf + max(abs(self.cf))
|
||||||
# smooth AIC-CF
|
# smooth AIC-CF
|
||||||
|
Loading…
Reference in New Issue
Block a user