Skip to content

Commit 21f25ac

Browse files
committed
Fix remaining inner1d errors
1 parent 559249e commit 21f25ac

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

sfs/fd/wfs.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def plot(d, selection, secondary_source):
3232
3333
"""
3434
import numpy as _np
35-
from numpy.core.umath_tests import inner1d as _inner1d
3635
from scipy.special import hankel2 as _hankel2
3736

3837
from . import secondary_source_line as _secondary_source_line
@@ -91,7 +90,7 @@ def line_2d(omega, x0, n0, xs, *, c=None):
9190
k = _util.wavenumber(omega, c)
9291
ds = x0 - xs
9392
r = _np.linalg.norm(ds, axis=1)
94-
d = -1j/2 * k * _inner1d(ds, n0) / r * _hankel2(1, k * r)
93+
d = -1j/2 * k * _util._inner1d(ds, n0) / r * _hankel2(1, k * r)
9594
selection = _util.source_selection_line(n0, x0, xs)
9695
return d, selection, _secondary_source_line(omega, c)
9796

@@ -147,7 +146,7 @@ def _point(omega, x0, n0, xs, *, c=None):
147146
k = _util.wavenumber(omega, c)
148147
ds = x0 - xs
149148
r = _np.linalg.norm(ds, axis=1)
150-
d = 1j * k * _inner1d(ds, n0) / r ** (3 / 2) * _np.exp(-1j * k * r)
149+
d = 1j * k * _util._inner1d(ds, n0) / r ** (3 / 2) * _np.exp(-1j * k * r)
151150
selection = _util.source_selection_point(n0, x0, xs)
152151
return d, selection, _secondary_source_point(omega, c)
153152

@@ -234,7 +233,7 @@ def point_25d(omega, x0, n0, xs, xref=[0, 0, 0], c=None, omalias=None):
234233
preeq_25d(omega, omalias, c) *
235234
_np.sqrt(8 * _np.pi) *
236235
_np.sqrt((r * s) / (r + s)) *
237-
_inner1d(n0, ds) / s *
236+
_util._inner1d(n0, ds) / s *
238237
_np.exp(-1j * k * s) / (4 * _np.pi * s))
239238
selection = _util.source_selection_point(n0, x0, xs)
240239
return d, selection, _secondary_source_point(omega, c)
@@ -316,7 +315,7 @@ def point_25d_legacy(omega, x0, n0, xs, xref=[0, 0, 0], c=None, omalias=None):
316315
r = _np.linalg.norm(ds, axis=1)
317316
d = (
318317
preeq_25d(omega, omalias, c) *
319-
_np.sqrt(_np.linalg.norm(xref - x0)) * _inner1d(ds, n0) /
318+
_np.sqrt(_np.linalg.norm(xref - x0)) * _util._inner1d(ds, n0) /
320319
r ** (3 / 2) * _np.exp(-1j * k * r))
321320
selection = _util.source_selection_point(n0, x0, xs)
322321
return d, selection, _secondary_source_point(omega, c)
@@ -499,7 +498,7 @@ def _focused(omega, x0, n0, xs, ns, *, c=None):
499498
k = _util.wavenumber(omega, c)
500499
ds = x0 - xs
501500
r = _np.linalg.norm(ds, axis=1)
502-
d = 1j * k * _inner1d(ds, n0) / r ** (3 / 2) * _np.exp(1j * k * r)
501+
d = 1j * k * _util._inner1d(ds, n0) / r ** (3 / 2) * _np.exp(1j * k * r)
503502
selection = _util.source_selection_focused(ns, x0, xs)
504503
return d, selection, _secondary_source_point(omega, c)
505504

@@ -569,7 +568,7 @@ def focused_25d(omega, x0, n0, xs, ns, *, xref=[0, 0, 0], c=None,
569568
r = _np.linalg.norm(ds, axis=1)
570569
d = (
571570
preeq_25d(omega, omalias, c) *
572-
_np.sqrt(_np.linalg.norm(xref - x0)) * _inner1d(ds, n0) /
571+
_np.sqrt(_np.linalg.norm(xref - x0)) * _util._inner1d(ds, n0) /
573572
r ** (3 / 2) * _np.exp(1j * k * r))
574573
selection = _util.source_selection_focused(ns, x0, xs)
575574
return d, selection, _secondary_source_point(omega, c)

sfs/td/wfs.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def plot(d, selection, secondary_source, t=0):
4444
4545
"""
4646
import numpy as _np
47-
from numpy.core.umath_tests import inner1d as _inner1d
4847

4948
from . import apply_delays as _apply_delays
5049
from . import secondary_source_point as _secondary_source_point
@@ -119,8 +118,8 @@ def plane_25d(x0, n0, n=[0, 1, 0], xref=[0, 0, 0], c=None):
119118
n = _util.normalize_vector(n)
120119
xref = _util.asarray_1d(xref)
121120
g0 = _np.sqrt(2 * _np.pi * _np.linalg.norm(xref - x0, axis=1))
122-
delays = _inner1d(n, x0) / c
123-
weights = 2 * g0 * _inner1d(n, n0)
121+
delays = _util._inner1d(n, x0) / c
122+
weights = 2 * g0 * _util._inner1d(n, n0)
124123
selection = _util.source_selection_plane(n0, n)
125124
return delays, weights, selection, _secondary_source_point(c)
126125

@@ -208,7 +207,7 @@ def point_25d(x0, n0, xs, xref=[0, 0, 0], c=None):
208207
g0 *= _np.sqrt((x0xs_n*x0xref_n)/(x0xs_n+x0xref_n))
209208

210209
delays = x0xs_n/c
211-
weights = g0*_inner1d(x0xs, n0)
210+
weights = g0 * _util._inner1d(x0xs, n0)
212211
selection = _util.source_selection_point(n0, x0, xs)
213212
return delays, weights, selection, _secondary_source_point(c)
214213

@@ -296,7 +295,7 @@ def point_25d_legacy(x0, n0, xs, xref=[0, 0, 0], c=None):
296295
ds = x0 - xs
297296
r = _np.linalg.norm(ds, axis=1)
298297
delays = r/c
299-
weights = g0 * _inner1d(ds, n0) / (2 * _np.pi * r**(3/2))
298+
weights = g0 * _util._inner1d(ds, n0) / (2 * _np.pi * r**(3/2))
300299
selection = _util.source_selection_point(n0, x0, xs)
301300
return delays, weights, selection, _secondary_source_point(c)
302301

@@ -379,7 +378,7 @@ def focused_25d(x0, n0, xs, ns, xref=[0, 0, 0], c=None):
379378
g0 = _np.sqrt(_np.linalg.norm(xref - x0, axis=1)
380379
/ (_np.linalg.norm(xref - x0, axis=1) + r))
381380
delays = -r/c
382-
weights = g0 * _inner1d(ds, n0) / (2 * _np.pi * r**(3/2))
381+
weights = g0 * _util._inner1d(ds, n0) / (2 * _np.pi * r**(3/2))
383382
selection = _util.source_selection_focused(ns, x0, xs)
384383
return delays, weights, selection, _secondary_source_point(c)
385384

0 commit comments

Comments
 (0)