acoular 24.3__py3-none-any.whl → 24.7__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 (139) hide show
  1. acoular/__init__.py +119 -54
  2. acoular/calib.py +29 -38
  3. acoular/configuration.py +132 -82
  4. acoular/demo/__init__.py +10 -4
  5. acoular/demo/acoular_demo.py +73 -55
  6. acoular/environments.py +270 -264
  7. acoular/fastFuncs.py +366 -196
  8. acoular/fbeamform.py +1797 -1934
  9. acoular/grids.py +504 -548
  10. acoular/h5cache.py +74 -83
  11. acoular/h5files.py +159 -142
  12. acoular/internal.py +13 -14
  13. acoular/microphones.py +57 -53
  14. acoular/sdinput.py +57 -53
  15. acoular/signals.py +180 -178
  16. acoular/sources.py +920 -724
  17. acoular/spectra.py +353 -363
  18. acoular/tbeamform.py +416 -416
  19. acoular/tfastfuncs.py +180 -104
  20. acoular/tools/__init__.py +25 -0
  21. acoular/tools/aiaa.py +185 -0
  22. acoular/tools/helpers.py +189 -0
  23. acoular/tools/metrics.py +165 -0
  24. acoular/tprocess.py +1240 -1182
  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-24.3.dist-info → acoular-24.7.dist-info}/METADATA +58 -39
  31. acoular-24.7.dist-info/RECORD +50 -0
  32. {acoular-24.3.dist-info → acoular-24.7.dist-info}/WHEEL +1 -1
  33. acoular-24.7.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/BeamformerCMFLassoLarsBIC.npy +0 -0
  46. acoular/tests/reference_data/BeamformerCMFNNLS.npy +0 -0
  47. acoular/tests/reference_data/BeamformerCapon.npy +0 -0
  48. acoular/tests/reference_data/BeamformerClean.npy +0 -0
  49. acoular/tests/reference_data/BeamformerCleansc.npy +0 -0
  50. acoular/tests/reference_data/BeamformerCleant.npy +0 -0
  51. acoular/tests/reference_data/BeamformerCleantSq.npy +0 -0
  52. acoular/tests/reference_data/BeamformerCleantSqTraj.npy +0 -0
  53. acoular/tests/reference_data/BeamformerCleantTraj.npy +0 -0
  54. acoular/tests/reference_data/BeamformerDamas.npy +0 -0
  55. acoular/tests/reference_data/BeamformerDamasPlus.npy +0 -0
  56. acoular/tests/reference_data/BeamformerEig.npy +0 -0
  57. acoular/tests/reference_data/BeamformerEigFalse1.npy +0 -0
  58. acoular/tests/reference_data/BeamformerEigFalse2.npy +0 -0
  59. acoular/tests/reference_data/BeamformerEigFalse3.npy +0 -0
  60. acoular/tests/reference_data/BeamformerEigFalse4.npy +0 -0
  61. acoular/tests/reference_data/BeamformerEigTrue1.npy +0 -0
  62. acoular/tests/reference_data/BeamformerEigTrue2.npy +0 -0
  63. acoular/tests/reference_data/BeamformerEigTrue3.npy +0 -0
  64. acoular/tests/reference_data/BeamformerEigTrue4.npy +0 -0
  65. acoular/tests/reference_data/BeamformerFunctional.npy +0 -0
  66. acoular/tests/reference_data/BeamformerGIB.npy +0 -0
  67. acoular/tests/reference_data/BeamformerGridlessOrth.npy +0 -0
  68. acoular/tests/reference_data/BeamformerMusic.npy +0 -0
  69. acoular/tests/reference_data/BeamformerOrth.npy +0 -0
  70. acoular/tests/reference_data/BeamformerSODIX.npy +0 -0
  71. acoular/tests/reference_data/BeamformerTime.npy +0 -0
  72. acoular/tests/reference_data/BeamformerTimeSq.npy +0 -0
  73. acoular/tests/reference_data/BeamformerTimeSqTraj.npy +0 -0
  74. acoular/tests/reference_data/BeamformerTimeTraj.npy +0 -0
  75. acoular/tests/reference_data/Environment.npy +0 -0
  76. acoular/tests/reference_data/Example1_numerical_values_testsum.h5 +0 -0
  77. acoular/tests/reference_data/FiltFiltOctave__.npy +0 -0
  78. acoular/tests/reference_data/FiltFiltOctave_band_100_0_fraction_Thirdoctave_.npy +0 -0
  79. acoular/tests/reference_data/FiltFreqWeight_weight_A_.npy +0 -0
  80. acoular/tests/reference_data/FiltFreqWeight_weight_C_.npy +0 -0
  81. acoular/tests/reference_data/FiltFreqWeight_weight_Z_.npy +0 -0
  82. acoular/tests/reference_data/FiltOctave__.npy +0 -0
  83. acoular/tests/reference_data/FiltOctave_band_100_0_fraction_Thirdoctave_.npy +0 -0
  84. acoular/tests/reference_data/Filter__.npy +0 -0
  85. acoular/tests/reference_data/GeneralFlowEnvironment.npy +0 -0
  86. acoular/tests/reference_data/OctaveFilterBank__.npy +0 -0
  87. acoular/tests/reference_data/OpenJet.npy +0 -0
  88. acoular/tests/reference_data/PointSource.npy +0 -0
  89. acoular/tests/reference_data/PowerSpectra_csm.npy +0 -0
  90. acoular/tests/reference_data/PowerSpectra_ev.npy +0 -0
  91. acoular/tests/reference_data/RotatingFlow.npy +0 -0
  92. acoular/tests/reference_data/SlotJet.npy +0 -0
  93. acoular/tests/reference_data/TimeAverage__.npy +0 -0
  94. acoular/tests/reference_data/TimeCumAverage__.npy +0 -0
  95. acoular/tests/reference_data/TimeExpAverage_weight_F_.npy +0 -0
  96. acoular/tests/reference_data/TimeExpAverage_weight_I_.npy +0 -0
  97. acoular/tests/reference_data/TimeExpAverage_weight_S_.npy +0 -0
  98. acoular/tests/reference_data/TimeInOut__.npy +0 -0
  99. acoular/tests/reference_data/TimePower__.npy +0 -0
  100. acoular/tests/reference_data/TimeReverse__.npy +0 -0
  101. acoular/tests/reference_data/UniformFlowEnvironment.npy +0 -0
  102. acoular/tests/reference_data/beamformer_traj_time_data.h5 +0 -0
  103. acoular/tests/run_tests.sh +0 -18
  104. acoular/tests/run_tests_osx.sh +0 -16
  105. acoular/tests/test.npy +0 -0
  106. acoular/tests/test_beamformer_results.py +0 -213
  107. acoular/tests/test_classes.py +0 -60
  108. acoular/tests/test_digest.py +0 -125
  109. acoular/tests/test_environments.py +0 -73
  110. acoular/tests/test_example1.py +0 -124
  111. acoular/tests/test_grid.py +0 -92
  112. acoular/tests/test_integrate.py +0 -102
  113. acoular/tests/test_signals.py +0 -60
  114. acoular/tests/test_sources.py +0 -65
  115. acoular/tests/test_spectra.py +0 -38
  116. acoular/tests/test_timecache.py +0 -35
  117. acoular/tests/test_tprocess.py +0 -90
  118. acoular/tests/test_traj_beamformer_results.py +0 -164
  119. acoular/tests/unsupported/SpeedComparison/OvernightTestcasesBeamformer_nMics32_nGridPoints100_nFreqs4_nTrials10.png +0 -0
  120. acoular/tests/unsupported/SpeedComparison/cythonBeamformer.pyx +0 -237
  121. acoular/tests/unsupported/SpeedComparison/mainForCython.py +0 -103
  122. acoular/tests/unsupported/SpeedComparison/mainForParallelJit.py +0 -143
  123. acoular/tests/unsupported/SpeedComparison/setupCythonOpenMP.py +0 -63
  124. acoular/tests/unsupported/SpeedComparison/sharedFunctions.py +0 -153
  125. acoular/tests/unsupported/SpeedComparison/timeOverNMics_AllImportantMethods.png +0 -0
  126. acoular/tests/unsupported/SpeedComparison/timeOverNMics_faverage.png +0 -0
  127. acoular/tests/unsupported/SpeedComparison/vglOptimierungFAverage.py +0 -204
  128. acoular/tests/unsupported/SpeedComparison/vglOptimierungGaussSeidel.py +0 -182
  129. acoular/tests/unsupported/SpeedComparison/vglOptimierungR_BEAMFULL_INVERSE.py +0 -764
  130. acoular/tests/unsupported/SpeedComparison/vglOptimierungR_BEAM_OS.py +0 -231
  131. acoular/tests/unsupported/SpeedComparison/whatsFastestWayFor_absASquared.py +0 -48
  132. acoular/tests/unsupported/functionalBeamformer.py +0 -123
  133. acoular/tests/unsupported/precisionTest.py +0 -153
  134. acoular/tests/unsupported/validationOfBeamformerFuncsPOSTAcoularIntegration.py +0 -254
  135. acoular/tests/unsupported/validationOfBeamformerFuncsPREeAcoularIntegration.py +0 -531
  136. acoular/tools.py +0 -422
  137. acoular-24.3.dist-info/RECORD +0 -148
  138. acoular-24.3.dist-info/licenses/LICENSE +0 -29
  139. {acoular-24.3.dist-info → acoular-24.7.dist-info}/licenses/AUTHORS.rst +0 -0
