acoular 25.4__tar.gz → 25.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {acoular-25.4 → acoular-25.7}/.gitignore +3 -0
- {acoular-25.4 → acoular-25.7}/PKG-INFO +3 -3
- {acoular-25.4 → acoular-25.7}/README.md +1 -1
- {acoular-25.4 → acoular-25.7}/acoular/__init__.py +2 -4
- {acoular-25.4 → acoular-25.7}/acoular/aiaa/aiaa.py +4 -2
- {acoular-25.4 → acoular-25.7}/acoular/base.py +14 -33
- {acoular-25.4 → acoular-25.7}/acoular/calib.py +2 -2
- {acoular-25.4 → acoular-25.7}/acoular/configuration.py +1 -1
- {acoular-25.4 → acoular-25.7}/acoular/demo/__init__.py +6 -1
- {acoular-25.4 → acoular-25.7}/acoular/demo/acoular_demo.py +34 -10
- {acoular-25.4 → acoular-25.7}/acoular/deprecation.py +10 -1
- {acoular-25.4 → acoular-25.7}/acoular/environments.py +5 -4
- {acoular-25.4 → acoular-25.7}/acoular/fastFuncs.py +16 -10
- {acoular-25.4 → acoular-25.7}/acoular/fbeamform.py +10 -107
- {acoular-25.4 → acoular-25.7}/acoular/fprocess.py +3 -32
- {acoular-25.4 → acoular-25.7}/acoular/grids.py +144 -37
- {acoular-25.4 → acoular-25.7}/acoular/h5cache.py +5 -3
- {acoular-25.4 → acoular-25.7}/acoular/h5files.py +10 -0
- {acoular-25.4 → acoular-25.7}/acoular/internal.py +4 -0
- {acoular-25.4 → acoular-25.7}/acoular/microphones.py +19 -2
- {acoular-25.4 → acoular-25.7}/acoular/process.py +3 -45
- {acoular-25.4 → acoular-25.7}/acoular/sdinput.py +12 -4
- {acoular-25.4 → acoular-25.7}/acoular/signals.py +2 -2
- {acoular-25.4 → acoular-25.7}/acoular/sources.py +27 -24
- {acoular-25.4 → acoular-25.7}/acoular/spectra.py +3 -2
- {acoular-25.4 → acoular-25.7}/acoular/tbeamform.py +3 -0
- {acoular-25.4 → acoular-25.7}/acoular/tools/helpers.py +27 -0
- acoular-25.7/acoular/tprocess.py +2898 -0
- {acoular-25.4 → acoular-25.7}/acoular/traitsviews.py +1 -3
- {acoular-25.4 → acoular-25.7}/acoular/version.py +4 -3
- {acoular-25.4 → acoular-25.7}/pyproject.toml +3 -3
- acoular-25.4/acoular/tprocess.py +0 -2117
- {acoular-25.4 → acoular-25.7}/AUTHORS.rst +0 -0
- {acoular-25.4 → acoular-25.7}/LICENSE +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/aiaa/__init__.py +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/tfastfuncs.py +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/tools/__init__.py +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/tools/metrics.py +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/tools/utils.py +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/trajectory.py +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/HW90D240_f10.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/W90_D105_f10.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/acousticam_2c.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/acousticam_4c.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array38.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array92x.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array_56.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array_56_10_9.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array_56_bomb.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array_56_v2.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array_64.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array_84_10_9.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/array_84_bomb_v3.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/calib_vw_ring32.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/gfai_ring32.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/minidsp_uma-16.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/minidsp_uma-16_mirrored.xml +0 -0
- {acoular-25.4 → acoular-25.7}/acoular/xml/tub_vogel64.xml +0 -0
|
@@ -24,6 +24,9 @@ MANIFEST
|
|
|
24
24
|
examples/all_bf.sav
|
|
25
25
|
examples/benchmark/results/
|
|
26
26
|
**/three_sources.h5
|
|
27
|
+
**/three_sources_1d.h5
|
|
28
|
+
**/three_sources_2d.h5
|
|
29
|
+
**/three_sources_3d.h5
|
|
27
30
|
docs/source/sg_execution_times.rst
|
|
28
31
|
docs/source/api_ref/generated/
|
|
29
32
|
docs/source/auto_examples/**/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: acoular
|
|
3
|
-
Version: 25.
|
|
3
|
+
Version: 25.7
|
|
4
4
|
Summary: Python library for acoustic beamforming
|
|
5
5
|
Project-URL: homepage, https://acoular.org
|
|
6
6
|
Project-URL: documentation, https://acoular.org
|
|
@@ -51,7 +51,7 @@ Requires-Python: <3.14,>=3.10
|
|
|
51
51
|
Requires-Dist: numba
|
|
52
52
|
Requires-Dist: numpy
|
|
53
53
|
Requires-Dist: scikit-learn
|
|
54
|
-
Requires-Dist: scipy
|
|
54
|
+
Requires-Dist: scipy!=1.16.*,>=1.1.0
|
|
55
55
|
Requires-Dist: tables
|
|
56
56
|
Requires-Dist: traits>=6.0
|
|
57
57
|
Provides-Extra: dev
|
|
@@ -228,7 +228,7 @@ pm = bb.synthetic( 8000, 3 )
|
|
|
228
228
|
# compute the sound pressure level
|
|
229
229
|
Lm = ac.L_p( pm )
|
|
230
230
|
# plot the map
|
|
231
|
-
plt.imshow( Lm.T, origin='lower', vmin=Lm.max()-10, extent=rg.
|
|
231
|
+
plt.imshow( Lm.T, origin='lower', vmin=Lm.max()-10, extent=rg.extent, \
|
|
232
232
|
interpolation='bicubic')
|
|
233
233
|
plt.title('Beamformer (base) for 3 sources measured for 8000 Hz')
|
|
234
234
|
plt.xlabel('x in m')
|
|
@@ -118,7 +118,7 @@ pm = bb.synthetic( 8000, 3 )
|
|
|
118
118
|
# compute the sound pressure level
|
|
119
119
|
Lm = ac.L_p( pm )
|
|
120
120
|
# plot the map
|
|
121
|
-
plt.imshow( Lm.T, origin='lower', vmin=Lm.max()-10, extent=rg.
|
|
121
|
+
plt.imshow( Lm.T, origin='lower', vmin=Lm.max()-10, extent=rg.extent, \
|
|
122
122
|
interpolation='bicubic')
|
|
123
123
|
plt.title('Beamformer (base) for 3 sources measured for 8000 Hz')
|
|
124
124
|
plt.xlabel('x in m')
|
|
@@ -16,7 +16,6 @@ from .base import (
|
|
|
16
16
|
SamplesGenerator,
|
|
17
17
|
SpectraGenerator,
|
|
18
18
|
SpectraOut,
|
|
19
|
-
TimeInOut,
|
|
20
19
|
TimeOut,
|
|
21
20
|
)
|
|
22
21
|
from .calib import Calib
|
|
@@ -52,7 +51,7 @@ from .fbeamform import (
|
|
|
52
51
|
SteeringVector,
|
|
53
52
|
integrate,
|
|
54
53
|
)
|
|
55
|
-
from .fprocess import IRFFT, RFFT, AutoPowerSpectra, CrossPowerSpectra
|
|
54
|
+
from .fprocess import IRFFT, RFFT, AutoPowerSpectra, CrossPowerSpectra
|
|
56
55
|
from .grids import (
|
|
57
56
|
CircSector,
|
|
58
57
|
ConvexSector,
|
|
@@ -69,7 +68,7 @@ from .grids import (
|
|
|
69
68
|
Sector,
|
|
70
69
|
)
|
|
71
70
|
from .microphones import MicGeom
|
|
72
|
-
from .process import Average, Cache, SampleSplitter
|
|
71
|
+
from .process import Average, Cache, SampleSplitter
|
|
73
72
|
from .sdinput import SoundDeviceSamplesGenerator
|
|
74
73
|
from .signals import (
|
|
75
74
|
FiltWNoiseGenerator,
|
|
@@ -117,7 +116,6 @@ from .tprocess import (
|
|
|
117
116
|
FiltFiltOctave,
|
|
118
117
|
FiltFreqWeight,
|
|
119
118
|
FiltOctave,
|
|
120
|
-
MaskedTimeInOut,
|
|
121
119
|
MaskedTimeOut,
|
|
122
120
|
Mixer,
|
|
123
121
|
OctaveFilterBank,
|
|
@@ -85,7 +85,7 @@ class TriggerAIAABenchmark(TimeSamplesAIAABenchmark):
|
|
|
85
85
|
(self.num_samples, self.num_channels) = self.data.shape
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
@deprecated_alias({'name': 'file'})
|
|
88
|
+
@deprecated_alias({'name': 'file'}, removal_version='25.10')
|
|
89
89
|
class CsmAIAABenchmark(PowerSpectraImport):
|
|
90
90
|
"""Class to load the CSM that is stored in AIAA Benchmark HDF5 file."""
|
|
91
91
|
|
|
@@ -174,7 +174,9 @@ class MicAIAABenchmark(MicGeom):
|
|
|
174
174
|
|
|
175
175
|
@on_trait_change('file')
|
|
176
176
|
def _import_mpos(self):
|
|
177
|
-
"""
|
|
177
|
+
"""
|
|
178
|
+
Import the microphone positions from .h5 file.
|
|
179
|
+
|
|
178
180
|
Called when :attr:`basename` changes.
|
|
179
181
|
"""
|
|
180
182
|
file = _get_h5file_class()
|
|
@@ -16,7 +16,6 @@ to be used directly, but to be subclassed by classes that implement the actual s
|
|
|
16
16
|
InOut
|
|
17
17
|
TimeOut
|
|
18
18
|
SpectraOut
|
|
19
|
-
TimeInOut
|
|
20
19
|
"""
|
|
21
20
|
|
|
22
21
|
from abc import abstractmethod
|
|
@@ -37,7 +36,7 @@ from .deprecation import deprecated_alias
|
|
|
37
36
|
from .internal import digest
|
|
38
37
|
|
|
39
38
|
|
|
40
|
-
@deprecated_alias({'numchannels': 'num_channels', 'numsamples': 'num_samples'})
|
|
39
|
+
@deprecated_alias({'numchannels': 'num_channels', 'numsamples': 'num_samples'}, removal_version='25.10')
|
|
41
40
|
class Generator(ABCHasStrictTraits):
|
|
42
41
|
"""Interface for any generating signal processing block.
|
|
43
42
|
|
|
@@ -157,10 +156,10 @@ class SpectraGenerator(Generator):
|
|
|
157
156
|
"""
|
|
158
157
|
|
|
159
158
|
|
|
160
|
-
@deprecated_alias({'numchannels': 'num_channels', 'numsamples': 'num_samples'}, read_only=True)
|
|
159
|
+
@deprecated_alias({'numchannels': 'num_channels', 'numsamples': 'num_samples'}, read_only=True, removal_version='25.10')
|
|
161
160
|
class TimeOut(SamplesGenerator):
|
|
162
|
-
"""
|
|
163
|
-
:attr:`source`
|
|
161
|
+
"""
|
|
162
|
+
Abstract base class receiving from a :attr:`source` and returning time domain signals.
|
|
164
163
|
|
|
165
164
|
It provides a base class that can be used to create signal processing blocks that receive data
|
|
166
165
|
from any generating :attr:`source` and generates a time signal output via the generator
|
|
@@ -205,10 +204,14 @@ class TimeOut(SamplesGenerator):
|
|
|
205
204
|
"""
|
|
206
205
|
|
|
207
206
|
|
|
208
|
-
@deprecated_alias(
|
|
207
|
+
@deprecated_alias(
|
|
208
|
+
{'numchannels': 'num_channels', 'numsamples': 'num_samples', 'numfreqs': 'num_freqs'},
|
|
209
|
+
read_only=True,
|
|
210
|
+
removal_version='25.10',
|
|
211
|
+
)
|
|
209
212
|
class SpectraOut(SpectraGenerator):
|
|
210
|
-
"""
|
|
211
|
-
:attr:`source`
|
|
213
|
+
"""
|
|
214
|
+
Abstract base class receiving from a :attr:`source` and returning frequency domain signals.
|
|
212
215
|
|
|
213
216
|
It provides a base class that can be used to create signal processing blocks that receive data
|
|
214
217
|
from any generating :attr:`source` domain and generates a frequency domain output via the
|
|
@@ -260,10 +263,10 @@ class SpectraOut(SpectraGenerator):
|
|
|
260
263
|
"""
|
|
261
264
|
|
|
262
265
|
|
|
263
|
-
@deprecated_alias({'numchannels': 'num_channels', 'numsamples': 'num_samples'}, read_only=True)
|
|
266
|
+
@deprecated_alias({'numchannels': 'num_channels', 'numsamples': 'num_samples'}, read_only=True, removal_version='25.10')
|
|
264
267
|
class InOut(SamplesGenerator, SpectraGenerator):
|
|
265
|
-
"""
|
|
266
|
-
:attr:`source`
|
|
268
|
+
"""
|
|
269
|
+
Abstract base class receiving from a :attr:`source` and returning signals in the same domain.
|
|
267
270
|
|
|
268
271
|
It provides a base class that can be used to create signal processing blocks that receive data
|
|
269
272
|
from any generating :attr:`source` and generates an output via the generator :meth:`result` in
|
|
@@ -308,25 +311,3 @@ class InOut(SamplesGenerator, SpectraGenerator):
|
|
|
308
311
|
numpy.ndarray
|
|
309
312
|
Two-dimensional output data block of shape (num, ...)
|
|
310
313
|
"""
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
class TimeInOut(TimeOut):
|
|
314
|
-
"""Deprecated alias for :class:`~acoular.base.TimeOut`.
|
|
315
|
-
|
|
316
|
-
.. deprecated:: 24.10
|
|
317
|
-
Using :class:`~acoular.base.TimeInOut` is deprecated and will be removed in Acoular 25.07.
|
|
318
|
-
Use :class:`~acoular.base.TimeOut` instead.
|
|
319
|
-
"""
|
|
320
|
-
|
|
321
|
-
#: Data source; :class:`~acoular.base.SamplesGenerator` or derived object.
|
|
322
|
-
source = Instance(SamplesGenerator)
|
|
323
|
-
|
|
324
|
-
def __init__(self, *args, **kwargs):
|
|
325
|
-
super().__init__(*args, **kwargs)
|
|
326
|
-
import warnings
|
|
327
|
-
|
|
328
|
-
warnings.warn(
|
|
329
|
-
'TimeInOut is deprecated and will be removed in Acoular 25.07. Use TimeOut instead.',
|
|
330
|
-
DeprecationWarning,
|
|
331
|
-
stacklevel=2,
|
|
332
|
-
)
|
|
@@ -24,7 +24,7 @@ from .deprecation import deprecated_alias
|
|
|
24
24
|
from .internal import digest
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
@deprecated_alias({'from_file': 'file'})
|
|
27
|
+
@deprecated_alias({'from_file': 'file'}, removal_version='25.10')
|
|
28
28
|
class Calib(InOut):
|
|
29
29
|
"""Processing block for handling calibration data in `*.xml` or NumPy format.
|
|
30
30
|
|
|
@@ -72,7 +72,6 @@ class Calib(InOut):
|
|
|
72
72
|
0.07458428+0.49657939j 1.772696 +3.92233098j 3.19543248+0.17988554j
|
|
73
73
|
0.3379041 -3.93342331j 0.93949242+2.5328611j 2.97352574+0.j ]]
|
|
74
74
|
|
|
75
|
-
Deprecated and will be removed in Acoular 25.10:
|
|
76
75
|
This class serves as interface to load calibration data for the used
|
|
77
76
|
microphone array. The calibration factors are stored as [Pa/unit].
|
|
78
77
|
"""
|
|
@@ -102,6 +101,7 @@ class Calib(InOut):
|
|
|
102
101
|
|
|
103
102
|
@on_trait_change('data')
|
|
104
103
|
def set_num_mics(self):
|
|
104
|
+
"""Sets the number of microphones based on the shape of the data array."""
|
|
105
105
|
self.num_mics = self.data.shape[0]
|
|
106
106
|
|
|
107
107
|
@cached_property
|
|
@@ -33,28 +33,52 @@ Source Location RMS
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def create_three_sources(mg, h5savefile='three_sources.h5'):
|
|
36
|
-
"""
|
|
37
|
-
|
|
36
|
+
"""
|
|
37
|
+
Create three noise sources and return them as Mixer.
|
|
38
|
+
|
|
39
|
+
Alias for :func:`create_three_sources_2d`.
|
|
40
|
+
"""
|
|
41
|
+
return create_three_sources_2d(mg, h5savefile=h5savefile)
|
|
42
|
+
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
def _create_three_sources(mg, locs, h5savefile='', sfreq=51200, duration=1):
|
|
45
|
+
"""Create three noise sources with custom locations and return them as Mixer."""
|
|
46
|
+
import acoular as ac
|
|
40
47
|
|
|
41
|
-
sfreq = 51200
|
|
42
|
-
duration = 1
|
|
43
48
|
nsamples = duration * sfreq
|
|
44
49
|
|
|
45
50
|
n1 = ac.WNoiseGenerator(sample_freq=sfreq, num_samples=nsamples, seed=1)
|
|
46
51
|
n2 = ac.WNoiseGenerator(sample_freq=sfreq, num_samples=nsamples, seed=2, rms=0.7)
|
|
47
52
|
n3 = ac.WNoiseGenerator(sample_freq=sfreq, num_samples=nsamples, seed=3, rms=0.5)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
pa = ac.Mixer(source=
|
|
53
|
+
|
|
54
|
+
noises = [n1, n2, n3]
|
|
55
|
+
ps = [ac.PointSource(signal=n, mics=mg, loc=loc) for n, loc in list(zip(noises, locs))]
|
|
56
|
+
pa = ac.Mixer(source=ps[0], sources=ps[1:])
|
|
57
|
+
|
|
52
58
|
if h5savefile:
|
|
53
59
|
wh5 = ac.WriteH5(source=pa, file=h5savefile)
|
|
54
60
|
wh5.save()
|
|
55
61
|
return pa
|
|
56
62
|
|
|
57
63
|
|
|
64
|
+
def create_three_sources_1d(mg, h5savefile='three_sources_1d.h5'):
|
|
65
|
+
"""Create three noise sources on a 1D line and return them as Mixer."""
|
|
66
|
+
locs = [(-0.1, 0, -0.3), (0.15, 0, -0.3), (0, 0, -0.3)]
|
|
67
|
+
return _create_three_sources(mg, locs, h5savefile=h5savefile)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def create_three_sources_2d(mg, h5savefile='three_sources_2d.h5'):
|
|
71
|
+
"""Create three noise sources in a 2D plane and return them as Mixer."""
|
|
72
|
+
locs = [(-0.1, -0.1, -0.3), (0.15, 0, -0.3), (0, 0.1, -0.3)]
|
|
73
|
+
return _create_three_sources(mg, locs, h5savefile=h5savefile)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def create_three_sources_3d(mg, h5savefile='three_sources_3d.h5'):
|
|
77
|
+
"""Create three noise sources in 3D space and return them as Mixer."""
|
|
78
|
+
locs = [(-0.1, -0.1, -0.3), (0.15, 0, -0.17), (0, 0.1, -0.25)]
|
|
79
|
+
return _create_three_sources(mg, locs, h5savefile=h5savefile)
|
|
80
|
+
|
|
81
|
+
|
|
58
82
|
def run():
|
|
59
83
|
"""Run the Acoular demo."""
|
|
60
84
|
from pathlib import Path
|
|
@@ -87,7 +111,7 @@ def run():
|
|
|
87
111
|
from matplotlib.pyplot import axis, colorbar, figure, imshow, plot, show
|
|
88
112
|
|
|
89
113
|
# show map
|
|
90
|
-
imshow(spl.T, origin='lower', vmin=spl.max() - 10, extent=rg.
|
|
114
|
+
imshow(spl.T, origin='lower', vmin=spl.max() - 10, extent=rg.extent, interpolation='bicubic')
|
|
91
115
|
colorbar()
|
|
92
116
|
|
|
93
117
|
# plot microphone geometry
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# ------------------------------------------------------------------------------
|
|
2
2
|
# Copyright (c) Acoular Development Team.
|
|
3
3
|
# ------------------------------------------------------------------------------
|
|
4
|
+
"""Implements helper functions for deprecation handling.
|
|
5
|
+
|
|
6
|
+
.. autosummary::
|
|
7
|
+
:toctree: generated/
|
|
8
|
+
|
|
9
|
+
deprecated_alias
|
|
10
|
+
"""
|
|
4
11
|
|
|
5
12
|
from warnings import warn
|
|
6
13
|
|
|
@@ -8,7 +15,9 @@ from traits.api import Property
|
|
|
8
15
|
|
|
9
16
|
|
|
10
17
|
def deprecated_alias(old2new, read_only=False, removal_version=''):
|
|
11
|
-
"""
|
|
18
|
+
"""
|
|
19
|
+
Decorator function for deprecating renamed class traits.
|
|
20
|
+
|
|
12
21
|
Replaced traits should no longer be part of the class definition
|
|
13
22
|
and only mentioned in this decorator's parameter list.
|
|
14
23
|
The replacement trait has to be defined in the updated class and
|
|
@@ -557,8 +557,7 @@ class OpenJet(FlowField):
|
|
|
557
557
|
|
|
558
558
|
class RotatingFlow(FlowField):
|
|
559
559
|
"""
|
|
560
|
-
Analytical approximation of a rotating flow field with
|
|
561
|
-
in z-direction.
|
|
560
|
+
Analytical approximation of a rotating flow field with velocity component in z-direction.
|
|
562
561
|
|
|
563
562
|
This class provides an analytical model for a fluid flow field with a
|
|
564
563
|
rigid-body-like rotation about the z-axis. The flow combines rotational motion
|
|
@@ -595,7 +594,8 @@ class RotatingFlow(FlowField):
|
|
|
595
594
|
|
|
596
595
|
def _get_rpm(self):
|
|
597
596
|
warn(
|
|
598
|
-
'Deprecated use of "rpm" trait
|
|
597
|
+
'Deprecated use of "rpm" trait (will be removed in version 26.01). \
|
|
598
|
+
Please use the "rps" trait instead.',
|
|
599
599
|
DeprecationWarning,
|
|
600
600
|
stacklevel=2,
|
|
601
601
|
)
|
|
@@ -603,7 +603,8 @@ class RotatingFlow(FlowField):
|
|
|
603
603
|
|
|
604
604
|
def _set_rpm(self, rpm):
|
|
605
605
|
warn(
|
|
606
|
-
'Deprecated use of "rpm" trait
|
|
606
|
+
'Deprecated use of "rpm" trait (will be removed in version 26.01). \
|
|
607
|
+
Please use the "rps" trait instead (divide rpm value by -60).',
|
|
607
608
|
DeprecationWarning,
|
|
608
609
|
stacklevel=2,
|
|
609
610
|
)
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# ------------------------------------------------------------------------------
|
|
2
2
|
# Copyright (c) Acoular Development Team.
|
|
3
3
|
# ------------------------------------------------------------------------------
|
|
4
|
-
"""Contains all
|
|
5
|
-
computational costs. All functionalities are optimized via NUMBA.
|
|
6
|
-
"""
|
|
4
|
+
"""Contains all computationally expensive operations and accelerates them with NUMBA."""
|
|
7
5
|
|
|
8
6
|
import numba as nb
|
|
9
7
|
import numpy as np
|
|
@@ -27,7 +25,8 @@ FAST_OPTION = True # fastmath options
|
|
|
27
25
|
)
|
|
28
26
|
def calcCSM(csm, SpecAllMics):
|
|
29
27
|
"""Adds a given spectrum to the Cross-Spectral-Matrix (CSM).
|
|
30
|
-
|
|
28
|
+
|
|
29
|
+
Here, only the upper triangular matrix of the CSM is calculated. After
|
|
31
30
|
averaging over the various ensembles, the whole CSM is created via complex
|
|
32
31
|
conjugation transposing. This happens outside
|
|
33
32
|
(in :class:`PowerSpectra<acoular.spectra.PowerSpectra>`).
|
|
@@ -56,9 +55,11 @@ def calcCSM(csm, SpecAllMics):
|
|
|
56
55
|
|
|
57
56
|
|
|
58
57
|
def beamformerFreq(steerVecType, boolRemovedDiagOfCSM, normFactor, inputTupleSteer, inputTupleCsm):
|
|
59
|
-
r"""
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
r"""
|
|
59
|
+
Conventional beamformer in frequency domain.
|
|
60
|
+
|
|
61
|
+
Use either a predefined steering vector formulation (see Sarradj 2012) or pass your own steering
|
|
62
|
+
vector.
|
|
62
63
|
|
|
63
64
|
Parameters
|
|
64
65
|
----------
|
|
@@ -545,8 +546,11 @@ def _freqBeamformer_EigValProb_SpecificSteerVec_CsmRemovedDiag(
|
|
|
545
546
|
|
|
546
547
|
# %% Point - Spread - Function
|
|
547
548
|
def calcPointSpreadFunction(steerVecType, distGridToArrayCenter, distGridToAllMics, waveNumber, indSource, dtype):
|
|
548
|
-
r"""
|
|
549
|
-
|
|
549
|
+
r"""
|
|
550
|
+
Calculates the Point-Spread-Functions.
|
|
551
|
+
|
|
552
|
+
Use either a predefined steering vector formulation (see :ref:`Sarradj, 2012<Sarradj2012>`) or
|
|
553
|
+
pass it your own steering vector.
|
|
550
554
|
|
|
551
555
|
Parameters
|
|
552
556
|
----------
|
|
@@ -789,7 +793,9 @@ def _psf_Formulation4AkaTrueLocation(
|
|
|
789
793
|
fastmath=FAST_OPTION,
|
|
790
794
|
)
|
|
791
795
|
def damasSolverGaussSeidel(A, dirtyMap, nIterations, relax, damasSolution):
|
|
792
|
-
"""
|
|
796
|
+
"""
|
|
797
|
+
Solves the DAMAS inverse problem via modified gauss seidel.
|
|
798
|
+
|
|
793
799
|
This is the original formulation from :ref:`Brooks and Humphreys, 2006<BrooksHumphreys2006>`.
|
|
794
800
|
|
|
795
801
|
Parameters
|
|
@@ -292,7 +292,7 @@ class LazyBfResult:
|
|
|
292
292
|
self.bf = bf
|
|
293
293
|
|
|
294
294
|
def __getitem__(self, key):
|
|
295
|
-
|
|
295
|
+
"""'intelligent' [] operator, checks if results are available and triggers calculation."""
|
|
296
296
|
sl = index_exp[key][0]
|
|
297
297
|
if isinstance(sl, (int, integer)):
|
|
298
298
|
sl = slice(sl, sl + 1)
|
|
@@ -662,18 +662,15 @@ class BeamformerBase(HasStrictTraits):
|
|
|
662
662
|
msg,
|
|
663
663
|
)
|
|
664
664
|
gshape = self.steer.grid.shape
|
|
665
|
+
num_freqs = self.freq_data.fftfreq().shape[0]
|
|
665
666
|
if num == 0 or frange is None:
|
|
666
667
|
if frange is None:
|
|
667
668
|
ind_low = self.freq_data.ind_low
|
|
668
669
|
ind_high = self.freq_data.ind_high
|
|
669
670
|
if ind_low is None:
|
|
670
671
|
ind_low = 0
|
|
671
|
-
if ind_low < 0:
|
|
672
|
-
ind_low += self._numfreq
|
|
673
672
|
if ind_high is None:
|
|
674
|
-
ind_high =
|
|
675
|
-
if ind_high < 0:
|
|
676
|
-
ind_high += self._numfreq
|
|
673
|
+
ind_high = num_freqs
|
|
677
674
|
irange = (ind_low, ind_high)
|
|
678
675
|
num = 0
|
|
679
676
|
elif len(frange) == 2:
|
|
@@ -683,10 +680,10 @@ class BeamformerBase(HasStrictTraits):
|
|
|
683
680
|
raise TypeError(
|
|
684
681
|
msg,
|
|
685
682
|
)
|
|
686
|
-
h = zeros(
|
|
683
|
+
h = zeros(num_freqs, dtype=float)
|
|
687
684
|
sl = slice(*irange)
|
|
688
685
|
r = self.result[sl]
|
|
689
|
-
for i in range(
|
|
686
|
+
for i in range(num_freqs)[sl]:
|
|
690
687
|
# we do this per frequency because r might not have fancy indexing
|
|
691
688
|
h[i] = r[i - sl.start].reshape(gshape)[ind].sum()
|
|
692
689
|
if frange is None:
|
|
@@ -1148,14 +1145,6 @@ class BeamformerDamas(BeamformerBase):
|
|
|
1148
1145
|
See :cite:`Brooks2006` for details.
|
|
1149
1146
|
"""
|
|
1150
1147
|
|
|
1151
|
-
#: (only for backward compatibility) :class:`BeamformerBase` object
|
|
1152
|
-
#: if set, provides :attr:`freq_data`, :attr:`steer`, :attr:`r_diag`
|
|
1153
|
-
#: if not set, these have to be set explicitly.
|
|
1154
|
-
beamformer = Property(transient=True)
|
|
1155
|
-
|
|
1156
|
-
# private storage of beamformer instance
|
|
1157
|
-
_beamformer = Instance(BeamformerBase)
|
|
1158
|
-
|
|
1159
1148
|
#: The floating-number-precision of the PSFs. Default is 64 bit.
|
|
1160
1149
|
psf_precision = Enum('float64', 'float32', desc='precision of PSF')
|
|
1161
1150
|
|
|
@@ -1174,32 +1163,10 @@ class BeamformerDamas(BeamformerBase):
|
|
|
1174
1163
|
depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['n_iter', 'damp', 'psf_precision'],
|
|
1175
1164
|
)
|
|
1176
1165
|
|
|
1177
|
-
def _get_beamformer(self):
|
|
1178
|
-
return self._beamformer
|
|
1179
|
-
|
|
1180
|
-
def _set_beamformer(self, beamformer):
|
|
1181
|
-
msg = (
|
|
1182
|
-
f"Deprecated use of 'beamformer' trait in class {self.__class__.__name__}. "
|
|
1183
|
-
'Please set :attr:`freq_data`, :attr:`steer`, :attr:`r_diag` directly. '
|
|
1184
|
-
"Using the 'beamformer' trait will be removed in version 25.07."
|
|
1185
|
-
)
|
|
1186
|
-
warn(
|
|
1187
|
-
msg,
|
|
1188
|
-
DeprecationWarning,
|
|
1189
|
-
stacklevel=2,
|
|
1190
|
-
)
|
|
1191
|
-
self._beamformer = beamformer
|
|
1192
|
-
|
|
1193
1166
|
@cached_property
|
|
1194
1167
|
def _get_digest(self):
|
|
1195
1168
|
return digest(self)
|
|
1196
1169
|
|
|
1197
|
-
@on_trait_change('_beamformer.digest')
|
|
1198
|
-
def delegate_beamformer_traits(self):
|
|
1199
|
-
self.freq_data = self.beamformer.freq_data
|
|
1200
|
-
self.r_diag = self.beamformer.r_diag
|
|
1201
|
-
self.steer = self.beamformer.steer
|
|
1202
|
-
|
|
1203
1170
|
def _calc(self, ind):
|
|
1204
1171
|
"""Calculates the result for the frequencies defined by :attr:`freq_data`.
|
|
1205
1172
|
|
|
@@ -1242,7 +1209,7 @@ class BeamformerDamas(BeamformerBase):
|
|
|
1242
1209
|
self._fr[i] = 1
|
|
1243
1210
|
|
|
1244
1211
|
|
|
1245
|
-
@deprecated_alias({'max_iter': 'n_iter'})
|
|
1212
|
+
@deprecated_alias({'max_iter': 'n_iter'}, removal_version='25.10')
|
|
1246
1213
|
class BeamformerDamasPlus(BeamformerDamas):
|
|
1247
1214
|
"""DAMAS deconvolution :cite:`Brooks2006` for solving the system of equations, instead of the
|
|
1248
1215
|
original Gauss-Seidel iterations, this class employs the NNLS or linear programming solvers from
|
|
@@ -1365,14 +1332,6 @@ class BeamformerOrth(BeamformerBase):
|
|
|
1365
1332
|
New faster implementation without explicit (:class:`BeamformerEig`).
|
|
1366
1333
|
"""
|
|
1367
1334
|
|
|
1368
|
-
#: (only for backward compatibility) :class:`BeamformerEig` object
|
|
1369
|
-
#: if set, provides :attr:`freq_data`, :attr:`steer`, :attr:`r_diag`
|
|
1370
|
-
#: if not set, these have to be set explicitly.
|
|
1371
|
-
beamformer = Property(transient=True)
|
|
1372
|
-
|
|
1373
|
-
# private storage of beamformer instance
|
|
1374
|
-
_beamformer = Instance(BeamformerEig)
|
|
1375
|
-
|
|
1376
1335
|
#: List of components to consider, use this to directly set the eigenvalues
|
|
1377
1336
|
#: used in the beamformer. Alternatively, set :attr:`n`.
|
|
1378
1337
|
eva_list = CArray(dtype=int, value=array([-1]), desc='components')
|
|
@@ -1388,32 +1347,10 @@ class BeamformerOrth(BeamformerBase):
|
|
|
1388
1347
|
depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['eva_list'],
|
|
1389
1348
|
)
|
|
1390
1349
|
|
|
1391
|
-
def _get_beamformer(self):
|
|
1392
|
-
return self._beamformer
|
|
1393
|
-
|
|
1394
|
-
def _set_beamformer(self, beamformer):
|
|
1395
|
-
msg = (
|
|
1396
|
-
f"Deprecated use of 'beamformer' trait in class {self.__class__.__name__}. "
|
|
1397
|
-
'Please set :attr:`freq_data`, :attr:`steer`, :attr:`r_diag` directly. '
|
|
1398
|
-
"Using the 'beamformer' trait will be removed in version 25.07."
|
|
1399
|
-
)
|
|
1400
|
-
warn(
|
|
1401
|
-
msg,
|
|
1402
|
-
DeprecationWarning,
|
|
1403
|
-
stacklevel=2,
|
|
1404
|
-
)
|
|
1405
|
-
self._beamformer = beamformer
|
|
1406
|
-
|
|
1407
1350
|
@cached_property
|
|
1408
1351
|
def _get_digest(self):
|
|
1409
1352
|
return digest(self)
|
|
1410
1353
|
|
|
1411
|
-
@on_trait_change('_beamformer.digest')
|
|
1412
|
-
def delegate_beamformer_traits(self):
|
|
1413
|
-
self.freq_data = self.beamformer.freq_data
|
|
1414
|
-
self.r_diag = self.beamformer.r_diag
|
|
1415
|
-
self.steer = self.beamformer.steer
|
|
1416
|
-
|
|
1417
1354
|
@on_trait_change('n')
|
|
1418
1355
|
def set_eva_list(self):
|
|
1419
1356
|
"""Sets the list of eigenvalues to consider."""
|
|
@@ -1456,7 +1393,7 @@ class BeamformerOrth(BeamformerBase):
|
|
|
1456
1393
|
self._fr[i] = 1
|
|
1457
1394
|
|
|
1458
1395
|
|
|
1459
|
-
@deprecated_alias({'n': 'n_iter'})
|
|
1396
|
+
@deprecated_alias({'n': 'n_iter'}, removal_version='25.10')
|
|
1460
1397
|
class BeamformerCleansc(BeamformerBase):
|
|
1461
1398
|
"""CLEAN-SC deconvolution algorithm.
|
|
1462
1399
|
|
|
@@ -1554,14 +1491,6 @@ class BeamformerClean(BeamformerBase):
|
|
|
1554
1491
|
See :cite:`Hoegbom1974` for details.
|
|
1555
1492
|
"""
|
|
1556
1493
|
|
|
1557
|
-
#: (only for backward compatibility) :class:`BeamformerBase` object
|
|
1558
|
-
#: if set, provides :attr:`freq_data`, :attr:`steer`, :attr:`r_diag`
|
|
1559
|
-
#: if not set, these have to be set explicitly.
|
|
1560
|
-
beamformer = Property(transient=True)
|
|
1561
|
-
|
|
1562
|
-
# private storage of beamformer instance
|
|
1563
|
-
_beamformer = Instance(BeamformerBase)
|
|
1564
|
-
|
|
1565
1494
|
#: The floating-number-precision of the PSFs. Default is 64 bit.
|
|
1566
1495
|
psf_precision = Enum('float64', 'float32', desc='precision of PSF.')
|
|
1567
1496
|
|
|
@@ -1584,28 +1513,6 @@ class BeamformerClean(BeamformerBase):
|
|
|
1584
1513
|
def _get_digest(self):
|
|
1585
1514
|
return digest(self)
|
|
1586
1515
|
|
|
1587
|
-
def _get_beamformer(self):
|
|
1588
|
-
return self._beamformer
|
|
1589
|
-
|
|
1590
|
-
def _set_beamformer(self, beamformer):
|
|
1591
|
-
msg = (
|
|
1592
|
-
f"Deprecated use of 'beamformer' trait in class {self.__class__.__name__}. "
|
|
1593
|
-
'Please set :attr:`freq_data`, :attr:`steer`, :attr:`r_diag` directly. '
|
|
1594
|
-
"Using the 'beamformer' trait will be removed in version 25.07."
|
|
1595
|
-
)
|
|
1596
|
-
warn(
|
|
1597
|
-
msg,
|
|
1598
|
-
DeprecationWarning,
|
|
1599
|
-
stacklevel=2,
|
|
1600
|
-
)
|
|
1601
|
-
self._beamformer = beamformer
|
|
1602
|
-
|
|
1603
|
-
@on_trait_change('_beamformer.digest')
|
|
1604
|
-
def delegate_beamformer_traits(self):
|
|
1605
|
-
self.freq_data = self.beamformer.freq_data
|
|
1606
|
-
self.r_diag = self.beamformer.r_diag
|
|
1607
|
-
self.steer = self.beamformer.steer
|
|
1608
|
-
|
|
1609
1516
|
def _calc(self, ind):
|
|
1610
1517
|
"""Calculates the result for the frequencies defined by :attr:`freq_data`.
|
|
1611
1518
|
|
|
@@ -1668,7 +1575,7 @@ class BeamformerClean(BeamformerBase):
|
|
|
1668
1575
|
self._fr[i] = 1
|
|
1669
1576
|
|
|
1670
1577
|
|
|
1671
|
-
@deprecated_alias({'max_iter': 'n_iter'})
|
|
1578
|
+
@deprecated_alias({'max_iter': 'n_iter'}, removal_version='25.10')
|
|
1672
1579
|
class BeamformerCMF(BeamformerBase):
|
|
1673
1580
|
"""Covariance Matrix Fitting algorithm.
|
|
1674
1581
|
|
|
@@ -1872,10 +1779,8 @@ class BeamformerCMF(BeamformerBase):
|
|
|
1872
1779
|
factr=10000000.0,
|
|
1873
1780
|
pgtol=1e-05,
|
|
1874
1781
|
epsilon=1e-08,
|
|
1875
|
-
iprint=-1,
|
|
1876
1782
|
maxfun=15000,
|
|
1877
1783
|
maxiter=self.n_iter,
|
|
1878
|
-
disp=None,
|
|
1879
1784
|
callback=None,
|
|
1880
1785
|
maxls=20,
|
|
1881
1786
|
)
|
|
@@ -1897,7 +1802,7 @@ class BeamformerCMF(BeamformerBase):
|
|
|
1897
1802
|
self._fr[i] = 1
|
|
1898
1803
|
|
|
1899
1804
|
|
|
1900
|
-
@deprecated_alias({'max_iter': 'n_iter'})
|
|
1805
|
+
@deprecated_alias({'max_iter': 'n_iter'}, removal_version='25.10')
|
|
1901
1806
|
class BeamformerSODIX(BeamformerBase):
|
|
1902
1807
|
"""Source directivity modeling in the cross-spectral matrix (SODIX) algorithm.
|
|
1903
1808
|
|
|
@@ -2042,10 +1947,8 @@ class BeamformerSODIX(BeamformerBase):
|
|
|
2042
1947
|
factr=100.0,
|
|
2043
1948
|
pgtol=1e-12,
|
|
2044
1949
|
epsilon=1e-08,
|
|
2045
|
-
iprint=-1,
|
|
2046
1950
|
maxfun=1500000,
|
|
2047
1951
|
maxiter=self.n_iter,
|
|
2048
|
-
disp=-1,
|
|
2049
1952
|
callback=None,
|
|
2050
1953
|
maxls=20,
|
|
2051
1954
|
)
|
|
@@ -2056,7 +1959,7 @@ class BeamformerSODIX(BeamformerBase):
|
|
|
2056
1959
|
self._fr[i] = 1
|
|
2057
1960
|
|
|
2058
1961
|
|
|
2059
|
-
@deprecated_alias({'max_iter': 'n_iter'})
|
|
1962
|
+
@deprecated_alias({'max_iter': 'n_iter'}, removal_version='25.10')
|
|
2060
1963
|
class BeamformerGIB(BeamformerEig): # BeamformerEig #BeamformerBase
|
|
2061
1964
|
"""Beamforming GIB methods with different normalizations.
|
|
2062
1965
|
|