acoular 24.7__py3-none-any.whl → 24.10__py3-none-any.whl

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/fbeamform.py CHANGED
@@ -60,7 +60,6 @@ from numpy import (
60
60
  integer,
61
61
  invert,
62
62
  isscalar,
63
- linalg,
64
63
  log10,
65
64
  ndarray,
66
65
  newaxis,
@@ -82,9 +81,8 @@ from numpy import (
82
81
  zeros,
83
82
  zeros_like,
84
83
  )
85
- from numpy.linalg import norm
86
84
  from packaging.version import parse
87
- from scipy.linalg import eigh, eigvals, fractional_matrix_power, inv
85
+ from scipy.linalg import eigh, eigvals, fractional_matrix_power, inv, norm
88
86
  from scipy.optimize import fmin_l_bfgs_b, linprog, nnls, shgo
89
87
  from sklearn.linear_model import LassoLars, LassoLarsCV, LassoLarsIC, LinearRegression, OrthogonalMatchingPursuitCV
90
88
  from traits.api import (
@@ -117,6 +115,7 @@ from .h5files import H5CacheFileBase
117
115
  from .internal import digest
118
116
  from .microphones import MicGeom
119
117
  from .spectra import PowerSpectra
118
+ from .tfastfuncs import _steer_I, _steer_II, _steer_III, _steer_IV
120
119
 
121
120
  sklearn_ndict = {}
122
121
  if parse(sklearn.__version__) < parse('1.4'):
@@ -126,7 +125,10 @@ BEAMFORMER_BASE_DIGEST_DEPENDENCIES = ['freq_data.digest', 'r_diag', 'r_diag_nor
126
125
 
127
126
 
128
127
  class SteeringVector(HasPrivateTraits):
129
- """Basic class for implementing steering vectors with monopole source transfer models."""
128
+ """Basic class for implementing steering vectors with monopole source transfer models.
129
+
130
+ Handles four different steering vector formulations. See :cite:`Sarradj2012` for details.
131
+ """
130
132
 
131
133
  #: :class:`~acoular.grids.Grid`-derived object that provides the grid locations.
132
134
  grid = Trait(Grid, desc='beamforming grid')
@@ -134,7 +136,7 @@ class SteeringVector(HasPrivateTraits):
134
136
  #: :class:`~acoular.microphones.MicGeom` object that provides the microphone locations.
135
137
  mics = Trait(MicGeom, desc='microphone geometry')
136
138
 
137
- #: Type of steering vectors, see also :ref:`Sarradj, 2012<Sarradj2012>`. Defaults to 'true level'.
139
+ #: Type of steering vectors, see also :cite:`Sarradj2012`. Defaults to 'true level'.
138
140
  steer_type = Trait('true level', 'true location', 'classic', 'inverse', desc='type of steering vectors used')
139
141
 
140
142
  #: :class:`~acoular.environments.Environment` or derived object,
@@ -160,6 +162,26 @@ class SteeringVector(HasPrivateTraits):
160
162
  #: Defaults to [0.,0.,0.].
161
163
  ref = Property(desc='reference position or distance')
162
164
 
165
+ _steer_funcs_freq = Dict(
166
+ {
167
+ 'classic': lambda x: x / absolute(x) / x.shape[-1],
168
+ 'inverse': lambda x: 1.0 / x.conj() / x.shape[-1],
169
+ 'true level': lambda x: x / einsum('ij,ij->i', x, x.conj())[:, newaxis],
170
+ 'true location': lambda x: x / sqrt(einsum('ij,ij->i', x, x.conj()) * x.shape[-1])[:, newaxis],
171
+ },
172
+ desc='dictionary of frequency domain steering vector functions',
173
+ )
174
+
175
+ _steer_funcs_time = Dict(
176
+ {
177
+ 'classic': _steer_I,
178
+ 'inverse': _steer_II,
179
+ 'true level': _steer_III,
180
+ 'true location': _steer_IV,
181
+ },
182
+ desc='dictionary of time domain steering vector functions',
183
+ )
184
+
163
185
  def _set_ref(self, ref):
164
186
  if isscalar(ref):
165
187
  try:
@@ -186,11 +208,11 @@ class SteeringVector(HasPrivateTraits):
186
208
  if self.ref > 0:
187
209
  return full((self.grid.size,), self.ref)
188
210
  return self.env._r(self.grid.pos())
189
- return self.env._r(self.grid.pos(), self.ref[:, newaxis])
211
+ return self.env._r(self.grid.gpos, self.ref[:, newaxis])
190
212
 
191
213
  @property_depends_on('grid.digest, mics.digest, env.digest')
192
214
  def _get_rm(self):
193
- return atleast_2d(self.env._r(self.grid.pos(), self.mics.mpos))
215
+ return atleast_2d(self.env._r(self.grid.gpos, self.mics.mpos))
194
216
 
195
217
  @cached_property
196
218
  def _get_digest(self):
@@ -231,8 +253,9 @@ class SteeringVector(HasPrivateTraits):
231
253
  return trans
232
254
 
233
255
  def steer_vector(self, f, ind=None):
234
- """Calculates the steering vectors based on the transfer function
235
- See also :ref:`Sarradj, 2012<Sarradj2012>`.
256
+ """Calculates the steering vectors based on the transfer function.
257
+
258
+ See also :cite:`Sarradj2012`.
236
259
 
237
260
  Parameters
238
261
  ----------
@@ -249,12 +272,7 @@ class SteeringVector(HasPrivateTraits):
249
272
  array of shape (ngridpts, nmics) containing the steering vectors for the given frequency
250
273
 
251
274
  """
252
- func = {
253
- 'classic': lambda x: x / absolute(x) / x.shape[-1],
254
- 'inverse': lambda x: 1.0 / x.conj() / x.shape[-1],
255
- 'true level': lambda x: x / einsum('ij,ij->i', x, x.conj())[:, newaxis],
256
- 'true location': lambda x: x / sqrt(einsum('ij,ij->i', x, x.conj()) * x.shape[-1])[:, newaxis],
257
- }[self.steer_type]
275
+ func = self._steer_funcs_freq[self.steer_type]
258
276
  return func(self.transfer(f, ind))
259
277
 
260
278
 
@@ -305,10 +323,15 @@ class BeamformerBase(HasPrivateTraits):
305
323
  if isinstance(steer, SteeringVector):
306
324
  self._steer_obj = steer
307
325
  elif steer in ('true level', 'true location', 'classic', 'inverse'):
308
- # Type of steering vectors, see also :ref:`Sarradj, 2012<Sarradj2012>`.
326
+ # Type of steering vectors, see also :cite:`Sarradj2012`.
327
+ msg = (
328
+ "Deprecated use of 'steer' trait. Please use the 'steer' with an object of class "
329
+ "'SteeringVector'. Using a string to specify the steer type will be removed in "
330
+ 'version 25.01.'
331
+ )
309
332
  warn(
310
- "Deprecated use of 'steer' trait. Please use object of class 'SteeringVector' in the future.",
311
- Warning,
333
+ msg,
334
+ DeprecationWarning,
312
335
  stacklevel=2,
313
336
  )
314
337
  self._steer_obj.steer_type = steer
@@ -326,7 +349,11 @@ class BeamformerBase(HasPrivateTraits):
326
349
  return self._steer_obj.env
327
350
 
328
351
  def _set_env(self, env):
329
- warn("Deprecated use of 'env' trait. ", Warning, stacklevel=2)
352
+ msg = (
353
+ "Deprecated use of 'env' trait. Please use the 'steer' trait with an object of class"
354
+ "'SteeringVector'. The 'env' trait will be removed in version 25.01."
355
+ )
356
+ warn(msg, DeprecationWarning, stacklevel=2)
330
357
  self._steer_obj.env = env
331
358
 
332
359
  # The speed of sound.
@@ -338,7 +365,12 @@ class BeamformerBase(HasPrivateTraits):
338
365
  return self._steer_obj.env.c
339
366
 
340
367
  def _set_c(self, c):
341
- warn("Deprecated use of 'c' trait. ", Warning, stacklevel=2)
368
+ msg = (
369
+ "Deprecated use of 'c' trait. Please use the 'steer' trait with an object of class"
370
+ "'SteeringVector' that holds an 'Environment' instance."
371
+ "The 'c' trait will be removed in version 25.01."
372
+ )
373
+ warn(msg, DeprecationWarning, stacklevel=2)
342
374
  self._steer_obj.env.c = c
343
375
 
344
376
  # :class:`~acoular.grids.Grid`-derived object that provides the grid locations.
@@ -350,7 +382,11 @@ class BeamformerBase(HasPrivateTraits):
350
382
  return self._steer_obj.grid
351
383
 
352
384
  def _set_grid(self, grid):
353
- warn("Deprecated use of 'grid' trait. ", Warning, stacklevel=2)
385
+ msg = (
386
+ "Deprecated use of 'grid' trait. Please use the 'steer' trait with an object of class"
387
+ "'SteeringVector'. The 'grid' trait will be removed in version 25.01."
388
+ )
389
+ warn(msg, DeprecationWarning, stacklevel=2)
354
390
  self._steer_obj.grid = grid
355
391
 
356
392
  # :class:`~acoular.microphones.MicGeom` object that provides the microphone locations.
@@ -362,7 +398,11 @@ class BeamformerBase(HasPrivateTraits):
362
398
  return self._steer_obj.mics
363
399
 
364
400
  def _set_mpos(self, mpos):
365
- warn("Deprecated use of 'mpos' trait. ", Warning, stacklevel=2)
401
+ msg = (
402
+ "Deprecated use of 'mpos' trait. Please use the 'steer' trait with an object of class"
403
+ "'SteeringVector'. The 'mpos' trait will be removed in version 25.01."
404
+ )
405
+ warn(msg, DeprecationWarning, stacklevel=2)
366
406
  self._steer_obj.mics = mpos
367
407
 
368
408
  # Sound travel distances from microphone array center to grid points (r0)
@@ -372,11 +412,21 @@ class BeamformerBase(HasPrivateTraits):
372
412
  r0 = Property()
373
413
 
374
414
  def _get_r0(self):
415
+ msg = (
416
+ "Deprecated use of 'r0' trait. Please use the 'steer' trait with an object of class"
417
+ "'SteeringVector'. The 'r0' trait will be removed in version 25.01."
418
+ )
419
+ warn(msg, DeprecationWarning, stacklevel=2)
375
420
  return self._steer_obj.r0
376
421
 
377
422
  rm = Property()
378
423
 
379
424
  def _get_rm(self):
425
+ msg = (
426
+ "Deprecated use of 'rm' trait. Please use the 'steer' trait with an object of class"
427
+ "'SteeringVector'. The 'rm' trait will be removed in version 25.01."
428
+ )
429
+ warn(msg, DeprecationWarning, stacklevel=2)
380
430
  return self._steer_obj.rm
381
431
 
382
432
  # --- End of backwards compatibility traits --------------------------------------
@@ -607,7 +657,7 @@ class BeamformerBase(HasPrivateTraits):
607
657
  each grid point .
608
658
  Note that the frequency resolution and therefore the bandwidth
609
659
  represented by a single frequency line depends on
610
- the :attr:`sampling frequency<acoular.tprocess.SamplesGenerator.sample_freq>` and
660
+ the :attr:`sampling frequency<acoular.base.SamplesGenerator.sample_freq>` and
611
661
  used :attr:`FFT block size<acoular.spectra.PowerSpectra.block_size>`.
612
662
 
613
663
  """
@@ -759,7 +809,10 @@ class BeamformerBase(HasPrivateTraits):
759
809
 
760
810
 
761
811
  class BeamformerFunctional(BeamformerBase):
762
- """Functional beamforming after :ref:`Dougherty, 2014<Dougherty2014>`."""
812
+ """Functional beamforming algorithm.
813
+
814
+ See :cite:`Dougherty2014` for details.
815
+ """
763
816
 
764
817
  #: Functional exponent, defaults to 1 (= Classic Beamforming).
765
818
  gamma = Float(1, desc='functional exponent')
@@ -845,7 +898,10 @@ class BeamformerFunctional(BeamformerBase):
845
898
 
846
899
 
847
900
  class BeamformerCapon(BeamformerBase):
848
- """Beamforming using the Capon (Mininimum Variance) algorithm, see :ref:`Capon, 1969<Capon1969>`."""
901
+ """Beamforming using the Capon (Mininimum Variance) algorithm.
902
+
903
+ See :cite:`Capon1969` for details.
904
+ """
849
905
 
850
906
  # Boolean flag, if 'True', the main diagonal is removed before beamforming;
851
907
  # for Capon beamforming r_diag is set to 'False'.
@@ -880,17 +936,20 @@ class BeamformerCapon(BeamformerBase):
880
936
  normfactor = self.sig_loss_norm() * nMics**2
881
937
  param_steer_type, steer_vector = self._beamformer_params()
882
938
  for i in ind:
883
- csm = array(linalg.inv(array(self.freq_data.csm[i], dtype='complex128')), order='C')
939
+ csm = array(inv(array(self.freq_data.csm[i], dtype='complex128')), order='C')
884
940
  beamformerOutput = beamformerFreq(param_steer_type, self.r_diag, normfactor, steer_vector(f[i]), csm)[0]
885
941
  self._ac[i] = 1.0 / beamformerOutput
886
942
  self._fr[i] = 1
887
943
 
888
944
 
889
945
  class BeamformerEig(BeamformerBase):
890
- """Beamforming using eigenvalue and eigenvector techniques, see :ref:`Sarradj et al., 2005<Sarradj2005>`."""
946
+ """Beamforming using eigenvalue and eigenvector techniques.
947
+
948
+ See :cite:`Sarradj2005` for details.
949
+ """
891
950
 
892
951
  #: Number of component to calculate:
893
- #: 0 (smallest) ... :attr:`~acoular.tprocess.SamplesGenerator.numchannels`-1;
952
+ #: 0 (smallest) ... :attr:`~acoular.base.SamplesGenerator.numchannels`-1;
894
953
  #: defaults to -1, i.e. numchannels-1
895
954
  n = Int(-1, desc='No. of eigenvalue')
896
955
 
@@ -952,7 +1011,10 @@ class BeamformerEig(BeamformerBase):
952
1011
 
953
1012
 
954
1013
  class BeamformerMusic(BeamformerEig):
955
- """Beamforming using the MUSIC algorithm, see :ref:`Schmidt, 1986<Schmidt1986>`."""
1014
+ """Beamforming using the MUSIC algorithm.
1015
+
1016
+ See :cite:`Schmidt1986` for details.
1017
+ """
956
1018
 
957
1019
  # Boolean flag, if 'True', the main diagonal is removed before beamforming;
958
1020
  # for MUSIC beamforming r_diag is set to 'False'.
@@ -1030,9 +1092,13 @@ class PointSpreadFunction(HasPrivateTraits):
1030
1092
  if isinstance(steer, SteeringVector):
1031
1093
  self._steer_obj = steer
1032
1094
  elif steer in ('true level', 'true location', 'classic', 'inverse'):
1033
- # Type of steering vectors, see also :ref:`Sarradj, 2012<Sarradj2012>`.
1095
+ msg = (
1096
+ "Deprecated use of 'steer' trait. Please use object of class 'SteeringVector'."
1097
+ "The functionality of using string values for 'steer' will be removed in version 25.01."
1098
+ )
1099
+ # Type of steering vectors, see also :cite:`Sarradj2012`.
1034
1100
  warn(
1035
- "Deprecated use of 'steer' trait. Please use object of class 'SteeringVector' in the future.",
1101
+ msg,
1036
1102
  Warning,
1037
1103
  stacklevel=2,
1038
1104
  )
@@ -1051,7 +1117,11 @@ class PointSpreadFunction(HasPrivateTraits):
1051
1117
  return self._steer_obj.env
1052
1118
 
1053
1119
  def _set_env(self, env):
1054
- warn("Deprecated use of 'env' trait. ", Warning, stacklevel=2)
1120
+ msg = (
1121
+ "Deprecated use of 'env' trait. Please use the 'steer' trait with an object of class"
1122
+ "'SteeringVector'. The 'env' trait will be removed in version 25.01."
1123
+ )
1124
+ warn(msg, DeprecationWarning, stacklevel=2)
1055
1125
  self._steer_obj.env = env
1056
1126
 
1057
1127
  # The speed of sound.
@@ -1063,7 +1133,11 @@ class PointSpreadFunction(HasPrivateTraits):
1063
1133
  return self._steer_obj.env.c
1064
1134
 
1065
1135
  def _set_c(self, c):
1066
- warn("Deprecated use of 'c' trait. ", Warning, stacklevel=2)
1136
+ msg = (
1137
+ "Deprecated use of 'c' trait. Please use the 'steer' trait with an object of class"
1138
+ "'SteeringVector'. The 'c' trait will be removed in version 25.01."
1139
+ )
1140
+ warn(msg, DeprecationWarning, stacklevel=2)
1067
1141
  self._steer_obj.env.c = c
1068
1142
 
1069
1143
  # :class:`~acoular.grids.Grid`-derived object that provides the grid locations.
@@ -1075,7 +1149,11 @@ class PointSpreadFunction(HasPrivateTraits):
1075
1149
  return self._steer_obj.grid
1076
1150
 
1077
1151
  def _set_grid(self, grid):
1078
- warn("Deprecated use of 'grid' trait. ", Warning, stacklevel=2)
1152
+ msg = (
1153
+ "Deprecated use of 'grid' trait. Please use the 'steer' trait with an object of class"
1154
+ "'SteeringVector'. The 'grid' trait will be removed in version 25.01."
1155
+ )
1156
+ warn(msg, DeprecationWarning, stacklevel=2)
1079
1157
  self._steer_obj.grid = grid
1080
1158
 
1081
1159
  # :class:`~acoular.microphones.MicGeom` object that provides the microphone locations.
@@ -1087,7 +1165,11 @@ class PointSpreadFunction(HasPrivateTraits):
1087
1165
  return self._steer_obj.mics
1088
1166
 
1089
1167
  def _set_mpos(self, mpos):
1090
- warn("Deprecated use of 'mpos' trait. ", Warning, stacklevel=2)
1168
+ msg = (
1169
+ "Deprecated use of 'mpos' trait. Please use the 'steer' trait with an object of class"
1170
+ "'SteeringVector'. The 'mpos' trait will be removed in version 25.01."
1171
+ )
1172
+ warn(msg, DeprecationWarning, stacklevel=2)
1091
1173
  self._steer_obj.mics = mpos
1092
1174
 
1093
1175
  # Sound travel distances from microphone array center to grid points (r0)
@@ -1097,11 +1179,21 @@ class PointSpreadFunction(HasPrivateTraits):
1097
1179
  r0 = Property()
1098
1180
 
1099
1181
  def _get_r0(self):
1182
+ msg = (
1183
+ "Deprecated use of 'r0' trait. Please use the 'steer' trait with an object of class"
1184
+ "'SteeringVector'. The 'r0' trait will be removed in version 25.01."
1185
+ )
1186
+ warn(msg, DeprecationWarning, stacklevel=2)
1100
1187
  return self._steer_obj.r0
1101
1188
 
1102
1189
  rm = Property()
1103
1190
 
1104
1191
  def _get_rm(self):
1192
+ msg = (
1193
+ "Deprecated use of 'rm' trait. Please use the 'steer' trait with an object of class"
1194
+ "'SteeringVector'. The 'rm' trait will be removed in version 25.01."
1195
+ )
1196
+ warn(msg, DeprecationWarning, stacklevel=2)
1105
1197
  return self._steer_obj.rm
1106
1198
 
1107
1199
  # --- End of backwards compatibility traits --------------------------------------
@@ -1269,12 +1361,18 @@ class PointSpreadFunction(HasPrivateTraits):
1269
1361
 
1270
1362
 
1271
1363
  class BeamformerDamas(BeamformerBase):
1272
- """DAMAS deconvolution, see :ref:`Brooks and Humphreys, 2006<BrooksHumphreys2006>`."""
1364
+ """DAMAS deconvolution algorithm.
1365
+
1366
+ See :cite:`Brooks2006` for details.
1367
+ """
1273
1368
 
1274
1369
  #: (only for backward compatibility) :class:`BeamformerBase` object
1275
1370
  #: if set, provides :attr:`freq_data`, :attr:`steer`, :attr:`r_diag`
1276
- #: if not set, these have to be set explicitly
1277
- beamformer = Trait(BeamformerBase)
1371
+ #: if not set, these have to be set explicitly.
1372
+ beamformer = Property()
1373
+
1374
+ # private storage of beamformer instance
1375
+ _beamformer = Trait(BeamformerBase)
1278
1376
 
1279
1377
  #: The floating-number-precision of the PSFs. Default is 64 bit.
1280
1378
  psf_precision = Trait('float64', 'float32', desc='precision of PSF')
@@ -1294,11 +1392,27 @@ class BeamformerDamas(BeamformerBase):
1294
1392
  depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['n_iter', 'damp', 'psf_precision'],
1295
1393
  )
1296
1394
 
1395
+ def _get_beamformer(self):
1396
+ return self._beamformer
1397
+
1398
+ def _set_beamformer(self, beamformer):
1399
+ msg = (
1400
+ f"Deprecated use of 'beamformer' trait in class {self.__class__.__name__}. "
1401
+ 'Please set :attr:`freq_data`, :attr:`steer`, :attr:`r_diag` directly. '
1402
+ "Using the 'beamformer' trait will be removed in version 25.07."
1403
+ )
1404
+ warn(
1405
+ msg,
1406
+ DeprecationWarning,
1407
+ stacklevel=2,
1408
+ )
1409
+ self._beamformer = beamformer
1410
+
1297
1411
  @cached_property
1298
1412
  def _get_digest(self):
1299
1413
  return digest(self)
1300
1414
 
1301
- @on_trait_change('beamformer.digest')
1415
+ @on_trait_change('_beamformer.digest')
1302
1416
  def delegate_beamformer_traits(self):
1303
1417
  self.freq_data = self.beamformer.freq_data
1304
1418
  self.r_diag = self.beamformer.r_diag
@@ -1347,8 +1461,7 @@ class BeamformerDamas(BeamformerBase):
1347
1461
 
1348
1462
 
1349
1463
  class BeamformerDamasPlus(BeamformerDamas):
1350
- """DAMAS deconvolution, see :ref:`Brooks and Humphreys, 2006<BrooksHumphreys2006>`,
1351
- for solving the system of equations, instead of the original Gauss-Seidel
1464
+ """DAMAS deconvolution :cite:`Brooks2006` for solving the system of equations, instead of the original Gauss-Seidel
1352
1465
  iterations, this class employs the NNLS or linear programming solvers from
1353
1466
  scipy.optimize or one of several optimization algorithms from the scikit-learn module.
1354
1467
  Needs a-priori delay-and-sum beamforming (:class:`BeamformerBase`).
@@ -1465,14 +1578,19 @@ class BeamformerDamasPlus(BeamformerDamas):
1465
1578
 
1466
1579
 
1467
1580
  class BeamformerOrth(BeamformerBase):
1468
- """Orthogonal deconvolution, see :ref:`Sarradj, 2010<Sarradj2010>`.
1581
+ """Orthogonal deconvolution algorithm.
1582
+
1583
+ See :cite:`Sarradj2010` for details.
1469
1584
  New faster implementation without explicit (:class:`BeamformerEig`).
1470
1585
  """
1471
1586
 
1472
1587
  #: (only for backward compatibility) :class:`BeamformerEig` object
1473
1588
  #: if set, provides :attr:`freq_data`, :attr:`steer`, :attr:`r_diag`
1474
- #: if not set, these have to be set explicitly
1475
- beamformer = Trait(BeamformerEig)
1589
+ #: if not set, these have to be set explicitly.
1590
+ beamformer = Property()
1591
+
1592
+ # private storage of beamformer instance
1593
+ _beamformer = Trait(BeamformerEig)
1476
1594
 
1477
1595
  #: List of components to consider, use this to directly set the eigenvalues
1478
1596
  #: used in the beamformer. Alternatively, set :attr:`n`.
@@ -1489,11 +1607,27 @@ class BeamformerOrth(BeamformerBase):
1489
1607
  depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['eva_list'],
1490
1608
  )
1491
1609
 
1610
+ def _get_beamformer(self):
1611
+ return self._beamformer
1612
+
1613
+ def _set_beamformer(self, beamformer):
1614
+ msg = (
1615
+ f"Deprecated use of 'beamformer' trait in class {self.__class__.__name__}. "
1616
+ 'Please set :attr:`freq_data`, :attr:`steer`, :attr:`r_diag` directly. '
1617
+ "Using the 'beamformer' trait will be removed in version 25.07."
1618
+ )
1619
+ warn(
1620
+ msg,
1621
+ DeprecationWarning,
1622
+ stacklevel=2,
1623
+ )
1624
+ self._beamformer = beamformer
1625
+
1492
1626
  @cached_property
1493
1627
  def _get_digest(self):
1494
1628
  return digest(self)
1495
1629
 
1496
- @on_trait_change('beamformer.digest')
1630
+ @on_trait_change('_beamformer.digest')
1497
1631
  def delegate_beamformer_traits(self):
1498
1632
  self.freq_data = self.beamformer.freq_data
1499
1633
  self.r_diag = self.beamformer.r_diag
@@ -1542,7 +1676,9 @@ class BeamformerOrth(BeamformerBase):
1542
1676
 
1543
1677
 
1544
1678
  class BeamformerCleansc(BeamformerBase):
1545
- """CLEAN-SC deconvolution, see :ref:`Sijtsma, 2007<Sijtsma2007>`.
1679
+ """CLEAN-SC deconvolution algorithm.
1680
+
1681
+ See :cite:`Sijtsma2007` for details.
1546
1682
  Classic delay-and-sum beamforming is already included.
1547
1683
  """
1548
1684
 
@@ -1630,12 +1766,18 @@ class BeamformerCleansc(BeamformerBase):
1630
1766
 
1631
1767
 
1632
1768
  class BeamformerClean(BeamformerBase):
1633
- """CLEAN deconvolution, see :ref:`Hoegbom, 1974<Hoegbom1974>`."""
1769
+ """CLEAN deconvolution algorithm.
1770
+
1771
+ See :cite:`Hoegbom1974` for details.
1772
+ """
1634
1773
 
1635
1774
  #: (only for backward compatibility) :class:`BeamformerBase` object
1636
1775
  #: if set, provides :attr:`freq_data`, :attr:`steer`, :attr:`r_diag`
1637
- #: if not set, these have to be set explicitly
1638
- beamformer = Trait(BeamformerBase)
1776
+ #: if not set, these have to be set explicitly.
1777
+ beamformer = Property()
1778
+
1779
+ # private storage of beamformer instance
1780
+ _beamformer = Trait(BeamformerBase)
1639
1781
 
1640
1782
  #: The floating-number-precision of the PSFs. Default is 64 bit.
1641
1783
  psf_precision = Trait('float64', 'float32', desc='precision of PSF.')
@@ -1659,7 +1801,23 @@ class BeamformerClean(BeamformerBase):
1659
1801
  def _get_digest(self):
1660
1802
  return digest(self)
1661
1803
 
1662
- @on_trait_change('beamformer.digest')
1804
+ def _get_beamformer(self):
1805
+ return self._beamformer
1806
+
1807
+ def _set_beamformer(self, beamformer):
1808
+ msg = (
1809
+ f"Deprecated use of 'beamformer' trait in class {self.__class__.__name__}. "
1810
+ 'Please set :attr:`freq_data`, :attr:`steer`, :attr:`r_diag` directly. '
1811
+ "Using the 'beamformer' trait will be removed in version 25.07."
1812
+ )
1813
+ warn(
1814
+ msg,
1815
+ DeprecationWarning,
1816
+ stacklevel=2,
1817
+ )
1818
+ self._beamformer = beamformer
1819
+
1820
+ @on_trait_change('_beamformer.digest')
1663
1821
  def delegate_beamformer_traits(self):
1664
1822
  self.freq_data = self.beamformer.freq_data
1665
1823
  self.r_diag = self.beamformer.r_diag
@@ -1728,8 +1886,10 @@ class BeamformerClean(BeamformerBase):
1728
1886
 
1729
1887
 
1730
1888
  class BeamformerCMF(BeamformerBase):
1731
- """Covariance Matrix Fitting, see :ref:`Yardibi et al., 2008<Yardibi2008>`.
1889
+ """Covariance Matrix Fitting algorithm.
1890
+
1732
1891
  This is not really a beamformer, but an inverse method.
1892
+ See :cite:`Yardibi2008` for details.
1733
1893
  """
1734
1894
 
1735
1895
  #: Type of fit method to be used ('LassoLars', 'LassoLarsBIC',
@@ -1951,12 +2111,9 @@ class BeamformerCMF(BeamformerBase):
1951
2111
 
1952
2112
 
1953
2113
  class BeamformerSODIX(BeamformerBase):
1954
- """SODIX, see Funke, Ein Mikrofonarray-Verfahren zur Untersuchung der
1955
- Schallabstrahlung von Turbofantriebwerken, 2017. and
1956
- Oertwig, Advancements in the source localization method SODIX and
1957
- application to short cowl engine data, 2019.
2114
+ """Source directivity modeling in the cross-spectral matrix (SODIX) algorithm.
1958
2115
 
1959
- Source directivity modeling in the cross-spectral matrix
2116
+ See :cite:`Funke2017` and :cite:`Oertwig2019` for details.
1960
2117
  """
1961
2118
 
1962
2119
  #: Type of fit method to be used ('fmin_l_bfgs_b').
@@ -2112,7 +2269,10 @@ class BeamformerSODIX(BeamformerBase):
2112
2269
 
2113
2270
 
2114
2271
  class BeamformerGIB(BeamformerEig): # BeamformerEig #BeamformerBase
2115
- """Beamforming GIB methods with different normalizations,."""
2272
+ """Beamforming GIB methods with different normalizations.
2273
+
2274
+ See :cite:`Suzuki2011` for details.
2275
+ """
2116
2276
 
2117
2277
  #: Unit multiplier for evaluating, e.g., nPa instead of Pa.
2118
2278
  #: Values are converted back before returning.
@@ -2385,7 +2545,10 @@ class BeamformerAdaptiveGrid(BeamformerBase, Grid):
2385
2545
 
2386
2546
 
2387
2547
  class BeamformerGridlessOrth(BeamformerAdaptiveGrid):
2388
- """Orthogonal beamforming without predefined grid."""
2548
+ """Orthogonal beamforming without predefined grid.
2549
+
2550
+ See :cite:`Sarradj2022` for details.
2551
+ """
2389
2552
 
2390
2553
  #: List of components to consider, use this to directly set the eigenvalues
2391
2554
  #: used in the beamformer. Alternatively, set :attr:`n`.