@@ -1,80 +1,98 @@
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.
15
21
 
16
- Source location (relative to array center) and levels:
22
+ Source location (relative to array center) and RMS in 1 m distance:
17
23
 
18
24
  ====== =============== ======
19
- Source Location Level
25
+ Source Location RMS
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
+ import acoular as ac
40
+
41
+ ac.config.global_caching = 'none'
28
42
 
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
43
  # set up the parameters
36
- sfreq = 51200
44
+ sfreq = 51200
37
45
  duration = 1
38
- nsamples = duration*sfreq
39
- micgeofile = path.join(path.split(bpath)[0],'xml','array_64.xml')
46
+ nsamples = duration * sfreq
47
+ micgeofile = Path(ac.__file__).parent / 'xml' / 'array_64.xml'
40
48
  h5savefile = 'three_sources.h5'
41
-
49
+
42
50
  # 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 )
51
+ mg = ac.MicGeom(from_file=micgeofile)
52
+ n1 = ac.WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=1)
53
+ n2 = ac.WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=2, rms=0.7)
54
+ n3 = ac.WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=3, rms=0.5)
55
+ p1 = ac.PointSource(signal=n1, mics=mg, loc=(-0.1, -0.1, 0.3))
56
+ p2 = ac.PointSource(signal=n2, mics=mg, loc=(0.15, 0, 0.3))
57
+ p3 = ac.PointSource(signal=n3, mics=mg, loc=(0, 0.1, 0.3))
58
+ pa = ac.Mixer(source=p1, sources=[p2, p3])
59
+ wh5 = ac.WriteH5(source=pa, name=h5savefile)
52
60
  wh5.save()
