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: object

Class that use multiprocessing to efficiently collect data from many devices at once.

Parameters:
  • network (list[tuple[AquisitionDevice, 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_collection is called.

Return type:

None

collect_for_seconds(duration_sec)๏ƒ

Collect data for duration_sec seconds.

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 multiple get_data operations 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 (AquisitionDevice) โ€“ The device to collect data from.

Return type:

None

Module contents๏ƒ