master
Per A Brodtkorb 8 years ago
parent d8fc854e09
commit 604ad9e022

@ -241,7 +241,7 @@ def sgolay2d(z, window_size, order, derivative=None):
zout[:size, :size] = band - np.abs(z[size:0:-1, :][:, size:0:-1] - band) zout[:size, :size] = band - np.abs(z[size:0:-1, :][:, size:0:-1] - band)
# bottom right corner # bottom right corner
band = z[-1, -1] band = z[-1, -1]
zout[-size:, -size:] = band + np.abs(z[-2:-size - 2:-1, :][:,-2:-size - 2:-1] - band) zout[-size:, -size:] = band + np.abs(z[-2:-size - 2:-1, :][:, -2:-size - 2:-1] - band)
# top right corner # top right corner
band = zout[size, -size:] band = zout[size, -size:]
zout[:size, -size:] = band - np.abs(zout[2 * size:size:-1, -size:] - band) zout[:size, -size:] = band - np.abs(zout[2 * size:size:-1, -size:] - band)
@ -251,8 +251,8 @@ def sgolay2d(z, window_size, order, derivative=None):
return zout return zout
def _get_sign_and_dims(derivative): def _get_sign_and_dims(derivative):
sign = {None:1}.get(derivative, -1) sign = {None: 1}.get(derivative, -1)
dims = {None:(0, ), 'col':(1, ), 'row':(2, ), 'both':(1, 2)}[derivative] dims = {None: (0, ), 'col': (1, ), 'row': (2, ), 'both': (1, 2)}[derivative]
return sign, dims return sign, dims
def _build_matrix(order, window_size, size): def _build_matrix(order, window_size, size):

@ -52,7 +52,7 @@ def findcross(xn):
def _make_findrfc(cmp1, cmp2): def _make_findrfc(cmp1, cmp2):
@jit(int64(int64[:], float64[:], float64), nopython=True) @jit(int64(int64[:], float64[:], float64), nopython=True)
def findrfc2(t, y, h): def local_findrfc(t, y, h):
# cmp1, cmp2 = (a_le_b, a_lt_b) if method==0 else (a_lt_b, a_le_b) # cmp1, cmp2 = (a_le_b, a_lt_b) if method==0 else (a_lt_b, a_le_b)
n = len(y) n = len(y)
@ -105,7 +105,7 @@ def _make_findrfc(cmp1, cmp2):
j += 1 j += 1
t[j] = t0 t[j] = t0
return j + 1 return j + 1
return findrfc2 return local_findrfc
@jit(int32(float64, float64), nopython=True) @jit(int32(float64, float64), nopython=True)

Loading…
Cancel
Save