From ce8b954a8bc59714ef56b70bec71207f7e22ae39 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Mon, 8 Dec 2014 05:27:54 +0100 Subject: [PATCH] now cf is an CharacteristicFunction object and not an array (changes should also be made to the caller run_makeCF.py) --- pylot/core/pick/CharFuns.py | 9 ++++++++- pylot/core/pick/Picker.py | 12 ++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pylot/core/pick/CharFuns.py b/pylot/core/pick/CharFuns.py index 9fc05685..f469e67b 100644 --- a/pylot/core/pick/CharFuns.py +++ b/pylot/core/pick/CharFuns.py @@ -91,6 +91,10 @@ class CharacteristicFunction(object): def setTime2(self, t2): self.t2 = t2 + def getTimeArray(self): + cut = self.getCut() + return np.arange(cut[0], cut[1], self.getIncrement()) + def getOrder(self): return self.order @@ -98,6 +102,9 @@ class CharacteristicFunction(object): self.order = order def getIncrement(self): + """ + :rtype : int + """ return self.dt def getFnoise(self): @@ -148,7 +155,7 @@ class CharacteristicFunction(object): data = hh return data else: - data = self.orig_data + data = self.orig_data.copy() return data def calcCF(self, data=None): diff --git a/pylot/core/pick/Picker.py b/pylot/core/pick/Picker.py index 5e2f6f6d..e8d980bc 100644 --- a/pylot/core/pick/Picker.py +++ b/pylot/core/pick/Picker.py @@ -23,10 +23,10 @@ class AutoPicking(object): Superclass of different, automated picking algorithms applied on a CF determined using AIC, HOS, or AR prediction. ''' - def __init__(self, cf, Tcf, dt, Tslope, aerr, TSNR, PickWindow, peps, Tsmooth): + def __init__(self, cf, Tslope, aerr, TSNR, PickWindow, peps, Tsmooth): ''' :param: cf, characteristic function, on which the picking algorithm is applied - :type: array + :type: `~pylot.core.pick.CharFuns.CharacteristicFunction` object :param: Tcf, corresponding time array :type: array @@ -54,9 +54,9 @@ class AutoPicking(object): :type: float ''' - self.cf = cf - self.Tcf = Tcf - self.dt = dt + self.cf = cf.getCF() + self.Tcf = cf.getTimeArray() + self.dt = cf.getIncrement() self.setTslope(Tslope) self.setaerr(aerr) self.setTSNR(TSNR) @@ -121,7 +121,7 @@ class AutoPicking(object): return self.Pick def calcPick(self): - self.Pick = Pick + self.Pick = None class AICPicker(AutoPicking): '''