@@ -261,9 +261,7 @@ def circular_pw(N, k, r, setup):
261261 n = np .arange (N + 1 )
262262
263263 bn = circ_radial_weights (N , kr , setup )
264- for i , x in enumerate (kr ):
265- bn [i , :] = bn [i , :] * (1j )** (n )
266- return bn
264+ return (1j )** (n ) * bn
267265
268266
269267def circular_ls (N , k , r , rs , setup ):
@@ -299,10 +297,12 @@ def circular_ls(N, k, r, rs, setup):
299297 n = np .arange (N + 1 )
300298
301299 bn = circ_radial_weights (N , k * r , setup )
300+ if len (k ) == 1 :
301+ bn = bn [np .newaxis , :]
302302 for i , x in enumerate (krs ):
303303 Hn = special .hankel2 (n , x )
304304 bn [i , :] = bn [i , :] * - 1j / 4 * Hn
305- return bn
305+ return np . squeeze ( bn )
306306
307307
308308def circ_radial_weights (N , kr , setup ):
@@ -331,6 +331,7 @@ def circ_radial_weights(N, kr, setup):
331331 Radial weights for all orders up to N and the given wavenumbers.
332332
333333 """
334+ kr = util .asarray_1d (kr )
334335 n = np .arange (N + 1 )
335336 Bns = np .zeros ((len (kr ), N + 1 ), dtype = complex )
336337 for i , x in enumerate (kr ):
0 commit comments