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 = Instance(SamplesGenerator)
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 = CInt(0)
The index of the first valid sample. Default is
0.
- stop = Union(None, CInt)
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(int)
List of channel indices to be excluded from processing.
- channels = Property(depends_on=['invalid_channels', 'source.num_channels'])
A mask or index array representing valid channels. (automatically updated)
- num_channels_total = Delegate('source', 'num_channels')
Total number of input channels, including invalid channels, as given by
source. (read-only).
- num_samples_total = Delegate('source', 'num_samples')
Total number of input channels, including invalid channels. (read-only).
- num_channels = Property(depends_on=['invalid_channels', 'source.num_channels'])
Number of valid input channels after excluding
invalid_channels. (read-only)
- num_samples = Property(depends_on=['start', 'stop', 'source.num_samples'])
Number of valid time-domain samples, based on
startandstopindices. (read-only)
- basename = Property(depends_on=['source.digest'])
The name of the cache file (without extension). It serves as an internal reference for data caching and tracking processed files. (automatically generated)
- digest = Property(depends_on=['source.digest', 'start', 'stop', 'invalid_channels'])
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: