acoular 25.10__py3-none-any.whl → 26.1__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/aiaa/aiaa.py +1 -1
- acoular/base.py +7 -7
- acoular/calib.py +6 -6
- acoular/demo/__init__.py +97 -9
- acoular/demo/__main__.py +37 -0
- acoular/environments.py +24 -24
- acoular/fbeamform.py +145 -142
- acoular/fprocess.py +11 -9
- acoular/grids.py +45 -211
- acoular/microphones.py +8 -8
- acoular/process.py +7 -14
- acoular/sdinput.py +9 -9
- acoular/signals.py +10 -10
- acoular/sources.py +84 -68
- acoular/spectra.py +27 -36
- acoular/tbeamform.py +26 -26
- acoular/tools/helpers.py +1 -1
- acoular/tools/utils.py +168 -0
- acoular/tprocess.py +76 -63
- acoular/trajectory.py +1 -2
- acoular/version.py +2 -2
- {acoular-25.10.dist-info → acoular-26.1.dist-info}/METADATA +53 -108
- {acoular-25.10.dist-info → acoular-26.1.dist-info}/RECORD +26 -26
- {acoular-25.10.dist-info → acoular-26.1.dist-info}/WHEEL +1 -1
- acoular/demo/acoular_demo.py +0 -135
- {acoular-25.10.dist-info → acoular-26.1.dist-info}/licenses/AUTHORS.rst +0 -0
- {acoular-25.10.dist-info → acoular-26.1.dist-info}/licenses/LICENSE +0 -0
acoular/fbeamform.py
CHANGED
|
@@ -99,37 +99,38 @@ class SteeringVector(HasStrictTraits):
|
|
|
99
99
|
"""
|
|
100
100
|
|
|
101
101
|
#: :class:`~acoular.grids.Grid`-derived object that provides the grid locations.
|
|
102
|
-
grid = Instance(Grid
|
|
102
|
+
grid = Instance(Grid)
|
|
103
103
|
|
|
104
104
|
#: :class:`~acoular.microphones.MicGeom` object that provides the microphone locations.
|
|
105
|
-
mics = Instance(MicGeom
|
|
105
|
+
mics = Instance(MicGeom)
|
|
106
106
|
|
|
107
107
|
#: Type of steering vectors, see also :cite:`Sarradj2012`. Defaults to 'true level'.
|
|
108
|
-
steer_type = Enum('true level', 'true location', 'classic', 'inverse'
|
|
108
|
+
steer_type = Enum('true level', 'true location', 'classic', 'inverse')
|
|
109
109
|
|
|
110
110
|
#: :class:`~acoular.environments.Environment` or derived object,
|
|
111
111
|
#: which provides information about the sound propagation in the medium.
|
|
112
112
|
#: Defaults to standard :class:`~acoular.environments.Environment` object.
|
|
113
113
|
env = Instance(Environment(), Environment)
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
r0 = Property(
|
|
115
|
+
#: Sound travel distances from microphone array center to grid : points or reference position
|
|
116
|
+
#: (readonly). Feature may change.
|
|
117
|
+
r0 = Property()
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
rm = Property(
|
|
119
|
+
#: Sound travel distances from array microphones to grid : points (readonly). Feature may
|
|
120
|
+
#: change.
|
|
121
|
+
rm = Property()
|
|
122
122
|
|
|
123
|
-
#
|
|
124
|
-
_ref = Any(np.array([0.0, 0.0, 0.0])
|
|
123
|
+
# reference position or distance
|
|
124
|
+
_ref = Any(np.array([0.0, 0.0, 0.0]))
|
|
125
125
|
|
|
126
126
|
#: Reference position or distance at which to evaluate the sound pressure
|
|
127
127
|
#: of a grid point.
|
|
128
128
|
#: If set to a scalar, this is used as reference distance to the grid points.
|
|
129
129
|
#: If set to a vector, this is interpreted as x,y,z coordinates of the reference position.
|
|
130
130
|
#: Defaults to [0.,0.,0.].
|
|
131
|
-
ref = Property(
|
|
131
|
+
ref = Property()
|
|
132
132
|
|
|
133
|
+
#: dictionary of frequency domain steering vector functions
|
|
133
134
|
_steer_funcs_freq = Dict(
|
|
134
135
|
{
|
|
135
136
|
'classic': lambda x: x / np.abs(x) / x.shape[-1],
|
|
@@ -138,9 +139,9 @@ class SteeringVector(HasStrictTraits):
|
|
|
138
139
|
'true location': lambda x: x / np.sqrt(np.einsum('ij,ij->i', x, x.conj()) * x.shape[-1])[:, np.newaxis],
|
|
139
140
|
},
|
|
140
141
|
transient=True,
|
|
141
|
-
desc='dictionary of frequency domain steering vector functions',
|
|
142
142
|
)
|
|
143
143
|
|
|
144
|
+
#: dictionary of time domain steering vector functions
|
|
144
145
|
_steer_funcs_time = Dict(
|
|
145
146
|
{
|
|
146
147
|
'classic': _steer_I,
|
|
@@ -149,7 +150,6 @@ class SteeringVector(HasStrictTraits):
|
|
|
149
150
|
'true location': _steer_IV,
|
|
150
151
|
},
|
|
151
152
|
transient=True,
|
|
152
|
-
desc='dictionary of time domain steering vector functions',
|
|
153
153
|
)
|
|
154
154
|
|
|
155
155
|
def _set_ref(self, ref):
|
|
@@ -166,10 +166,11 @@ class SteeringVector(HasStrictTraits):
|
|
|
166
166
|
def _get_ref(self):
|
|
167
167
|
return self._ref
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
#: A unique identifier for the steering vector, based on its properties. (read-only)
|
|
170
170
|
digest = Property(depends_on=['steer_type', 'env.digest', 'grid.digest', 'mics.digest', '_ref'])
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
#: A unique identifier for the grid, excluding :attr:`steer_type`.
|
|
173
|
+
#: Use for inverse methods. (read-only)
|
|
173
174
|
inv_digest = Property(depends_on=['env.digest', 'grid.digest', 'mics.digest', '_ref'])
|
|
174
175
|
|
|
175
176
|
@property_depends_on(['grid.digest', 'env.digest', '_ref'])
|
|
@@ -277,52 +278,55 @@ class LazyBfResult:
|
|
|
277
278
|
class BeamformerBase(HasStrictTraits):
|
|
278
279
|
"""Beamforming using the basic delay-and-sum algorithm in the frequency domain."""
|
|
279
280
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
#: Instance of :class:`~acoular.fbeamform.SteeringVector` or its derived classes
|
|
282
|
+
#: that contains information about the steering vector. This is a private trait.
|
|
283
|
+
#: Do not set this directly, use `steer` trait instead.
|
|
283
284
|
steer = Instance(SteeringVector, args=())
|
|
284
285
|
|
|
285
286
|
#: :class:`~acoular.spectra.PowerSpectra` object that provides the
|
|
286
287
|
#: cross spectral matrix and eigenvalues
|
|
287
|
-
freq_data = Instance(PowerSpectra
|
|
288
|
+
freq_data = Instance(PowerSpectra)
|
|
288
289
|
|
|
289
290
|
#: Boolean flag, if 'True' (default), the main diagonal is removed before beamforming.
|
|
290
|
-
r_diag = Bool(True
|
|
291
|
+
r_diag = Bool(True)
|
|
291
292
|
|
|
292
|
-
#: If
|
|
293
|
+
#: If diagonal of the CSM is removed, some signal energy is lost.
|
|
294
|
+
#: This is handled via this normalization factor.
|
|
295
|
+
#: Internally, the default is: num_mics / (num_mics - 1).
|
|
296
|
+
#:
|
|
297
|
+
#: If r_diag==True: if r_diag_norm==0.0, the default
|
|
293
298
|
#: normalization = num_mics/(num_mics-1) is used.
|
|
294
299
|
#: If r_diag_norm !=0.0, the user input is used instead.
|
|
295
300
|
#: If r_diag==False, the normalization is 1.0 either way.
|
|
296
|
-
r_diag_norm = Float(
|
|
297
|
-
0.0,
|
|
298
|
-
desc='If diagonal of the csm is removed, some signal energy is lost.'
|
|
299
|
-
'This is handled via this normalization factor.'
|
|
300
|
-
'Internally, the default is: num_mics / (num_mics - 1).',
|
|
301
|
-
)
|
|
301
|
+
r_diag_norm = Float(0.0)
|
|
302
302
|
|
|
303
303
|
#: Floating point precision of property result. Corresponding to numpy dtypes. Default = 64 Bit.
|
|
304
|
-
precision = Enum('float64', 'float32'
|
|
304
|
+
precision = Enum('float64', 'float32')
|
|
305
305
|
|
|
306
306
|
#: Boolean flag, if 'True' (default), the result is cached in h5 files.
|
|
307
|
-
cached = Bool(True
|
|
307
|
+
cached = Bool(True)
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
#: hdf5 cache file
|
|
310
310
|
h5f = Instance(H5CacheFileBase, transient=True)
|
|
311
311
|
|
|
312
312
|
#: The beamforming result as squared sound pressure values
|
|
313
313
|
#: at all grid point locations (readonly).
|
|
314
314
|
#: Returns a (number of frequencies, number of gridpoints) array-like
|
|
315
315
|
#: of floats. Values can only be accessed via the index operator [].
|
|
316
|
-
result = Property(
|
|
316
|
+
result = Property()
|
|
317
317
|
|
|
318
|
-
|
|
318
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
319
319
|
digest = Property(depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES)
|
|
320
320
|
|
|
321
321
|
# private traits
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
322
|
+
#: beamforming result
|
|
323
|
+
_ac = Any()
|
|
324
|
+
#: flag for beamforming result at frequency index
|
|
325
|
+
_fr = Any()
|
|
326
|
+
#: frequencies
|
|
327
|
+
_f = CArray(dtype='float64')
|
|
328
|
+
#: number of frequencies
|
|
329
|
+
_numfreq = Int()
|
|
326
330
|
|
|
327
331
|
@cached_property
|
|
328
332
|
def _get_digest(self):
|
|
@@ -677,19 +681,16 @@ class BeamformerFunctional(BeamformerBase):
|
|
|
677
681
|
"""
|
|
678
682
|
|
|
679
683
|
#: Functional exponent, defaults to 1 (= Classic Beamforming).
|
|
680
|
-
gamma = Float(1
|
|
684
|
+
gamma = Float(1)
|
|
681
685
|
|
|
682
686
|
#: Functional Beamforming is only well defined for full CSM
|
|
683
|
-
r_diag = Enum(False
|
|
687
|
+
r_diag = Enum(False)
|
|
684
688
|
|
|
685
689
|
#: Normalization factor in case of CSM diagonal removal. Defaults to 1.0 since Functional
|
|
686
690
|
#: Beamforming is only well defined for full CSM.
|
|
687
|
-
r_diag_norm = Enum(
|
|
688
|
-
1.0,
|
|
689
|
-
desc='No normalization needed. Functional Beamforming is only well defined for full CSM.',
|
|
690
|
-
)
|
|
691
|
+
r_diag_norm = Enum(1.0)
|
|
691
692
|
|
|
692
|
-
|
|
693
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
693
694
|
digest = Property(depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['gamma'])
|
|
694
695
|
|
|
695
696
|
@cached_property
|
|
@@ -768,16 +769,13 @@ class BeamformerCapon(BeamformerBase):
|
|
|
768
769
|
See :cite:`Capon1969` for details.
|
|
769
770
|
"""
|
|
770
771
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
r_diag = Enum(False
|
|
772
|
+
#: Boolean flag, if ``True``, the main diagonal is removed before beamforming;
|
|
773
|
+
#: for Capon beamforming :attr:`r_diag` is set to ``False``.
|
|
774
|
+
r_diag = Enum(False)
|
|
774
775
|
|
|
775
|
-
#: Normalization factor in case of CSM diagonal removal.
|
|
776
|
-
#: is only well defined for full CSM.
|
|
777
|
-
r_diag_norm = Enum(
|
|
778
|
-
1.0,
|
|
779
|
-
desc='No normalization. BeamformerCapon is only well defined for full CSM.',
|
|
780
|
-
)
|
|
776
|
+
#: Normalization factor in case of CSM diagonal removal.
|
|
777
|
+
#: Defaults to ``1.0`` since Beamformer Capon is only well defined for full CSM.
|
|
778
|
+
r_diag_norm = Enum(1.0)
|
|
781
779
|
|
|
782
780
|
def _calc(self, ind):
|
|
783
781
|
"""
|
|
@@ -816,14 +814,15 @@ class BeamformerEig(BeamformerBase):
|
|
|
816
814
|
"""
|
|
817
815
|
|
|
818
816
|
#: Number of component to calculate:
|
|
819
|
-
#: 0 (smallest) ... :attr:`~acoular.base.SamplesGenerator.num_channels`-1;
|
|
820
|
-
#: defaults to
|
|
821
|
-
n = Int(-1
|
|
817
|
+
#: ``0`` (smallest) ... :attr:`~acoular.base.SamplesGenerator.num_channels`-1;
|
|
818
|
+
#: defaults to ``-1``, i.e. :attr:`~acoular.base.SamplesGenerator.num_channels`-1.
|
|
819
|
+
n = Int(-1)
|
|
822
820
|
|
|
823
821
|
# Actual component to calculate, internal, readonly.
|
|
824
|
-
|
|
822
|
+
#: No. of eigenvalue
|
|
823
|
+
na = Property()
|
|
825
824
|
|
|
826
|
-
|
|
825
|
+
#: A uniquernal identifier for the beamformer, based on its properties. (read-only)
|
|
827
826
|
digest = Property(depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['n'])
|
|
828
827
|
|
|
829
828
|
@cached_property
|
|
@@ -884,20 +883,18 @@ class BeamformerMusic(BeamformerEig):
|
|
|
884
883
|
See :cite:`Schmidt1986` for details.
|
|
885
884
|
"""
|
|
886
885
|
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
r_diag = Enum(False
|
|
886
|
+
#: Boolean flag, if ``True``, the main diagonal is removed before beamforming;
|
|
887
|
+
#: for MUSIC beamforming :attr:`r_diag` is set to ``False``.
|
|
888
|
+
r_diag = Enum(False)
|
|
890
889
|
|
|
891
890
|
#: Normalization factor in case of CSM diagonal removal. Defaults to 1.0 since BeamformerMusic
|
|
892
891
|
#: is only well defined for full CSM.
|
|
893
|
-
r_diag_norm = Enum(
|
|
894
|
-
1.0,
|
|
895
|
-
desc='No normalization. BeamformerMusic is only well defined for full CSM.',
|
|
896
|
-
)
|
|
892
|
+
r_diag_norm = Enum(1.0)
|
|
897
893
|
|
|
898
894
|
# assumed number of sources, should be set to a value not too small
|
|
899
895
|
# defaults to 1
|
|
900
|
-
|
|
896
|
+
#: assumed number of sources
|
|
897
|
+
n = Int(1)
|
|
901
898
|
|
|
902
899
|
def _calc(self, ind):
|
|
903
900
|
"""
|
|
@@ -946,16 +943,15 @@ class PointSpreadFunction(HasStrictTraits):
|
|
|
946
943
|
the aberrations when using simple delay-and-sum beamforming.
|
|
947
944
|
"""
|
|
948
945
|
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
946
|
+
#: Instance of :class:`~acoular.fbeamform.SteeringVector` or its derived classes
|
|
947
|
+
#: that contains information about the steering vector. This is a private trait.
|
|
948
|
+
#: Do not set this directly, use :attr:`steer` trait instead.
|
|
952
949
|
steer = Instance(SteeringVector, args=())
|
|
953
950
|
|
|
954
951
|
#: Indices of grid points to calculate the PSF for.
|
|
955
952
|
grid_indices = CArray(
|
|
956
953
|
dtype=int,
|
|
957
954
|
value=np.array([]),
|
|
958
|
-
desc='indices of grid points for psf',
|
|
959
955
|
) # value=array([]), value=self.steer.grid.pos(),
|
|
960
956
|
|
|
961
957
|
#: Flag that defines how to calculate and store the point spread function
|
|
@@ -969,21 +965,21 @@ class PointSpreadFunction(HasStrictTraits):
|
|
|
969
965
|
#: (useful if not all PSFs are needed, as with :class:`CLEAN<BeamformerClean>`)
|
|
970
966
|
#: * 'readonly': Do not attempt to calculate the PSF since it should already be cached (useful
|
|
971
967
|
#: if multiple processes have to access the cache file)
|
|
972
|
-
calcmode = Enum('single', 'block', 'full', 'readonly'
|
|
968
|
+
calcmode = Enum('single', 'block', 'full', 'readonly')
|
|
973
969
|
|
|
974
970
|
#: Floating point precision of property psf. Corresponding to numpy dtypes. Default = 64 Bit.
|
|
975
|
-
precision = Enum('float64', 'float32'
|
|
971
|
+
precision = Enum('float64', 'float32')
|
|
976
972
|
|
|
977
973
|
#: The actual point spread function.
|
|
978
|
-
psf = Property(
|
|
974
|
+
psf = Property()
|
|
979
975
|
|
|
980
976
|
#: Frequency to evaluate the PSF for; defaults to 1.0.
|
|
981
|
-
freq = Float(1.0
|
|
977
|
+
freq = Float(1.0)
|
|
982
978
|
|
|
983
979
|
# hdf5 cache file
|
|
984
980
|
h5f = Instance(H5CacheFileBase, transient=True)
|
|
985
981
|
|
|
986
|
-
|
|
982
|
+
#: A unique identifier for the object, based on its properties. (read-only)
|
|
987
983
|
digest = Property(depends_on=['steer.digest', 'precision'], cached=True)
|
|
988
984
|
|
|
989
985
|
@cached_property
|
|
@@ -1129,19 +1125,28 @@ class BeamformerDamas(BeamformerBase):
|
|
|
1129
1125
|
"""
|
|
1130
1126
|
|
|
1131
1127
|
#: The floating-number-precision of the PSFs. Default is 64 bit.
|
|
1132
|
-
psf_precision = Enum('float64', 'float32'
|
|
1128
|
+
psf_precision = Enum('float64', 'float32')
|
|
1133
1129
|
|
|
1134
1130
|
#: Number of iterations, defaults to 100.
|
|
1135
|
-
n_iter = Int(100
|
|
1131
|
+
n_iter = Int(100)
|
|
1136
1132
|
|
|
1137
1133
|
#: Damping factor in modified gauss-seidel
|
|
1138
|
-
damp = Float(1.0
|
|
1134
|
+
damp = Float(1.0)
|
|
1139
1135
|
|
|
1140
|
-
#: Flag that defines how to calculate and store the point spread function
|
|
1141
|
-
#: defaults to '
|
|
1142
|
-
|
|
1136
|
+
#: Flag that defines how to calculate and store the point spread function
|
|
1137
|
+
#: defaults to 'single'.
|
|
1138
|
+
#:
|
|
1139
|
+
#: * 'full': Calculate the full PSF (for all grid points) in one go (should be used if the PSF
|
|
1140
|
+
#: at all grid points is needed, as with :class:`DAMAS<BeamformerDamas>`)
|
|
1141
|
+
#: * 'single': Calculate the PSF for the grid points defined by :attr:`grid_indices`, one by one
|
|
1142
|
+
#: (useful if not all PSFs are needed, as with :class:`CLEAN<BeamformerClean>`)
|
|
1143
|
+
#: * 'block': Calculate the PSF for the grid points defined by :attr:`grid_indices`, in one go
|
|
1144
|
+
#: (useful if not all PSFs are needed, as with :class:`CLEAN<BeamformerClean>`)
|
|
1145
|
+
#: * 'readonly': Do not attempt to calculate the PSF since it should already be cached (useful
|
|
1146
|
+
#: if multiple processes have to access the cache file)
|
|
1147
|
+
calcmode = Enum('full', 'single', 'block', 'readonly')
|
|
1143
1148
|
|
|
1144
|
-
|
|
1149
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
1145
1150
|
digest = Property(
|
|
1146
1151
|
depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['n_iter', 'damp', 'psf_precision'],
|
|
1147
1152
|
)
|
|
@@ -1206,25 +1211,25 @@ class BeamformerDamasPlus(BeamformerDamas):
|
|
|
1206
1211
|
#: These methods are implemented in
|
|
1207
1212
|
#: the `scikit-learn <http://scikit-learn.org/stable/user_guide.html>`_
|
|
1208
1213
|
#: module or within scipy.optimize respectively.
|
|
1209
|
-
method = Enum('NNLS', 'LP', 'LassoLars', 'OMPCV'
|
|
1214
|
+
method = Enum('NNLS', 'LP', 'LassoLars', 'OMPCV')
|
|
1210
1215
|
|
|
1211
1216
|
#: Weight factor for LassoLars method,
|
|
1212
1217
|
#: defaults to 0.0.
|
|
1213
1218
|
# (Values in the order of 10^⁻9 should produce good results.)
|
|
1214
|
-
alpha = Range(0.0, 1.0, 0.0
|
|
1219
|
+
alpha = Range(0.0, 1.0, 0.0)
|
|
1215
1220
|
|
|
1216
1221
|
#: Maximum number of iterations,
|
|
1217
1222
|
#: tradeoff between speed and precision;
|
|
1218
1223
|
#: defaults to 500
|
|
1219
|
-
n_iter = Int(500
|
|
1224
|
+
n_iter = Int(500)
|
|
1220
1225
|
|
|
1221
1226
|
#: Unit multiplier for evaluating, e.g., nPa instead of Pa.
|
|
1222
1227
|
#: Values are converted back before returning.
|
|
1223
1228
|
#: Temporary conversion may be necessary to not reach machine epsilon
|
|
1224
1229
|
#: within fitting method algorithms. Defaults to 1e9.
|
|
1225
|
-
unit_mult = Float(1e9
|
|
1230
|
+
unit_mult = Float(1e9)
|
|
1226
1231
|
|
|
1227
|
-
|
|
1232
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
1228
1233
|
digest = Property(
|
|
1229
1234
|
depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['alpha', 'method', 'n_iter', 'unit_mult'],
|
|
1230
1235
|
)
|
|
@@ -1319,15 +1324,15 @@ class BeamformerOrth(BeamformerBase):
|
|
|
1319
1324
|
|
|
1320
1325
|
#: List of components to consider, use this to directly set the eigenvalues
|
|
1321
1326
|
#: used in the beamformer. Alternatively, set :attr:`n`.
|
|
1322
|
-
eva_list = CArray(dtype=int, value=np.array([-1])
|
|
1327
|
+
eva_list = CArray(dtype=int, value=np.array([-1]))
|
|
1323
1328
|
|
|
1324
|
-
#: Number of components to consider, defaults to 1
|
|
1329
|
+
#: Number of components to consider, defaults to ``1``. If set,
|
|
1325
1330
|
#: :attr:`eva_list` will contain
|
|
1326
1331
|
#: the indices of the n largest eigenvalues. Setting :attr:`eva_list`
|
|
1327
1332
|
#: afterwards will override this value.
|
|
1328
1333
|
n = Int(1)
|
|
1329
1334
|
|
|
1330
|
-
|
|
1335
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
1331
1336
|
digest = Property(
|
|
1332
1337
|
depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['eva_list'],
|
|
1333
1338
|
)
|
|
@@ -1388,18 +1393,18 @@ class BeamformerCleansc(BeamformerBase):
|
|
|
1388
1393
|
|
|
1389
1394
|
#: no of CLEAN-SC iterations
|
|
1390
1395
|
#: defaults to 0, i.e. automatic (max 2*num_channels)
|
|
1391
|
-
n_iter = Int(0
|
|
1396
|
+
n_iter = Int(0)
|
|
1392
1397
|
|
|
1393
1398
|
#: iteration damping factor
|
|
1394
1399
|
#: defaults to 0.6
|
|
1395
|
-
damp = Range(0.01, 1.0, 0.6
|
|
1400
|
+
damp = Range(0.01, 1.0, 0.6)
|
|
1396
1401
|
|
|
1397
1402
|
#: iteration stop criterion for automatic detection
|
|
1398
1403
|
#: iteration stops if power[i]>power[i-stopn]
|
|
1399
1404
|
#: defaults to 3
|
|
1400
|
-
stopn = Int(3
|
|
1405
|
+
stopn = Int(3)
|
|
1401
1406
|
|
|
1402
|
-
|
|
1407
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
1403
1408
|
digest = Property(depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['n_iter', 'damp', 'stopn'])
|
|
1404
1409
|
|
|
1405
1410
|
@cached_property
|
|
@@ -1478,19 +1483,31 @@ class BeamformerClean(BeamformerBase):
|
|
|
1478
1483
|
"""
|
|
1479
1484
|
|
|
1480
1485
|
#: The floating-number-precision of the PSFs. Default is 64 bit.
|
|
1481
|
-
psf_precision = Enum('float64', 'float32'
|
|
1486
|
+
psf_precision = Enum('float64', 'float32')
|
|
1482
1487
|
|
|
1483
1488
|
# iteration damping factor
|
|
1484
1489
|
# defaults to 0.6
|
|
1485
|
-
|
|
1490
|
+
#: damping factor
|
|
1491
|
+
damp = Range(0.01, 1.0, 0.6)
|
|
1486
1492
|
|
|
1487
1493
|
# max number of iterations
|
|
1488
|
-
|
|
1494
|
+
#: maximum number of iterations
|
|
1495
|
+
n_iter = Int(100)
|
|
1489
1496
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1497
|
+
#: Flag that defines how to calculate and store the point spread function
|
|
1498
|
+
#: defaults to 'single'.
|
|
1499
|
+
#:
|
|
1500
|
+
#: * 'full': Calculate the full PSF (for all grid points) in one go (should be used if the PSF
|
|
1501
|
+
#: at all grid points is needed, as with :class:`DAMAS<BeamformerDamas>`)
|
|
1502
|
+
#: * 'single': Calculate the PSF for the grid points defined by :attr:`grid_indices`, one by one
|
|
1503
|
+
#: (useful if not all PSFs are needed, as with :class:`CLEAN<BeamformerClean>`)
|
|
1504
|
+
#: * 'block': Calculate the PSF for the grid points defined by :attr:`grid_indices`, in one go
|
|
1505
|
+
#: (useful if not all PSFs are needed, as with :class:`CLEAN<BeamformerClean>`)
|
|
1506
|
+
#: * 'readonly': Do not attempt to calculate the PSF since it should already be cached (useful
|
|
1507
|
+
#: if multiple processes have to access the cache file)
|
|
1508
|
+
calcmode = Enum('block', 'full', 'single', 'readonly')
|
|
1492
1509
|
|
|
1493
|
-
|
|
1510
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
1494
1511
|
digest = Property(
|
|
1495
1512
|
depends_on=BEAMFORMER_BASE_DIGEST_DEPENDENCIES + ['n_iter', 'damp', 'psf_precision'],
|
|
1496
1513
|
)
|
|
@@ -1581,37 +1598,33 @@ class BeamformerCMF(BeamformerBase):
|
|
|
1581
1598
|
'fmin_l_bfgs_b',
|
|
1582
1599
|
'Split_Bregman',
|
|
1583
1600
|
'FISTA',
|
|
1584
|
-
desc='fit method used',
|
|
1585
1601
|
)
|
|
1586
1602
|
|
|
1587
1603
|
#: Weight factor for LassoLars method,
|
|
1588
1604
|
#: defaults to 0.0.
|
|
1589
1605
|
#: (Use values in the order of 10^⁻9 for good results.)
|
|
1590
|
-
alpha = Range(0.0, 1.0, 0.0
|
|
1606
|
+
alpha = Range(0.0, 1.0, 0.0)
|
|
1591
1607
|
|
|
1592
1608
|
#: Total or maximum number of iterations
|
|
1593
1609
|
#: (depending on :attr:`method`),
|
|
1594
1610
|
#: tradeoff between speed and precision;
|
|
1595
1611
|
#: defaults to 500
|
|
1596
|
-
n_iter = Int(500
|
|
1612
|
+
n_iter = Int(500)
|
|
1597
1613
|
|
|
1598
1614
|
#: Unit multiplier for evaluating, e.g., nPa instead of Pa.
|
|
1599
1615
|
#: Values are converted back before returning.
|
|
1600
1616
|
#: Temporary conversion may be necessary to not reach machine epsilon
|
|
1601
1617
|
#: within fitting method algorithms. Defaults to 1e9.
|
|
1602
|
-
unit_mult = Float(1e9
|
|
1618
|
+
unit_mult = Float(1e9)
|
|
1603
1619
|
|
|
1604
1620
|
#: If True, shows the status of the PyLops solver. Only relevant in case of FISTA or
|
|
1605
1621
|
#: Split_Bregman
|
|
1606
|
-
show = Bool(False
|
|
1622
|
+
show = Bool(False)
|
|
1607
1623
|
|
|
1608
1624
|
#: Energy normalization in case of diagonal removal not implemented for inverse methods.
|
|
1609
|
-
r_diag_norm = Enum(
|
|
1610
|
-
None,
|
|
1611
|
-
desc='Energy normalization in case of diagonal removal not implemented for inverse methods',
|
|
1612
|
-
)
|
|
1625
|
+
r_diag_norm = Enum(None)
|
|
1613
1626
|
|
|
1614
|
-
|
|
1627
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
1615
1628
|
digest = Property(
|
|
1616
1629
|
depends_on=[
|
|
1617
1630
|
'freq_data.digest',
|
|
@@ -1797,30 +1810,27 @@ class BeamformerSODIX(BeamformerBase):
|
|
|
1797
1810
|
#: Type of fit method to be used ('fmin_l_bfgs_b').
|
|
1798
1811
|
#: These methods are implemented in
|
|
1799
1812
|
#: the scipy module.
|
|
1800
|
-
method = Enum('fmin_l_bfgs_b'
|
|
1813
|
+
method = Enum('fmin_l_bfgs_b')
|
|
1801
1814
|
|
|
1802
1815
|
#: Maximum number of iterations,
|
|
1803
1816
|
#: tradeoff between speed and precision;
|
|
1804
1817
|
#: defaults to 200
|
|
1805
|
-
n_iter = Int(200
|
|
1818
|
+
n_iter = Int(200)
|
|
1806
1819
|
|
|
1807
1820
|
#: Weight factor for regularization,
|
|
1808
1821
|
#: defaults to 0.0.
|
|
1809
|
-
alpha = Range(0.0, 1.0, 0.0
|
|
1822
|
+
alpha = Range(0.0, 1.0, 0.0)
|
|
1810
1823
|
|
|
1811
1824
|
#: Unit multiplier for evaluating, e.g., nPa instead of Pa.
|
|
1812
1825
|
#: Values are converted back before returning.
|
|
1813
1826
|
#: Temporary conversion may be necessary to not reach machine epsilon
|
|
1814
1827
|
#: within fitting method algorithms. Defaults to 1e9.
|
|
1815
|
-
unit_mult = Float(1e9
|
|
1828
|
+
unit_mult = Float(1e9)
|
|
1816
1829
|
|
|
1817
1830
|
#: Energy normalization in case of diagonal removal not implemented for inverse methods.
|
|
1818
|
-
r_diag_norm = Enum(
|
|
1819
|
-
None,
|
|
1820
|
-
desc='Energy normalization in case of diagonal removal not implemented for inverse methods',
|
|
1821
|
-
)
|
|
1831
|
+
r_diag_norm = Enum(None)
|
|
1822
1832
|
|
|
1823
|
-
|
|
1833
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
1824
1834
|
digest = Property(
|
|
1825
1835
|
depends_on=[
|
|
1826
1836
|
'freq_data.digest',
|
|
@@ -1960,13 +1970,13 @@ class BeamformerGIB(BeamformerEig): # BeamformerEig #BeamformerBase
|
|
|
1960
1970
|
#: Values are converted back before returning.
|
|
1961
1971
|
#: Temporary conversion may be necessary to not reach machine epsilon
|
|
1962
1972
|
#: within fitting method algorithms. Defaults to 1e9.
|
|
1963
|
-
unit_mult = Float(1e9
|
|
1973
|
+
unit_mult = Float(1e9)
|
|
1964
1974
|
|
|
1965
1975
|
#: Total or maximum number of iterations
|
|
1966
1976
|
#: (depending on :attr:`method`),
|
|
1967
1977
|
#: tradeoff between speed and precision;
|
|
1968
1978
|
#: defaults to 10
|
|
1969
|
-
n_iter = Int(10
|
|
1979
|
+
n_iter = Int(10)
|
|
1970
1980
|
|
|
1971
1981
|
#: Type of fit method to be used ('Suzuki', 'LassoLars', 'LassoLarsCV', 'LassoLarsBIC',
|
|
1972
1982
|
#: 'OMPCV' or 'NNLS', defaults to 'Suzuki').
|
|
@@ -1981,37 +1991,33 @@ class BeamformerGIB(BeamformerEig): # BeamformerEig #BeamformerBase
|
|
|
1981
1991
|
'LassoLarsCV',
|
|
1982
1992
|
'OMPCV',
|
|
1983
1993
|
'NNLS',
|
|
1984
|
-
desc='fit method used',
|
|
1985
1994
|
)
|
|
1986
1995
|
|
|
1987
1996
|
#: Weight factor for LassoLars method,
|
|
1988
1997
|
#: defaults to 0.0.
|
|
1989
|
-
alpha = Range(0.0, 1.0, 0.0
|
|
1998
|
+
alpha = Range(0.0, 1.0, 0.0)
|
|
1990
1999
|
# (use values in the order of 10^⁻9 for good results)
|
|
1991
2000
|
|
|
1992
2001
|
#: Norm to consider for the regularization in InverseIRLS and Suzuki methods
|
|
1993
2002
|
#: defaults to L-1 Norm
|
|
1994
|
-
pnorm = Float(1
|
|
2003
|
+
pnorm = Float(1)
|
|
1995
2004
|
|
|
1996
2005
|
#: Beta - Fraction of sources maintained after each iteration
|
|
1997
2006
|
#: defaults to 0.9
|
|
1998
|
-
beta = Float(0.9
|
|
2007
|
+
beta = Float(0.9)
|
|
1999
2008
|
|
|
2000
2009
|
#: eps - Regularization parameter for Suzuki algorithm
|
|
2001
2010
|
#: defaults to 0.05.
|
|
2002
|
-
eps_perc = Float(0.05
|
|
2011
|
+
eps_perc = Float(0.05)
|
|
2003
2012
|
|
|
2004
2013
|
# This feature is not fully supported may be changed in the next release
|
|
2005
|
-
|
|
2006
|
-
m = Int(0
|
|
2014
|
+
#: First eigenvalue to consider. Defaults to 0.
|
|
2015
|
+
m = Int(0)
|
|
2007
2016
|
|
|
2008
2017
|
#: Energy normalization in case of diagonal removal not implemented for inverse methods.
|
|
2009
|
-
r_diag_norm = Enum(
|
|
2010
|
-
None,
|
|
2011
|
-
desc='Energy normalization in case of diagonal removal not implemented for inverse methods',
|
|
2012
|
-
)
|
|
2018
|
+
r_diag_norm = Enum(None)
|
|
2013
2019
|
|
|
2014
|
-
|
|
2020
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
2015
2021
|
digest = Property(
|
|
2016
2022
|
depends_on=[
|
|
2017
2023
|
'steer.inv_digest',
|
|
@@ -2244,7 +2250,7 @@ class BeamformerGridlessOrth(BeamformerAdaptiveGrid):
|
|
|
2244
2250
|
|
|
2245
2251
|
#: List of components to consider, use this to directly set the eigenvalues
|
|
2246
2252
|
#: used in the beamformer. Alternatively, set :attr:`n`.
|
|
2247
|
-
eva_list = CArray(dtype=int, value=np.array([-1])
|
|
2253
|
+
eva_list = CArray(dtype=int, value=np.array([-1]))
|
|
2248
2254
|
|
|
2249
2255
|
#: Number of components to consider, defaults to 1. If set,
|
|
2250
2256
|
#: :attr:`eva_list` will contain
|
|
@@ -2264,15 +2270,12 @@ class BeamformerGridlessOrth(BeamformerAdaptiveGrid):
|
|
|
2264
2270
|
#: and 1 iteration
|
|
2265
2271
|
shgo = Dict
|
|
2266
2272
|
|
|
2267
|
-
#:
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
'This is handled via this normalization factor.'
|
|
2272
|
-
'For this class, normalization is not implemented. Defaults to 1.0.',
|
|
2273
|
-
)
|
|
2273
|
+
#: If diagonal of the csm is removed, some signal energy is lost.
|
|
2274
|
+
#: This is handled via this normalization factor.
|
|
2275
|
+
#: For this class, normalization is not implemented. Defaults to 1.0.
|
|
2276
|
+
r_diag_norm = Enum(1.0)
|
|
2274
2277
|
|
|
2275
|
-
|
|
2278
|
+
#: A unique identifier for the beamformer, based on its properties. (read-only)
|
|
2276
2279
|
digest = Property(
|
|
2277
2280
|
depends_on=['freq_data.digest', 'steer.digest', 'precision', 'r_diag', 'eva_list', 'bounds', 'shgo'],
|
|
2278
2281
|
)
|