consumer#
Implement consumer classes that provide Acoular data to Bokeh data sources.
Provide Acoular time data to a Bokeh |
|
Provide frequency-band data to a Bokeh |
- class spectacoular.consumer.TimeConsumer#
Bases:
TimeOutProvide Acoular time data to a Bokeh
ColumnDataSource.This
TimeOut-derived class builds an interface from Acoular’s generator pipelines to Bokeh’sColumnDataSourcemodel for plots and tables.consume()runs in an extra non-GUIthreadand fetches blocks of data with lengthnumfromsource. These blocks are stored indata, andupdate()is then registered as a callback for the GUI event loop.update()sends the data, downsampled by a factordown, tods, which holds an overall length ofrolloversamples. The elapsed time in seconds is stored inelapsed.- ds#
Bokeh’s ColumnDataSource, updated from result loop
- channels#
channels to have in the output
- num#
input block size
- down#
downsampling factor for output
- rollover#
total length of columns in ds
- elapsed#
elapsed time in data
- updated#
flag for update / consume
- data#
transport between consume / update
- init_ds()#
Initialize the
ColumnDataSourcewith channel columns.
- ch_names()#
Yield channel names for iterating over channels.
- consume(doc)#
Consume samples from the source in a non-GUI thread.
- Parameters:
- doc
Server document used to register callbacks.
- update()#
Update the data source from the GUI event loop.
- result(num)#
Yield the output block-wise.
This method does nothing in this class.
- source#
Data source;
Generatoror derived object.
- digest#
A unique identifier for the generator, based on its properties. (read-only)
- class spectacoular.consumer.TimeBandsConsumer#
Bases:
TimeConsumerProvide frequency-band data to a Bokeh
ColumnDataSource.This
TimeConsumer-derived class specializes in plots over frequency bands, such as octave spectra.It works like
TimeConsumer, but ignoresdownandrollover. Instead, only the first sample of each block is taken from the input.dshas a column for each input channel with one frequency-band value in each row.bandsgives the bands, andlfunccan be used to convert them to human-readable label strings.- lfunc#
Function to convert bands into list of labels
- bands#
List of labels for bands
- numbands#
Number of bands
- update()#
Update the data source from the GUI event loop.
- ch_names()#
Yield channel names for iterating over channels.
- consume(doc)#
Consume samples from the source in a non-GUI thread.
- Parameters:
- doc
Server document used to register callbacks.
- init_ds()#
Initialize the
ColumnDataSourcewith channel columns.
- result(num)#
Yield the output block-wise.
This method does nothing in this class.
- ds#
Bokeh’s ColumnDataSource, updated from result loop
- channels#
channels to have in the output
- num#
input block size
- down#
downsampling factor for output
- rollover#
total length of columns in ds
- elapsed#
elapsed time in data
- updated#
flag for update / consume
- data#
transport between consume / update
- source#
Data source;
Generatoror derived object.
- digest#
A unique identifier for the generator, based on its properties. (read-only)