Skip to content

Commit

Permalink
Merge pull request #3 from zsylvester/master
Browse files Browse the repository at this point in the history
Minor changes to convert indices to integers (same as in sskernel.py)
  • Loading branch information
Lee Cooper committed Oct 20, 2017
2 parents e745304 + bda4cc8 commit d3743e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions adaptivekde/ssvkernel.py
Expand Up @@ -177,8 +177,8 @@ def ssvkernel(x, tin=None, M=80, nbs=1e2, WinFunc='Boxcar'):
yb_buf = yb_buf / np.sum(yb_buf * dt)
yb[i, :] = np.interp(tin, t, yb_buf)
ybsort = np.sort(yb, axis=0)
y95b = ybsort[np.floor(0.05 * nbs), :]
y95u = ybsort[np.floor(0.95 * nbs), :]
y95b = ybsort[np.int(np.floor(0.05 * nbs)), :]
y95u = ybsort[np.int(np.floor(0.95 * nbs)), :]
confb95 = np.concatenate((y95b[np.newaxis], y95u[np.newaxis]), axis=0)

# return outputs
Expand Down Expand Up @@ -242,8 +242,8 @@ def fftkernel(x, w):

# generate kernel domain
f = np.linspace(0, n-1, n) / n
f = np.concatenate((-f[0: n / 2 + 1],
f[1: n / 2 - 1 + 1][::-1]))
f = np.concatenate((-f[0: np.int(n / 2 + 1)],
f[1: np.int(n / 2 - 1 + 1)][::-1]))

# evaluate kernel
K = np.exp(-0.5 * (w * 2 * np.pi * f) ** 2)
Expand All @@ -264,8 +264,8 @@ def fftkernelWin(x, w, WinFunc):

# generate kernel domain
f = np.linspace(0, n-1, n) / n
f = np.concatenate((-f[0: n / 2 + 1],
f[1: n / 2 - 1 + 1][::-1]))
f = np.concatenate((-f[0: np.int(n / 2 + 1)],
f[1: np.int(n / 2 - 1 + 1)][::-1]))
t = 2 * np.pi * f

# determine window function - evaluate kernel
Expand Down

0 comments on commit d3743e6

Please sign in to comment.