acoular 23.11__py3-none-any.whl → 24.5__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.
Files changed (137) hide show
  1. acoular/__init__.py +118 -50
  2. acoular/calib.py +29 -38
  3. acoular/configuration.py +116 -73
  4. acoular/demo/__init__.py +10 -4
  5. acoular/demo/acoular_demo.py +78 -53
  6. acoular/environments.py +265 -262
  7. acoular/fastFuncs.py +361 -191
  8. acoular/fbeamform.py +1478 -1407
  9. acoular/grids.py +501 -545
  10. acoular/h5cache.py +50 -59
  11. acoular/h5files.py +154 -137
  12. acoular/internal.py +10 -11
  13. acoular/microphones.py +57 -53
  14. acoular/sdinput.py +47 -52
  15. acoular/signals.py +167 -179
  16. acoular/sources.py +818 -693
  17. acoular/spectra.py +349 -359
  18. acoular/tbeamform.py +414 -413
  19. acoular/tfastfuncs.py +178 -101
  20. acoular/tools/__init__.py +25 -0
  21. acoular/tools/aiaa.py +186 -0
  22. acoular/tools/helpers.py +189 -0
  23. acoular/tools/metrics.py +165 -0
  24. acoular/tprocess.py +1201 -1143
  25. acoular/traitsviews.py +513 -501
  26. acoular/trajectory.py +50 -52
  27. acoular/version.py +5 -6
  28. acoular/xml/minidsp_uma-16.xml +20 -0
  29. acoular/xml/{minidsp_uma16.xml → minidsp_uma-16_mirrored.xml} +3 -0
  30. {acoular-23.11.dist-info → acoular-24.5.dist-info}/METADATA +47 -40
  31. acoular-24.5.dist-info/RECORD +50 -0
  32. {acoular-23.11.dist-info → acoular-24.5.dist-info}/WHEEL +1 -1
  33. acoular-24.5.dist-info/licenses/LICENSE +28 -0
  34. acoular/fileimport.py +0 -380
  35. acoular/nidaqimport.py +0 -273
  36. acoular/tests/reference_data/BeamformerBase.npy +0 -0
  37. acoular/tests/reference_data/BeamformerBaseFalse1.npy +0 -0
  38. acoular/tests/reference_data/BeamformerBaseFalse2.npy +0 -0
  39. acoular/tests/reference_data/BeamformerBaseFalse3.npy +0 -0
  40. acoular/tests/reference_data/BeamformerBaseFalse4.npy +0 -0
  41. acoular/tests/reference_data/BeamformerBaseTrue1.npy +0 -0
  42. acoular/tests/reference_data/BeamformerBaseTrue2.npy +0 -0
  43. acoular/tests/reference_data/BeamformerBaseTrue3.npy +0 -0
  44. acoular/tests/reference_data/BeamformerBaseTrue4.npy +0 -0
  45. acoular/tests/reference_data/BeamformerCMF.npy +0 -0
  46. acoular/tests/reference_data/BeamformerCapon.npy +0 -0
  47. acoular/tests/reference_data/BeamformerClean.npy +0 -0
  48. acoular/tests/reference_data/BeamformerCleansc.npy +0 -0
  49. acoular/tests/reference_data/BeamformerCleant.npy +0 -0
  50. acoular/tests/reference_data/BeamformerCleantSq.npy +0 -0
  51. acoular/tests/reference_data/BeamformerCleantSqTraj.npy +0 -0
  52. acoular/tests/reference_data/BeamformerCleantTraj.npy +0 -0
  53. acoular/tests/reference_data/BeamformerDamas.npy +0 -0
  54. acoular/tests/reference_data/BeamformerDamasPlus.npy +0 -0
  55. acoular/tests/reference_data/BeamformerEig.npy +0 -0
  56. acoular/tests/reference_data/BeamformerEigFalse1.npy +0 -0
  57. acoular/tests/reference_data/BeamformerEigFalse2.npy +0 -0
  58. acoular/tests/reference_data/BeamformerEigFalse3.npy +0 -0
  59. acoular/tests/reference_data/BeamformerEigFalse4.npy +0 -0
  60. acoular/tests/reference_data/BeamformerEigTrue1.npy +0 -0
  61. acoular/tests/reference_data/BeamformerEigTrue2.npy +0 -0
  62. acoular/tests/reference_data/BeamformerEigTrue3.npy +0 -0
  63. acoular/tests/reference_data/BeamformerEigTrue4.npy +0 -0
  64. acoular/tests/reference_data/BeamformerFunctional.npy +0 -0
  65. acoular/tests/reference_data/BeamformerGIB.npy +0 -0
  66. acoular/tests/reference_data/BeamformerGridlessOrth.npy +0 -0
  67. acoular/tests/reference_data/BeamformerMusic.npy +0 -0
  68. acoular/tests/reference_data/BeamformerOrth.npy +0 -0
  69. acoular/tests/reference_data/BeamformerTime.npy +0 -0
  70. acoular/tests/reference_data/BeamformerTimeSq.npy +0 -0
  71. acoular/tests/reference_data/BeamformerTimeSqTraj.npy +0 -0
  72. acoular/tests/reference_data/BeamformerTimeTraj.npy +0 -0
  73. acoular/tests/reference_data/Environment.npy +0 -0
  74. acoular/tests/reference_data/Example1_numerical_values_testsum.h5 +0 -0
  75. acoular/tests/reference_data/FiltFiltOctave__.npy +0 -0
  76. acoular/tests/reference_data/FiltFiltOctave_band_100_0_fraction_Thirdoctave_.npy +0 -0
  77. acoular/tests/reference_data/FiltFreqWeight_weight_A_.npy +0 -0
  78. acoular/tests/reference_data/FiltFreqWeight_weight_C_.npy +0 -0
  79. acoular/tests/reference_data/FiltFreqWeight_weight_Z_.npy +0 -0
  80. acoular/tests/reference_data/FiltOctave__.npy +0 -0
  81. acoular/tests/reference_data/FiltOctave_band_100_0_fraction_Thirdoctave_.npy +0 -0
  82. acoular/tests/reference_data/Filter__.npy +0 -0
  83. acoular/tests/reference_data/GeneralFlowEnvironment.npy +0 -0
  84. acoular/tests/reference_data/OctaveFilterBank__.npy +0 -0
  85. acoular/tests/reference_data/OpenJet.npy +0 -0
  86. acoular/tests/reference_data/PointSource.npy +0 -0
  87. acoular/tests/reference_data/PowerSpectra_csm.npy +0 -0
  88. acoular/tests/reference_data/PowerSpectra_ev.npy +0 -0
  89. acoular/tests/reference_data/RotatingFlow.npy +0 -0
  90. acoular/tests/reference_data/SlotJet.npy +0 -0
  91. acoular/tests/reference_data/TimeAverage__.npy +0 -0
  92. acoular/tests/reference_data/TimeCumAverage__.npy +0 -0
  93. acoular/tests/reference_data/TimeExpAverage_weight_F_.npy +0 -0
  94. acoular/tests/reference_data/TimeExpAverage_weight_I_.npy +0 -0
  95. acoular/tests/reference_data/TimeExpAverage_weight_S_.npy +0 -0
  96. acoular/tests/reference_data/TimeInOut__.npy +0 -0
  97. acoular/tests/reference_data/TimePower__.npy +0 -0
  98. acoular/tests/reference_data/TimeReverse__.npy +0 -0
  99. acoular/tests/reference_data/UniformFlowEnvironment.npy +0 -0
  100. acoular/tests/reference_data/beamformer_traj_time_data.h5 +0 -0
  101. acoular/tests/run_tests.sh +0 -18
  102. acoular/tests/run_tests_osx.sh +0 -16
  103. acoular/tests/test.npy +0 -0
  104. acoular/tests/test_beamformer_results.py +0 -204
  105. acoular/tests/test_classes.py +0 -60
  106. acoular/tests/test_digest.py +0 -125
  107. acoular/tests/test_environments.py +0 -73
  108. acoular/tests/test_example1.py +0 -124
  109. acoular/tests/test_grid.py +0 -92
  110. acoular/tests/test_integrate.py +0 -102
  111. acoular/tests/test_signals.py +0 -60
  112. acoular/tests/test_sources.py +0 -65
  113. acoular/tests/test_spectra.py +0 -38
  114. acoular/tests/test_timecache.py +0 -35
  115. acoular/tests/test_tprocess.py +0 -90
  116. acoular/tests/test_traj_beamformer_results.py +0 -164
  117. acoular/tests/unsupported/SpeedComparison/OvernightTestcasesBeamformer_nMics32_nGridPoints100_nFreqs4_nTrials10.png +0 -0
  118. acoular/tests/unsupported/SpeedComparison/cythonBeamformer.pyx +0 -237
  119. acoular/tests/unsupported/SpeedComparison/mainForCython.py +0 -103
  120. acoular/tests/unsupported/SpeedComparison/mainForParallelJit.py +0 -143
  121. acoular/tests/unsupported/SpeedComparison/setupCythonOpenMP.py +0 -63
  122. acoular/tests/unsupported/SpeedComparison/sharedFunctions.py +0 -153
  123. acoular/tests/unsupported/SpeedComparison/timeOverNMics_AllImportantMethods.png +0 -0
  124. acoular/tests/unsupported/SpeedComparison/timeOverNMics_faverage.png +0 -0
  125. acoular/tests/unsupported/SpeedComparison/vglOptimierungFAverage.py +0 -204
  126. acoular/tests/unsupported/SpeedComparison/vglOptimierungGaussSeidel.py +0 -182
  127. acoular/tests/unsupported/SpeedComparison/vglOptimierungR_BEAMFULL_INVERSE.py +0 -764
  128. acoular/tests/unsupported/SpeedComparison/vglOptimierungR_BEAM_OS.py +0 -231
  129. acoular/tests/unsupported/SpeedComparison/whatsFastestWayFor_absASquared.py +0 -48
  130. acoular/tests/unsupported/functionalBeamformer.py +0 -123
  131. acoular/tests/unsupported/precisionTest.py +0 -153
  132. acoular/tests/unsupported/validationOfBeamformerFuncsPOSTAcoularIntegration.py +0 -254
  133. acoular/tests/unsupported/validationOfBeamformerFuncsPREeAcoularIntegration.py +0 -531
  134. acoular/tools.py +0 -418
  135. acoular-23.11.dist-info/RECORD +0 -146
  136. acoular-23.11.dist-info/licenses/LICENSE +0 -29
  137. {acoular-23.11.dist-info → acoular-24.5.dist-info}/licenses/AUTHORS.rst +0 -0
