TimeConsumer#

class spectacoular.consumer.TimeConsumer

Bases: TimeOut

Provide Acoular time data to a Bokeh ColumnDataSource.

This TimeOut-derived class builds an interface from Acoular’s generator pipelines to Bokeh’s ColumnDataSource model for plots and tables.

consume() runs in an extra non-GUI thread and fetches blocks of data with length num from source. These blocks are stored in data, and update() is then registered as a callback for the GUI event loop. update() sends the data, downsampled by a factor down, to ds, which holds an overall length of rollover samples. The elapsed time in seconds is stored in elapsed.

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

thread

thread in which consume() runs

elapsed

elapsed time in data

updated

flag for update / consume

data

transport between consume / update

init_ds()

Initialize the ColumnDataSource with 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; Generator or derived object.

sample_freq

Sampling frequency of output signal, as given by source.

num_channels

Number of channels in output, as given by source.

num_samples

Number of samples in output, as given by source.

digest

A unique identifier for the generator, based on its properties. (read-only)