Morelia.Stream packageο
Subpackagesο
Submodulesο
Morelia.Stream.data_flow moduleο
Stream data from multiple devices to multiple destinations. In technical terms, this module is used to create bipartite dataflow graphs from devices to data sinks.
- class Morelia.Stream.data_flow.DataFlow(network)ο
Bases:
objectClass that use multiprocessing to efficiently collect data from many devices at once.
- Parameters:
network (
list[tuple[AcquisitionDevice,list[SinkInterface]]]) β A mapping of data sources (POD devices) to one or more data sinks.filter_method β Method to use to clean curropted data. Defaults to TAKE_PAST.
filter_insert_value β Value to insert when using the INSERT filter method. Defaults to NaN.
fail_tolerance β How many times in a row to fail reading before giving up on reading a βchunkβ of data (βchunkβ here is approximately 1 second of samples). Defaults to 3.
- collect()ο
Collect until
stop_collectionis called.- Return type:
None
- collect_for_seconds(duration_sec)ο
Collect data for
duration_secseconds.- Parameters:
duration_sec (
float) β How long to collect data for in seconds.- Return type:
None
- stop_collection()ο
Stop collecting data.
- Return type:
None
Morelia.Stream.source moduleο
Functions for getting streaming data from a POD device using ReactiveX (RxPy).
- Morelia.Stream.source.get_data(duration, manual_stop_event, pod, sinks)ο
Streams data from the POD device. The data drops about every 1 second. Streaming will continue until a βstop streamingβ packet is recieved.
- Parameters:
duration (
float) β How long to stream data for.manual_stop_event (
Event) β Used to synchronize multipleget_dataoperations in a flowgraph. When a flowgraph is told to stop collecting, this event is set which stops the loop within the reactivex operator that is collecting data.pod (
AcquisitionDevice) β The device to collect data from.
- Return type:
None
- Morelia.Stream.source.get_data_wrapper(duration_sec, manual_stop_event, source_class, source_dict, sinks_list)ο
- Morelia.Stream.source.make_packet_putter(read_queue)ο