@@ -239,7 +239,7 @@ def circular_pw(N, k, r, setup):
239
239
240
240
.. math::
241
241
242
- \mathring{P}_n(k) = i^{-n} b_n(kr)
242
+ \mathring{P}_n(k) = i^n b_n(kr)
243
243
244
244
Parameters
245
245
----------
@@ -254,14 +254,14 @@ def circular_pw(N, k, r, setup):
254
254
255
255
Returns
256
256
-------
257
- bn : (M, N+1) numpy.ndarray
257
+ bn : (M, 2* N+1) numpy.ndarray
258
258
Radial weights for all orders up to N and the given wavenumbers.
259
259
"""
260
260
kr = util .asarray_1d (k * r )
261
261
n = np .roll (np .arange (- N , N + 1 ), - N )
262
262
263
263
bn = circ_radial_weights (N , kr , setup )
264
- return ( 1j ) ** ( n ) * bn
264
+ return 1j ** n * bn
265
265
266
266
267
267
def circular_ls (N , k , r , rs , setup ):
@@ -289,7 +289,7 @@ def circular_ls(N, k, r, rs, setup):
289
289
290
290
Returns
291
291
-------
292
- bn : (M, N+1) numpy.ndarray
292
+ bn : (M, 2* N+1) numpy.ndarray
293
293
Radial weights for all orders up to N and the given wavenumbers.
294
294
"""
295
295
k = util .asarray_1d (k )
@@ -301,8 +301,8 @@ def circular_ls(N, k, r, rs, setup):
301
301
bn = bn [np .newaxis , :]
302
302
for i , x in enumerate (krs ):
303
303
Hn = special .hankel2 (n , x )
304
- bn [i , :] = bn [i , :] * - 1j / 4 * Hn
305
- return np .squeeze (bn )
304
+ bn [i , :] = bn [i , :] * Hn
305
+ return - 1j / 4 * np .squeeze (bn )
306
306
307
307
308
308
def circ_radial_weights (N , kr , setup ):
@@ -327,7 +327,7 @@ def circ_radial_weights(N, kr, setup):
327
327
328
328
Returns
329
329
-------
330
- bn : (M, N+1) numpy.ndarray
330
+ bn : (M, 2* N+1) numpy.ndarray
331
331
Radial weights for all orders up to N and the given wavenumbers.
332
332
333
333
"""
@@ -374,27 +374,3 @@ def circ_diagonal_mode_mat(bk):
374
374
for k in range (K ):
375
375
Bk [k , :, :] = np .diag (bk [k , :])
376
376
return np .squeeze (Bk )
377
-
378
-
379
- def mirror_vec (v ):
380
- """Mirror elements in a vector.
381
-
382
- Returns a vector of length *2*len(v)-1* with symmetric elements.
383
- The first *len(v)* elements are the same as *v* and the last *len(v)-1*
384
- elements are *v[:0:-1]*. The function can be used to order the circular
385
- harmonic coefficients. If *v* is a matrix, it is treated as a stack of
386
- vectors residing in the last index and broadcast accordingly.
387
-
388
- Parameters
389
- ----------
390
- v : (, N+1) numpy.ndarray
391
- Input vector of stack of input vectors
392
-
393
- Returns
394
- -------
395
- : (, 2*N+1) numpy.ndarray
396
- Vector of stack of vectors containing mirrored elements
397
- """
398
- if len (v .shape ) == 1 :
399
- v = v [np .newaxis , :]
400
- return np .concatenate ((v , v [:, :0 :- 1 ]), axis = 1 )
0 commit comments