15
15
16
16
17
17
class ArrayData (namedtuple ('ArrayData' , 'x n a' )):
18
- """Get named tuple returned by array functions.
18
+ """Named tuple returned by array functions.
19
19
20
20
See `collections.namedtuple`.
21
21
@@ -43,7 +43,7 @@ def take(self, indices):
43
43
44
44
45
45
def linear (N , spacing , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
46
- """Get linear, equidistantly sampled secondary source distribution.
46
+ """Return linear, equidistantly sampled secondary source distribution.
47
47
48
48
Parameters
49
49
----------
@@ -78,7 +78,7 @@ def linear(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
78
78
79
79
80
80
def linear_diff (distances , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
81
- """Get linear secondary source distribution from a list of distances.
81
+ """Return linear secondary source distribution from a list of distances.
82
82
83
83
Parameters
84
84
----------
@@ -112,7 +112,7 @@ def linear_diff(distances, center=[0, 0, 0], orientation=[1, 0, 0]):
112
112
113
113
def linear_random (N , min_spacing , max_spacing , center = [0 , 0 , 0 ],
114
114
orientation = [1 , 0 , 0 ], seed = None ):
115
- """Get randomly sampled linear array.
115
+ """Return randomly sampled linear array.
116
116
117
117
Parameters
118
118
----------
@@ -136,7 +136,10 @@ def linear_random(N, min_spacing, max_spacing, center=[0, 0, 0],
136
136
.. plot::
137
137
:context: close-figs
138
138
139
- x0, n0, a0 = sfs.array.linear_random(12, 0.15, 0.4, orientation=[0, -1, 0])
139
+ x0, n0, a0 = sfs.array.linear_random(
140
+ N=12,
141
+ min_spacing=0.15, max_spacing=0.4,
142
+ orientation=[0, -1, 0])
140
143
sfs.plot.loudspeaker_2d(x0, n0, a0)
141
144
plt.axis('equal')
142
145
plt.xlabel('x / m')
@@ -149,7 +152,7 @@ def linear_random(N, min_spacing, max_spacing, center=[0, 0, 0],
149
152
150
153
151
154
def circular (N , R , center = [0 , 0 , 0 ]):
152
- """Get circular secondary source distribution parallel to the xy-plane.
155
+ """Return circular secondary source distribution parallel to the xy-plane.
153
156
154
157
Parameters
155
158
----------
@@ -191,7 +194,7 @@ def circular(N, R, center=[0, 0, 0]):
191
194
192
195
193
196
def rectangular (N , spacing , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
194
- """Get rectangular secondary source distribution.
197
+ """Return rectangular secondary source distribution.
195
198
196
199
Parameters
197
200
----------
@@ -239,7 +242,8 @@ def rectangular(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
239
242
240
243
241
244
def rounded_edge (Nxy , Nr , dx , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
242
- """Get secondary source distribution along the xy-axis with rounded edge at the origin.
245
+ """Return secondary source distribution along the xy-axis with rounded
246
+ edge at the origin.
243
247
244
248
Parameters
245
249
----------
@@ -313,7 +317,8 @@ def rounded_edge(Nxy, Nr, dx, center=[0, 0, 0], orientation=[1, 0, 0]):
313
317
314
318
315
319
def edge (Nxy , dx , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
316
- """Get secondary source distribution along the xy-axis with sharp edge at the origin.
320
+ """Return secondary source distribution along the xy-axis with sharp
321
+ edge at the origin.
317
322
318
323
Parameters
319
324
----------
@@ -365,7 +370,7 @@ def edge(Nxy, dx, center=[0, 0, 0], orientation=[1, 0, 0]):
365
370
366
371
367
372
def planar (N , spacing , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
368
- """Get planar secondary source distribtion.
373
+ """Return planar secondary source distribtion.
369
374
370
375
Parameters
371
376
----------
@@ -389,7 +394,9 @@ def planar(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
389
394
.. plot::
390
395
:context: close-figs
391
396
392
- x0, n0, a0 = sfs.array.planar((4,3), 0.5, center=[0, 0, 0], orientation=[0, 0, 1])
397
+ x0, n0, a0 = sfs.array.planar(
398
+ N=(4,3), spacing=0.5,
399
+ center=[0, 0, 0], orientation=[0, 0, 1])
393
400
sfs.plot.loudspeaker_2d(x0, n0, a0)
394
401
plt.axis('equal')
395
402
plt.xlabel('x / m')
@@ -409,7 +416,7 @@ def planar(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
409
416
410
417
411
418
def cube (N , spacing , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
412
- """Get cube-shaped secondary source distribtion.
419
+ """Return cube-shaped secondary source distribtion.
413
420
414
421
Parameters
415
422
----------
@@ -433,7 +440,9 @@ def cube(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
433
440
.. plot::
434
441
:context: close-figs
435
442
436
- x0, n0, a0 = sfs.array.cube(2, 0.5, center=[0, 0, 0], orientation=[1, 0, 0])
443
+ x0, n0, a0 = sfs.array.cube(
444
+ N=2, spacing=0.5,
445
+ center=[0, 0, 0], orientation=[1, 0, 0])
437
446
sfs.plot.loudspeaker_2d(x0, n0, a0)
438
447
plt.axis('equal')
439
448
plt.xlabel('x / m')
@@ -489,7 +498,10 @@ def sphere_load(file, radius, center=[0, 0, 0]):
489
498
.. plot::
490
499
:context: close-figs
491
500
492
- x0, n0, a0 = sfs.array.sphere_load('../data/arrays/example_array_6LS_3D.txt', radius=2, center=[0, 0, 0])
501
+ x0, n0, a0 = sfs.array.sphere_load(
502
+ '../data/arrays/example_array_6LS_3D.txt',
503
+ radius=2,
504
+ center=[0, 0, 0])
493
505
sfs.plot.loudspeaker_2d(x0, n0, a0, size=0.25)
494
506
plt.axis('equal')
495
507
plt.xlabel('x / m')
@@ -541,7 +553,8 @@ def load(file, center=[0, 0, 0], orientation=[1, 0, 0]):
541
553
.. plot::
542
554
:context: close-figs
543
555
544
- x0, n0, a0 = sfs.array.load('../data/arrays/wfs_university_rostock_2018.csv')
556
+ x0, n0, a0 = sfs.array.load(
557
+ '../data/arrays/wfs_university_rostock_2018.csv')
545
558
sfs.plot.loudspeaker_2d(x0, n0, a0)
546
559
plt.axis('equal')
547
560
plt.xlabel('x / m')
@@ -626,7 +639,8 @@ def concatenate(*arrays):
626
639
Returns
627
640
-------
628
641
`ArrayData`
629
- Positions, orientations and weights of the concatenated secondary sources.
642
+ Positions, orientations and weights
643
+ of the concatenated secondary sources.
630
644
631
645
Examples
632
646
--------
0 commit comments