TriggerAIAABenchmark#
- class acoular.aiaa.aiaa.TriggerAIAABenchmark
Bases:
TimeSamplesAIAABenchmarkContainer for tacho data in *.h5 format.
This class loads tacho data from h5 files as specified in “Microphone Array Benchmark b11: Rotating Point Sources” (https://doi.org/10.14279/depositonce-8460) and and provides information about this data.
- result(num=128)
Generate blocks of time-domain data iteratively.
The
result()method is a Python generator that yields blocks of time-domain data of the specified size. Data is either read from an HDF5 file (iffileis set) or from a NumPy array (ifdatais directly provided).- Parameters:
- num
int, optional The size of each block to be yielded, representing the number of time-domain samples per block.
- num
- Yields:
numpy.ndarrayA 2D array of shape (
num,num_channels) representing a block of time-domain data. The last block may have fewer thannumsamples if the total number of samples is not a multiple ofnum.
- Raises:
OSErrorIf no samples are available (i.e.,
num_samplesis0).
Examples
Create a generator and access blocks of data:
>>> import numpy as np >>> from acoular.sources import TimeSamples >>> ts = TimeSamples(data=np.random.rand(1000, 4), sample_freq=51200) >>> generator = ts.result(num=256) >>> for block in generator: ... print(block.shape) (256, 4) (256, 4) (256, 4) (232, 4)
Note that the last block may have fewer that
numsamples.
- file
Full path to the
.h5file containing time-domain data.
- basename
Basename of the
.h5file, set automatically from thefileattribute.
- num_channels
Number of input channels in the time data, set automatically based on the
loaded dataorspecified array.
- num_samples
Total number of time-domain samples, set automatically based on the
loaded dataorspecified array.
- data
A 2D NumPy array containing the time-domain data, shape (
num_samples,num_channels).
- metadata
Metadata loaded from the HDF5 file, if available.
- digest
A unique identifier for the samples, based on its properties. (read-only)
- sample_freq
Sampling frequency of the signal, defaults to 1.0