55
66
77def spherical_pw (N , k , r , setup ):
8- """ Computes the radial component of the spherical harmonics expansion of
9- a plane wave impinging on a spherical array.
8+ r"""Radial coefficients for a plane wave
9+
10+ Computes the radial component of the spherical harmonics expansion of a
11+ plane wave impinging on a spherical array.
12+
13+ .. math::
14+
15+ \mathring{P}_n(k) = 4 \pi i^n b_n(kr)
1016
1117 Parameters
1218 ----------
@@ -27,15 +33,21 @@ def spherical_pw(N, k, r, setup):
2733 kr = util .asarray_1d (k * r )
2834 n = np .arange (N + 1 )
2935
30- bn = _bn (N , kr , setup )
36+ bn = weights (N , kr , setup )
3137 for i , x in enumerate (kr ):
3238 bn [i , :] = bn [i , :] * 4 * np .pi * (1j )** n
3339 return bn
3440
3541
3642def spherical_ps (N , k , r , rs , setup ):
37- """ Computes the radial component of the spherical harmonics expansion of
38- a point source impinging on a spherical array.
43+ r"""Radial coefficients for a point source
44+
45+ Computes the radial component of the spherical harmonics expansion of a
46+ point source impinging on a spherical array.
47+
48+ .. math::
49+
50+ \mathring{P}_n(k) = 4 \pi (-i) k h_n^{(2)}(k r_s) b_n(kr)
3951
4052 Parameters
4153 ----------
@@ -59,17 +71,40 @@ def spherical_ps(N, k, r, rs, setup):
5971 krs = k * rs
6072 n = np .arange (N + 1 )
6173
62- bn = _bn (N , k * r , setup )
74+ bn = weights (N , k * r , setup )
6375 for i , x in enumerate (krs ):
6476 hn = special .spherical_jn (n , x ) - 1j * special .spherical_yn (n , x )
6577 bn [i , :] = bn [i , :] * 4 * np .pi * (- 1j ) * hn * k [i ]
6678
6779 return bn
6880
6981
70- def _bn (N , kr , setup ):
71- """ Computes the radial weighing functions b_n(kr)
72- (cf. eq.(2.62), Rafaely 2015) for diferent array types.
82+ def weights (N , kr , setup ):
83+ r"""Radial weighing functions
84+
85+ Computes the radial weighting functions for diferent array types
86+ (cf. eq.(2.62), Rafaely 2015).
87+
88+ For instance for an rigid array
89+
90+ .. math::
91+
92+ b_n(kr) = j_n(kr) - \frac{j_n^\prime(kr)}{h_n^{(2)\prime}(kr)}h_n^{(2)}(kr)
93+
94+ Parameters
95+ ----------
96+ N : int
97+ Maximum order.
98+ kr : array_like
99+ Wavenumber * radius.
100+ setup : {'open', 'card', 'rigid'}
101+ Array configuration (open, cardioids, rigid).
102+
103+ Returns
104+ -------
105+ numpy.ndarray
106+ Radial weights for all orders up to N and the given wavenumbers.
107+
73108 """
74109 n = np .arange (N + 1 )
75110 bns = np .zeros ((len (kr ), N + 1 ), dtype = complex )
0 commit comments