Acoular 19.11 documentation

SampleSplitter

«  WriteH5   ::   tprocess   ::   configuration  »

SampleSplitter

class acoular.tprocess.SampleSplitter

Bases: acoular.tprocess.TimeInOut

This class distributes data blocks from source to several following objects. A separate block buffer is created for each registered object in (block_buffer) .

block_buffer = Dict(key_trait=Instance(SamplesGenerator))

dictionary with block buffers (dict values) of registered objects (dict keys).

buffer_size = Int(100)

max elements/blocks in block buffers.

buffer_overflow_treatment = Dict(key_trait=Instance(SamplesGenerator), value_trait=Trait('error','warning','none'), desc='defines buffer overflow behaviour.')

defines behaviour in case of block_buffer overflow. Can be set individually for each registered object.

  • ‘error’: an IOError is thrown by the class

  • ‘warning’: a warning is displayed. Possibly leads to lost blocks of data

  • ‘none’: nothing happens. Possibly leads to lost blocks of data

register_object(self, *objects_to_register)

Function that can be used to register objects that receive blocks from this class.

remove_object(self, *objects_to_remove)

Function that can be used to remove registered objects.

result(self, num)

Python generator that yields the output block-wise from block-buffer.

Parameters
numinteger

This parameter defines the size of the blocks to be yielded (i.e. the number of samples per block).

Returns
Samples in blocks of shape (num, numchannels).

Delivers a block of samples to the calling object. The last block may be shorter than num.

«  WriteH5   ::   tprocess   ::   configuration  »