@@ -86,7 +86,7 @@ def _wfs_plane(omega, x0, n0, n=[0, 1, 0], c=None):
86
86
"""
87
87
x0 = util .asarray_of_rows (x0 )
88
88
n0 = util .asarray_of_rows (n0 )
89
- n = util .asarray_1d (n )
89
+ n = util .normalize_vector (n )
90
90
k = util .wavenumber (omega , c )
91
91
return 2j * k * np .inner (n , n0 ) * np .exp (- 1j * k * np .inner (n , x0 ))
92
92
@@ -106,7 +106,7 @@ def wfs_25d_plane(omega, x0, n0, n=[0, 1, 0], xref=[0, 0, 0], c=None,
106
106
"""
107
107
x0 = util .asarray_of_rows (x0 )
108
108
n0 = util .asarray_of_rows (n0 )
109
- n = util .asarray_1d (n )
109
+ n = util .normalize_vector (n )
110
110
xref = util .asarray_1d (xref )
111
111
k = util .wavenumber (omega , c )
112
112
return wfs_25d_preeq (omega , omalias , c ) * \
@@ -179,7 +179,7 @@ def wfs_25d_preeq(omega, omalias, c):
179
179
def delay_3d_plane (omega , x0 , n0 , n = [0 , 1 , 0 ], c = None ):
180
180
"""Plane wave by simple delay of secondary sources."""
181
181
x0 = util .asarray_of_rows (x0 )
182
- n = util .asarray_1d (n )
182
+ n = util .normalize_vector (n )
183
183
k = util .wavenumber (omega , c )
184
184
return np .exp (- 1j * k * np .inner (n , x0 ))
185
185
@@ -191,7 +191,7 @@ def source_selection_plane(n0, n):
191
191
192
192
"""
193
193
n0 = util .asarray_of_rows (n0 )
194
- n = util .asarray_1d (n )
194
+ n = util .normalize_vector (n )
195
195
return np .inner (n , n0 ) >= defs .selection_tolerance
196
196
197
197
@@ -225,7 +225,7 @@ def source_selection_focused(ns, x0, xs):
225
225
"""
226
226
x0 = util .asarray_of_rows (x0 )
227
227
xs = util .asarray_1d (xs )
228
- ns = util .asarray_1d (ns )
228
+ ns = util .normalize_vector (ns )
229
229
ds = xs - x0
230
230
return inner1d (ns , ds ) >= defs .selection_tolerance
231
231
@@ -251,7 +251,7 @@ def nfchoa_2d_plane(omega, x0, r0, n=[0, 1, 0], max_order=None, c=None):
251
251
"""
252
252
x0 = util .asarray_of_rows (x0 )
253
253
k = util .wavenumber (omega , c )
254
- n = util .asarray_1d (n )
254
+ n = util .normalize_vector (n )
255
255
phi , _ , r = util .cart2sph (* n )
256
256
phi0 = util .cart2sph (* x0 .T )[0 ]
257
257
M = _max_order_circular_harmonics (len (x0 ), max_order )
@@ -305,7 +305,7 @@ def nfchoa_25d_plane(omega, x0, r0, n=[0, 1, 0], max_order=None, c=None):
305
305
"""
306
306
x0 = util .asarray_of_rows (x0 )
307
307
k = util .wavenumber (omega , c )
308
- n = util .asarray_1d (n )
308
+ n = util .normalize_vector (n )
309
309
phi , _ , r = util .cart2sph (* n )
310
310
phi0 = util .cart2sph (* x0 .T )[0 ]
311
311
M = _max_order_circular_harmonics (len (x0 ), max_order )
@@ -345,7 +345,7 @@ def sdm_2d_plane(omega, x0, n0, n=[0, 1, 0], c=None):
345
345
"""
346
346
x0 = util .asarray_of_rows (x0 )
347
347
n0 = util .asarray_of_rows (n0 )
348
- n = util .asarray_1d (n )
348
+ n = util .normalize_vector (n )
349
349
k = util .wavenumber (omega , c )
350
350
return k * n [1 ] * np .exp (- 1j * k * n [0 ] * x0 [:, 0 ])
351
351
@@ -361,7 +361,7 @@ def sdm_25d_plane(omega, x0, n0, n=[0, 1, 0], xref=[0, 0, 0], c=None):
361
361
"""
362
362
x0 = util .asarray_of_rows (x0 )
363
363
n0 = util .asarray_of_rows (n0 )
364
- n = util .asarray_1d (n )
364
+ n = util .normalize_vector (n )
365
365
xref = util .asarray_1d (xref )
366
366
k = util .wavenumber (omega , c )
367
367
return 4j * np .exp (- 1j * k * n [1 ]* xref [1 ]) / hankel2 (0 , k * n [1 ]* xref [1 ]) * \
@@ -420,6 +420,7 @@ def esa_edge_2d_plane(omega, x0, n=[0, 1, 0], alpha=3/2*np.pi, Nc=None, c=None):
420
420
421
421
"""
422
422
x0 = np .asarray (x0 )
423
+ n = util .normalize_vector (n )
423
424
k = util .wavenumber (omega , c )
424
425
phi_s = np .arctan2 (n [1 ], n [0 ]) + np .pi
425
426
L = x0 .shape [0 ]
@@ -477,6 +478,7 @@ def esa_edge_dipole_2d_plane(omega, x0, n=[0, 1, 0], alpha=3/2*np.pi, Nc=None, c
477
478
478
479
"""
479
480
x0 = np .asarray (x0 )
481
+ n = util .normalize_vector (n )
480
482
k = util .wavenumber (omega , c )
481
483
phi_s = np .arctan2 (n [1 ], n [0 ]) + np .pi
482
484
L = x0 .shape [0 ]
0 commit comments