Add init to ARZcf that extracts parameters from pickparams

t1, t2 cant be extracted in the init function since they are not the same during the first and the second instantiation.
This commit is contained in:
Darius Arnold 2019-04-09 17:43:30 +02:00
parent ab6e74c482
commit 790cf803d7
2 changed files with 5 additions and 3 deletions

View File

@ -836,8 +836,7 @@ class AutopickStation(object):
if self.p_params.algoP == 'HOS': if self.p_params.algoP == 'HOS':
self.cf1 = HOScf(z_copy, cuttimes, self.pickparams) self.cf1 = HOScf(z_copy, cuttimes, self.pickparams)
elif self.p_params.algoP == 'ARZ': elif self.p_params.algoP == 'ARZ':
self.cf1 = ARZcf(z_copy, cuttimes, self.p_params.tpred1z, self.p_params.Parorder, self.p_params.tdet1z, self.cf1 = ARZcf(z_copy, cuttimes, self.pickparams["tdet1z"], self.pickparams["tpred1z"], self.pickparams)
self.p_params.addnoise)
else: else:
self.cf1 = None self.cf1 = None
assert isinstance(self.cf1, CharacteristicFunction), 'cf1 is not set correctly: maybe the algorithm name ({})' \ assert isinstance(self.cf1, CharacteristicFunction), 'cf1 is not set correctly: maybe the algorithm name ({})' \
@ -886,7 +885,7 @@ class AutopickStation(object):
if self.p_params.algoP == 'HOS': if self.p_params.algoP == 'HOS':
self.cf2 = HOScf(z_copy, cuttimes2, self.pickparams) self.cf2 = HOScf(z_copy, cuttimes2, self.pickparams)
elif self.p_params.algoP == 'ARZ': elif self.p_params.algoP == 'ARZ':
self.cf2 = ARZcf(z_copy, cuttimes2, self.p_params.tpred2z, self.p_params.Parorder, self.p_params.tdet2z, self.p_params.addnoise) self.cf2 = ARZcf(z_copy, cuttimes2, self.pickparams["tdet2z"], self.pickparams["tpred2z"], self.pickparams)
else: else:
self.cf2 = None self.cf2 = None
assert isinstance(self.cf2, CharacteristicFunction), 'cf2 is not set correctly: maybe the algorithm name () is ' \ assert isinstance(self.cf2, CharacteristicFunction), 'cf2 is not set correctly: maybe the algorithm name () is ' \

View File

@ -306,6 +306,9 @@ class HOScf(CharacteristicFunction):
class ARZcf(CharacteristicFunction): class ARZcf(CharacteristicFunction):
def __init__(self, data, cut, t1, t2, pickparams):
super(ARZcf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Parorder"], fnoise=pickparams["addnoise"])
def calcCF(self, data): def calcCF(self, data):
""" """
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