From 281e92e2a9cc8ced9c59b94aca74182ebd5da13c Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Tue, 9 Apr 2019 18:19:26 +0200 Subject: [PATCH] Add init to AR3Ccf that extracts parameters from pickparam --- pylot/core/pick/autopick.py | 4 ++-- pylot/core/pick/charfuns.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 965567cc..b7afba43 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -994,7 +994,7 @@ class AutopickStation(object): if self.s_params.algoS == 'ARH': arhcf1 = ARHcf(h_copy, cuttimesh, self.s_params.tdet1h, self.s_params.tpred1h, self.pickparams) elif self.s_params.algoS == 'AR3': - arhcf1 = AR3Ccf(h_copy, cuttimesh, self.s_params.tpred1h, self.s_params.Sarorder, self.s_params.tdet1h, self.p_params.addnoise) + arhcf1 = AR3Ccf(h_copy, cuttimesh, self.s_params.tdet1h, self.s_params.tpred1h, self.pickparams) return arhcf1 def _calculate_aic_cf_s_pick(self, cuttimesh): @@ -1055,7 +1055,7 @@ class AutopickStation(object): if self.s_params.algoS == 'ARH': arhcf2 = ARHcf(h_copy, cuttimesh2, self.s_params.tdet2h, self.s_params.tpred2h, self.pickparams) elif self.s_params.algoS == 'AR3': - arhcf2 = AR3Ccf(h_copy, cuttimesh2, self.s_params.tpred2h, self.s_params.Sarorder, self.s_params.tdet2h, self.p_params.addnoise) + arhcf2 = AR3Ccf(h_copy, cuttimesh2, self.s_params.tdet2h, self.s_params.tpred2h, self.pickparams) # save cf for later plotting self.arhcf2 = arhcf2 diff --git a/pylot/core/pick/charfuns.py b/pylot/core/pick/charfuns.py index 7a2e1f75..94483df9 100644 --- a/pylot/core/pick/charfuns.py +++ b/pylot/core/pick/charfuns.py @@ -593,6 +593,9 @@ class ARHcf(CharacteristicFunction): class AR3Ccf(CharacteristicFunction): + def __init__(self, data, cut, t1, t2, pickparams): + super(AR3Ccf, self).__init__(data, cut, t1=t1, t2=t2, order=pickparams["Sarorder"], fnoise=pickparams["addnoise"]) + def calcCF(self, data): """ Function to calculate a characteristic function using autoregressive modelling of the waveform of