neural_data_simulator.recorder

A utility to connect to LSL streams and save the data with timestamps to a file.

The recorder is useful for capturing multiple streams for offline analysis. It’s meant for short sessions (minutes) as it stores all data in memory and writes it to disk at the end of the session.

neural_data_simulator.recorder.recorders

Classes for recording data from source(s).

class neural_data_simulator.recorder.recorders.LSLStreamRecorder(stream_name)[source]

Bases: object

Helper class for collecting data from an LSL stream.

__init__(stream_name)[source]

Initialize the LSLStreamRecorder class.

Parameters

stream_name – Name of the LSL stream to record.

collect_sample()[source]

Try to read and store samples from the LSL stream.

save(prefix='')[source]

Save the collected data to an npz file.

The file will be named prefix + stream_name + .npz.

Parameters

prefix – Prefix to add to the filename.

neural_data_simulator.recorder.run_recorder

Script for saving data with timestamps from LSL streams into a file.

neural_data_simulator.recorder.run_recorder.run()[source]

Start the recorder.