From 23368d827a5630c444b5e6190c3347df30cd961c Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Mon, 11 Mar 2019 13:03:43 +0100 Subject: [PATCH] add ESA driving functions docstring examples for monopoles for new handling --- sfs/mono/drivingfunction.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/sfs/mono/drivingfunction.py b/sfs/mono/drivingfunction.py index cd08f77..de62baf 100644 --- a/sfs/mono/drivingfunction.py +++ b/sfs/mono/drivingfunction.py @@ -518,6 +518,17 @@ def esa_edge_2d_plane(omega, x0, n=[0, 1, 0], alpha=3/2*np.pi, Nc=None, (N,) numpy.ndarray Complex weights of secondary sources. + Examples + -------- + .. plot:: + :context: close-figs + + array = sfs.array.edge(2**6, 0.2, center=[0, 0, 0], orientation=[0, -1, 0]) + d, selection, secondary_source = ( + sfs.mono.drivingfunction.esa_edge_2d_plane( + omega, array.x, npw, alpha=3/2*np.pi)) + plot(np.nan_to_num(d), selection, secondary_source) + """ x0 = np.asarray(x0) 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): (N,) numpy.ndarray Complex weights of secondary sources. + Examples + -------- + .. plot:: + :context: close-figs + + array = sfs.array.edge(2**6, 0.2, center=[0, 0, 0], orientation=[0, -1, 0]) + d, selection, secondary_source = ( + sfs.mono.drivingfunction.esa_edge_2d_line( + omega, array.x, xs, alpha=3/2*np.pi)) + plot(np.nan_to_num(d), selection, secondary_source) + """ x0 = np.asarray(x0) 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, (N,) numpy.ndarray Complex weights of secondary sources. + Examples + -------- + .. plot:: + :context: close-figs + + array = sfs.array.edge(2**6, 0.2, center=[0, 0, 0], orientation=[0, -1, 0]) + d, selection, secondary_source = ( + sfs.mono.drivingfunction.esa_edge_25d_point( + omega, array.x, xs, xref=[2, -2, 0], alpha=3/2*np.pi)) + plot(np.nan_to_num(d), selection, secondary_source) + """ x0 = np.asarray(x0) xs = np.asarray(xs)