Debugging, cleaning up
This commit is contained in:
parent
31273b384e
commit
2eace0d304
@ -74,7 +74,7 @@ class CharacteristicFunction(object):
|
|||||||
t2=self.getTime2(),
|
t2=self.getTime2(),
|
||||||
order=self.getOrder(),
|
order=self.getOrder(),
|
||||||
fnoise=self.getFnoise(),
|
fnoise=self.getFnoise(),
|
||||||
ardetstep=self.getARdetStep())
|
ardetstep=self.getARdetStep[0]())
|
||||||
|
|
||||||
def getCut(self):
|
def getCut(self):
|
||||||
return self.cut
|
return self.cut
|
||||||
@ -99,7 +99,9 @@ class CharacteristicFunction(object):
|
|||||||
|
|
||||||
def setARdetStep(self, t1):
|
def setARdetStep(self, t1):
|
||||||
if t1:
|
if t1:
|
||||||
self.ARdetStep = t1 / 4
|
self.ARdetStep = []
|
||||||
|
self.ARdetStep.append(t1 / 4)
|
||||||
|
self.ARdetStep.append(int(np.ceil(self.getTime2() / self.getIncrement()) / 4))
|
||||||
return self.ARdetStep
|
return self.ARdetStep
|
||||||
|
|
||||||
def getOrder(self):
|
def getOrder(self):
|
||||||
@ -115,27 +117,14 @@ class CharacteristicFunction(object):
|
|||||||
return self.dt
|
return self.dt
|
||||||
|
|
||||||
def getTimeArray(self):
|
def getTimeArray(self):
|
||||||
if self.getTime1() == None and self.getTime2() and self.getOrder():
|
if self.getTime1():
|
||||||
#for HOS
|
|
||||||
incr = self.getIncrement()
|
|
||||||
timeArray = np.arange(0, len(self.getCF()) * incr,
|
|
||||||
incr) + self.getCut()[0]
|
|
||||||
elif self.getTime1() == None and self.getTime2() and self.getOrder() == None:
|
|
||||||
#for AIC-HOS
|
|
||||||
incr = self.getIncrement()
|
|
||||||
timeArray = np.arange(0, len(self.getCF()) * incr,
|
|
||||||
incr) + self.getCut()[0]
|
|
||||||
elif self.getTime1() and self.getTime2() and self.getOrder() == 0:
|
|
||||||
#for AIC-AR
|
|
||||||
incr = self.getARdetStep()
|
incr = self.getARdetStep()
|
||||||
timeArray = np.arange(0, len(self.getCF()) * incr,
|
self.TimeArray = np.arange(0, len(self.getCF()) * incr[0], incr[0]) + self.getCut()[0] \
|
||||||
incr) + self.getCut()[0] + self.getTime1() + self.getTime2()
|
+ self.getTime1() + self.getTime2()
|
||||||
elif self.getTime1() and self.getTime2() and self.getOrder():
|
else:
|
||||||
#for AR
|
incr = self.getIncrement()
|
||||||
incr = self.getARdetStep()
|
self.TimeArray = np.arange(0, len(self.getCF()) * incr, incr) + self.getCut()[0]
|
||||||
timeArray = np.arange(0, len(self.getCF()) * incr,
|
return self.TimeArray
|
||||||
incr) + self.getCut()[0] + self.getTime1() + self.getTime2()
|
|
||||||
return timeArray
|
|
||||||
|
|
||||||
def getFnoise(self):
|
def getFnoise(self):
|
||||||
return self.fnoise
|
return self.fnoise
|
||||||
@ -288,7 +277,8 @@ class ARZcf(CharacteristicFunction):
|
|||||||
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) #length of AR-prediction window [samples]
|
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) #length of AR-prediction window [samples]
|
||||||
|
|
||||||
cf = []
|
cf = []
|
||||||
for i in range(ldet + self.getOrder() - 1, tend - lpred + 1, lpred / 4):
|
loopstep = self.getARdetStep()
|
||||||
|
for i in range(ldet + self.getOrder() - 1, tend - lpred + 1, loopstep[1]):
|
||||||
#determination of AR coefficients
|
#determination of AR coefficients
|
||||||
self.arDetZ(xnoise, self.getOrder(), i-ldet, i)
|
self.arDetZ(xnoise, self.getOrder(), i-ldet, i)
|
||||||
#AR prediction of waveform using calculated AR coefficients
|
#AR prediction of waveform using calculated AR coefficients
|
||||||
@ -301,6 +291,7 @@ class ARZcf(CharacteristicFunction):
|
|||||||
cf = np.asarray(cf)
|
cf = np.asarray(cf)
|
||||||
self.cf = cf
|
self.cf = cf
|
||||||
|
|
||||||
|
|
||||||
def arDetZ(self, data, order, rind, ldet):
|
def arDetZ(self, data, order, rind, ldet):
|
||||||
'''
|
'''
|
||||||
Function to calculate AR parameters arpara after Thomas Meier (CAU), published
|
Function to calculate AR parameters arpara after Thomas Meier (CAU), published
|
||||||
@ -399,7 +390,8 @@ class ARHcf(CharacteristicFunction):
|
|||||||
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) #length of AR-prediction window [samples]
|
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) #length of AR-prediction window [samples]
|
||||||
|
|
||||||
cf = []
|
cf = []
|
||||||
for i in range(ldet + self.getOrder() - 3, tend - lpred + 1, lpred / 4):
|
loopstep = self.getARdetStep()
|
||||||
|
for i in range(ldet + self.getOrder() - 3, tend - lpred + 1, loopstep[1]):
|
||||||
self.arDetH(Xnoise, self.getOrder(), i-ldet, i)
|
self.arDetH(Xnoise, self.getOrder(), i-ldet, i)
|
||||||
#AR prediction of waveform using calculated AR coefficients
|
#AR prediction of waveform using calculated AR coefficients
|
||||||
self.arPredH(xnp, self.arpara, i + 1, lpred)
|
self.arPredH(xnp, self.arpara, i + 1, lpred)
|
||||||
@ -516,7 +508,8 @@ class AR3Ccf(CharacteristicFunction):
|
|||||||
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) #length of AR-prediction window [samples]
|
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) #length of AR-prediction window [samples]
|
||||||
|
|
||||||
cf = []
|
cf = []
|
||||||
for i in range(ldet + self.getOrder() - 3, tend - lpred + 1, lpred / 4):
|
loopstep = self.getARdetStep()
|
||||||
|
for i in range(ldet + self.getOrder() - 3, tend - lpred + 1, loopstep[1]):
|
||||||
self.arDet3C(Xnoise, self.getOrder(), i-ldet, i)
|
self.arDet3C(Xnoise, self.getOrder(), i-ldet, i)
|
||||||
#AR prediction of waveform using calculated AR coefficients
|
#AR prediction of waveform using calculated AR coefficients
|
||||||
self.arPred3C(xnp, self.arpara, i + 1, lpred)
|
self.arPred3C(xnp, self.arpara, i + 1, lpred)
|
||||||
|
Loading…
Reference in New Issue
Block a user