Skip to content

Commit 23368d8

Browse files
committed
add ESA driving functions docstring examples for monopoles for new handling
1 parent 8bb6387 commit 23368d8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

sfs/mono/drivingfunction.py

+33
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,17 @@ def esa_edge_2d_plane(omega, x0, n=[0, 1, 0], alpha=3/2*np.pi, Nc=None,
518518
(N,) numpy.ndarray
519519
Complex weights of secondary sources.
520520
521+
Examples
522+
--------
523+
.. plot::
524+
:context: close-figs
525+
526+
array = sfs.array.edge(2**6, 0.2, center=[0, 0, 0], orientation=[0, -1, 0])
527+
d, selection, secondary_source = (
528+
sfs.mono.drivingfunction.esa_edge_2d_plane(
529+
omega, array.x, npw, alpha=3/2*np.pi))
530+
plot(np.nan_to_num(d), selection, secondary_source)
531+
521532
"""
522533
x0 = np.asarray(x0)
523534
n = util.normalize_vector(n)
@@ -633,6 +644,17 @@ def esa_edge_2d_line(omega, x0, xs, alpha=3/2*np.pi, Nc=None, c=None):
633644
(N,) numpy.ndarray
634645
Complex weights of secondary sources.
635646
647+
Examples
648+
--------
649+
.. plot::
650+
:context: close-figs
651+
652+
array = sfs.array.edge(2**6, 0.2, center=[0, 0, 0], orientation=[0, -1, 0])
653+
d, selection, secondary_source = (
654+
sfs.mono.drivingfunction.esa_edge_2d_line(
655+
omega, array.x, xs, alpha=3/2*np.pi))
656+
plot(np.nan_to_num(d), selection, secondary_source)
657+
636658
"""
637659
x0 = np.asarray(x0)
638660
k = util.wavenumber(omega, c)
@@ -698,6 +720,17 @@ def esa_edge_25d_point(omega, x0, xs, xref=[2, -2, 0], alpha=3/2*np.pi,
698720
(N,) numpy.ndarray
699721
Complex weights of secondary sources.
700722
723+
Examples
724+
--------
725+
.. plot::
726+
:context: close-figs
727+
728+
array = sfs.array.edge(2**6, 0.2, center=[0, 0, 0], orientation=[0, -1, 0])
729+
d, selection, secondary_source = (
730+
sfs.mono.drivingfunction.esa_edge_25d_point(
731+
omega, array.x, xs, xref=[2, -2, 0], alpha=3/2*np.pi))
732+
plot(np.nan_to_num(d), selection, secondary_source)
733+
701734
"""
702735
x0 = np.asarray(x0)
703736
xs = np.asarray(xs)

0 commit comments

Comments
 (0)