53
-
61
+
54
62
  # 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 )
61
- 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__":
63
+
64
+ ps = ac.PowerSpectra(time_data=pa, block_size=128, window='Hanning')
65
+
66
+ rg = ac.RectGrid(x_min=-0.2, x_max=0.2, y_min=-0.2, y_max=0.2, z=0.3, increment=0.01)
67
+ st = ac.SteeringVector(grid=rg, mics=mg)
68
+
69
+ bb = ac.BeamformerBase(freq_data=ps, steer=st)
70
+ pm = bb.synthetic(8000, 3)
71
+ spl = ac.L_p(pm)
72
+
73
+ if ac.config.have_matplotlib:
74
+ from pylab import axis, colorbar, figure, imshow, plot, show
75
+
76
+ # show map
77
+ imshow(spl.T, origin='lower', vmin=spl.max() - 10, extent=rg.extend(), interpolation='bicubic')
78
+ colorbar()
79
+
80
+ # plot microphone geometry
81
+ figure(2)
82
+ plot(mg.mpos[0], mg.mpos[1], 'o')
83
+ axis('equal')
84
+
85
+ show()
86
+
87
+ else:
88
+ print('Matplotlib not found! Please install matplotlib if you want to plot the results.')
89
+ print('For consolation we do an ASCII map plot of the results here.')
90
+ grayscale = '@%#*+=-:. '[::-1]
91
+ ind = ((spl.T - spl.max() + 9).clip(0, 9)).astype(int)[::-1]
92
+ print(78 * '-')
93
+ print('|\n'.join([' '.join(['|'] + [grayscale[i] for i in row[2:-1]]) for row in ind]) + '|')
94
+ print(7 * '-', ''.join([f'{grayscale[i]}={int(spl.max())-9+i}dB ' for i in range(1, 10)]), 6 * '-')
95
+
96
+
97
+ if __name__ == '__main__':
80
98
  run()