def taper_matrix(N, W):
"""
Generates the matrix used for taper calculations.
"""
N = int(N)
m = np.zeros((N, N))
# diagonal
diag, off_diag = taper_diags(N, W)
diag_indices = np.arange(0, N) * (N + 1)
np.put(m, diag_indices, diag)
np.put(m, (diag_indices[0:-1] + 1), off_diag)
np.put(m, (diag_indices[1:] - 1), off_diag)
return m
评论列表
文章目录