Closedown
This commit is contained in:
@@ -22,7 +22,7 @@ def blm_remove_spikes(x):
|
||||
:param x: input array
|
||||
:return: output array
|
||||
"""
|
||||
|
||||
print "0"
|
||||
x = copy.copy(x)
|
||||
if x.size > 5: # Must have enough sample points
|
||||
d_x = x[1:] - x[:-1]
|
||||
@@ -37,16 +37,20 @@ def blm_remove_spikes(x):
|
||||
# 2 point spikes
|
||||
x[i+2] = (x[i:i+2].sum() + x[i+4])/3
|
||||
x[i+3] = (x[i+1] + x[i+4:i+6].sum())/3
|
||||
|
||||
print "A"
|
||||
# Handle edge points
|
||||
if d_x[-1] > 0.5 * maximum:
|
||||
print "B"
|
||||
x[-1] = x[-3:-1].sum() / 2
|
||||
|
||||
if d_x[-2] > 0.5 * maximum:
|
||||
print "C"
|
||||
x[-2] = (x[-1] + x[-4:-2].sum()) / 3
|
||||
if d_x[0] < -0.5 * maximum:
|
||||
print "D"
|
||||
x[0] = x[1:3].sum() / 2
|
||||
if d_x[1] < -0.5*maximum:
|
||||
print "E"
|
||||
x[1] = (x[0] + x[2:4].sum()) / 3
|
||||
return x
|
||||
|
||||
|
||||
Reference in New Issue
Block a user