MaskedTimeOut#
- class acoular.tprocess.MaskedTimeOut
Bases:
TimeOutA signal processing block that allows for the selection of specific channels and time samples.
The
MaskedTimeOutclass is designed to filter data from a givenSamplesGenerator(or a derived object) by defining valid time samples and excluding specific channels. It acts as an intermediary between the data source and subsequent processing steps, ensuring that only the selected portion of the data is passed along.This class is useful for selecting specific portions of data for analysis. The processed data is accessed through the generator method
result(), which returns data in block-wise fashion for efficient streaming.- source
The input data source. It must be an instance of a
SamplesGenerator-derived class. This object provides the raw time-domain signals that will be filtered based on thestart,stop, andinvalid_channelsattributes.
- start
The index of the first valid sample. Default is
0.
- stop
The index of the last valid sample (exclusive). If set to
None, the selection continues until the end of the available data.
- invalid_channels
List of channel indices to be excluded from processing.
- channels
A mask or index array representing valid channels. (automatically updated)
- num_channels_total
Total number of input channels, including invalid channels, as given by
source. (read-only).
- num_samples_total
Total number of input channels, including invalid channels. (read-only).
- num_channels
Number of valid input channels after excluding
invalid_channels. (read-only)
- basename
The name of the cache file (without extension). It serves as an internal reference for data caching and tracking processed files. (automatically generated)
- digest
A unique identifier for the object, based on its properties. (read-only)
- result(num)
Generate blocks of processed data, selecting only valid samples and channels.
This method fetches data from the
sourceobject, applies the definedstartandstopconstraints on time samples, and filters outinvalid_channels. The data is then yielded in block-wise fashion to facilitate efficient streaming.- Parameters:
- num
int Number of samples per block.
- num
- Yields:
numpy.ndarrayAn array of shape (
num,MaskedTimeOut.num_channels), contatining blocks of a filtered time-domain signal. The last block may contain fewer samples if the total number of samples is not a multiple ofnum. MaskedTimeOut.num_channels is not inherited directly and may be smaller than thesource’s number of channels.
- Raises:
- sample_freq
Sampling frequency of output signal, as given by
source.