TimeConsumer¶
- class spectacoular.consumer.TimeConsumer¶
Bases:
TimeOut
TimeOut
derived class for building an interface from Acoular’s generator pipelines to Bokeh’s ColumnDataSource model that serves as a source for plots and tables.How it works:
consume()
runs in an extra non-GUIthread
(must be set up by the user) and fetches blocks of data with lengthnum
fromsource
. These blocks are stored indata
andupdate()
is then registered as a callback for GUI event loop.update()
then sends the data, downsampled by a factordown
to ColumnDataSourceds()
, which holds an overall length ofrollover
samples. The elapsed time in seconds is stored inelapsed
- ds = Trait(ColumnDataSource)¶
Bokeh’s ColumnDataSource, updated from result loop
- channels = List(Int)¶
channels to have in the output
- num = Int(128)¶
input block size
- down = Int(8)¶
downsampling factor for output
- rollover = Int(8192)¶
total length of columns in ds
- elapsed = Float(0)¶
elapsed time in data
- updated = Trait(threading.Event)¶
flag for update / consume
- data = Array¶
transport between consume / update
- ch_names()¶
generator that returns channel names, helper for iterating over channels
- consume(doc)¶
consumes samples from source, to be run in an extra non-GUI thread
- Args:
doc: server document to register callbacks to
- update()¶
callback function for GUI event loop, updates data source
- result(num)¶
Python generator that yields the output block-wise. Does nothing in this class.