@@ -1,14 +1,20 @@
1
- #! /usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
- #pylint: disable-msg=E0611, E1101, C0103, R0901, R0902, R0903, R0904, W0232
4
- #------------------------------------------------------------------------------
1
+ # ------------------------------------------------------------------------------
5
2
  # Copyright (c) Acoular Development Team.
6
- #------------------------------------------------------------------------------
7
- """Demo for Acoular
3
+ # ------------------------------------------------------------------------------
4
+ """Demo for Acoular.
5
+
6
+ To run the demo, execute the following commands:
7
+
8
+ .. code-block:: python
9
+
10
+ import acoular
11
+
12
+ acoular.demo.acoular_demo.run()
13
+
8
14
 
9
15
  Generates a test data set for three sources, analyzes them and generates a
10
16
  map of the three sources.
11
-
17
+
12
18
  The simulation generates the sound pressure at 64 microphones that are
13
19
  arrangend in the 'array64' geometry, which is part of the package. The sound
14
20
  pressure signals are sampled at 51200 Hz for a duration of 1 second.
@@ -16,65 +22,84 @@ pressure signals are sampled at 51200 Hz for a duration of 1 second.
16
22
  Source location (relative to array center) and levels:
17
23
 
18
24
  ====== =============== ======
19
- Source Location Level
25
+ Source Location Level
20
26
  ====== =============== ======
