Skip to content

Commit e64bc4b

Browse files
committed
Change the structure of radial weights vector
* Radial weight function (`circ_radial_weights', `circular_pw`, `circular_ls') now returns a vector of length 2*N+1 with N being the maximum modal order * The ordering is consistant with the previous implementation: 0,1,...,N,-N,...-1 * In `circ_diagonal_modal_mat`, mirroring of the radial weights is no longer necessary. So `mirror_vec` will be depricated
1 parent 5e496ee commit e64bc4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

micarray/modal/radial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def circular_pw(N, k, r, setup):
256256
Radial weights for all orders up to N and the given wavenumbers.
257257
"""
258258
kr = util.asarray_1d(k*r)
259-
n = np.arange(N+1)
259+
n = np.roll(np.arange(-N, N+1), -N)
260260

261261
bn = circ_radial_weights(N, kr, setup)
262262
for i, x in enumerate(kr):
@@ -294,7 +294,7 @@ def circular_ls(N, k, r, rs, setup):
294294
"""
295295
k = util.asarray_1d(k)
296296
krs = k*rs
297-
n = np.arange(N+1)
297+
n = np.roll(np.arange(-N, N+1), -N)
298298

299299
bn = circ_radial_weights(N, k*r, setup)
300300
for i, x in enumerate(krs):
@@ -345,6 +345,7 @@ def circ_radial_weights(N, kr, setup):
345345
else:
346346
raise ValueError('setup must be either: open, card or rigid')
347347
Bns[i, :] = bn
348+
Bns = np.concatenate((Bns, (Bns*(-1)**np.arange(N+1))[:, :0:-1]), axis=-1)
348349
return np.squeeze(Bns)
349350

350351

@@ -363,7 +364,6 @@ def circ_diagonal_mode_mat(bk):
363364
Multidimensional array containing diagnonal matrices with input
364365
vector on main diagonal.
365366
"""
366-
bk = mirror_vec(bk)
367367
if len(bk.shape) == 1:
368368
bk = bk[np.newaxis, :]
369369
K, N = bk.shape

0 commit comments

Comments
 (0)