21
27
  1 (-0.1,-0.1,0.3) 1.0 Pa
22
- 2 (0.15,0,0.3) 0.7 Pa
28
+ 2 (0.15,0,0.3) 0.7 Pa
23
29
  3 (0,0.1,0.3) 0.5 Pa
24
30
  ====== =============== ======
31
+
25
32
  """
26
33
 
34
+
27
35
  def run():
36
+ """Run the Acoular demo."""
37
+ from pathlib import Path
38
+
39
+ from acoular import (
40
+ BeamformerBase,
41
+ L_p,
42
+ MicGeom,
43
+ Mixer,
44
+ PointSource,
45
+ PowerSpectra,
46
+ RectGrid,
47
+ SteeringVector,
48
+ TimeSamples,
49
+ WNoiseGenerator,
50
+ WriteH5,
51
+ config,
52
+ )
53
+ from acoular import __file__ as bpath
28
54
 
29
- from os import path
30
- from acoular import __file__ as bpath, MicGeom, WNoiseGenerator, PointSource,\
31
- Mixer, WriteH5, TimeSamples, PowerSpectra, RectGrid, SteeringVector,\
32
- BeamformerBase, L_p
33
- from pylab import figure, plot, axis, imshow, colorbar, show
34
-
35
55
  # set up the parameters
36
- sfreq = 51200
56
+ sfreq = 51200
37
57
  duration = 1
38
- nsamples = duration*sfreq
39
- micgeofile = path.join(path.split(bpath)[0],'xml','array_64.xml')
58
+ nsamples = duration * sfreq
59
+ micgeofile = Path(bpath).parent / 'xml' / 'array_64.xml'
40
60
  h5savefile = 'three_sources.h5'
41
-
61
+
42
62
  # generate test data, in real life this would come from an array measurement
43
- mg = MicGeom( from_file=micgeofile )
44
- n1 = WNoiseGenerator( sample_freq=sfreq, numsamples=nsamples, seed=1 )
45
- n2 = WNoiseGenerator( sample_freq=sfreq, numsamples=nsamples, seed=2, rms=0.7 )
46
- n3 = WNoiseGenerator( sample_freq=sfreq, numsamples=nsamples, seed=3, rms=0.5 )
47
- p1 = PointSource( signal=n1, mics=mg, loc=(-0.1,-0.1,0.3) )
48
- p2 = PointSource( signal=n2, mics=mg, loc=(0.15,0,0.3) )
49
- p3 = PointSource( signal=n3, mics=mg, loc=(0,0.1,0.3) )
50
- pa = Mixer( source=p1, sources=[p2,p3] )
51
- wh5 = WriteH5( source=pa, name=h5savefile )
63
+ mg = MicGeom(from_file=micgeofile)
64
+ n1 = WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=1)
65
+ n2 = WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=2, rms=0.7)
66
+ n3 = WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=3, rms=0.5)
67
+ p1 = PointSource(signal=n1, mics=mg, loc=(-0.1, -0.1, 0.3))
68
+ p2 = PointSource(signal=n2, mics=mg, loc=(0.15, 0, 0.3))
69
+ p3 = PointSource(signal=n3, mics=mg, loc=(0, 0.1, 0.3))
70
+ pa = Mixer(source=p1, sources=[p2, p3])
71
+ wh5 = WriteH5(source=pa, name=h5savefile)
52
72
  wh5.save()
53
-
73
+
54
74
  # analyze the data and generate map
55
-
56
- ts = TimeSamples( name=h5savefile )
57
- ps = PowerSpectra( time_data=ts, block_size=128, window='Hanning' )
58
-
59
- rg = RectGrid( x_min=-0.2, x_max=0.2, y_min=-0.2, y_max=0.2, z=0.3, \
60
- increment=0.01 )
75
+
76
+ ts = TimeSamples(name=h5savefile)
77
+ ps = PowerSpectra(time_data=ts, block_size=128, window='Hanning')
78
+
79
+ rg = RectGrid(x_min=-0.2, x_max=0.2, y_min=-0.2, y_max=0.2, z=0.3, increment=0.01)
61
80
  st = SteeringVector(grid=rg, mics=mg)
62
-
63
- bb = BeamformerBase( freq_data=ps, steer=st )
64
- pm = bb.synthetic( 8000, 3 )
65
- Lm = L_p( pm )
66
-
67
- # show map
68
- imshow( Lm.T, origin='lower', vmin=Lm.max()-10, extent=rg.extend(), \
69
- interpolation='bicubic')
70
- colorbar()
71
-
72
- # plot microphone geometry
73
- figure(2)
74
- plot(mg.mpos[0],mg.mpos[1],'o')
75
- axis('equal')
76
-
77
- show()
78
-
79
- if __name__ == "__main__":
81
+
82
+ bb = BeamformerBase(freq_data=ps, steer=st)
83
+ pm = bb.synthetic(8000, 3)
84
+ Lm = L_p(pm)
85
+
86
+ if config.have_matplotlib:
87
+ from pylab import axis, colorbar, figure, imshow, plot, show
88
+
89
+ # show map
90
+ imshow(Lm.T, origin='lower', vmin=Lm.max() - 10, extent=rg.extend(), interpolation='bicubic')
91
+ colorbar()
92
+
93
+ # plot microphone geometry
94
+ figure(2)
95
+ plot(mg.mpos[0], mg.mpos[1], 'o')
96
+ axis('equal')
97
+
98
+ show()
99
+
100
+ else:
101
+ print('Matplotlib not found! Please install matplotlib if you want to plot the results.')
102
+
103
+
104
+ if __name__ == '__main__':
80
105
  run()