This documentation is for development version 0.18.dev0.

mne.realtime.MockRtClient

class mne.realtime.MockRtClient(raw, verbose=None)[source]

Mock Realtime Client.

Parameters:
raw : instance of Raw object

The raw object which simulates the RtClient

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

Methods

__hash__($self, /) Return hash(self).
get_event_data(event_id, tmin, tmax[, …]) Simulate the data for a particular event-id.
get_measurement_info() Return the measurement info.
register_receive_callback(x) Fake API boilerplate.
send_data(epochs, picks, tmin, tmax, buffer_size) Read from raw object and send them to RtEpochs for processing.
start_receive_thread(x) Fake API boilerplate.
unregister_receive_callback(x) Fake API boilerplate.
__hash__($self, /)

Return hash(self).

get_event_data(event_id, tmin, tmax, picks=None, stim_channel=None, min_duration=0)[source]

Simulate the data for a particular event-id.

The epochs corresponding to a particular event-id are returned. The method remembers the epoch that was returned in the previous call and returns the next epoch in sequence. Once all epochs corresponding to an event-id have been exhausted, the method returns None.

Parameters:
event_id : int

The id of the event to consider.

tmin : float

Start time before event.

tmax : float

End time after event.

picks : str | list | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick all channels.

stim_channel : None | string | list of string

Name of the stim channel or all the stim channels affected by the trigger. If None, the config variables ‘MNE_STIM_CHANNEL’, ‘MNE_STIM_CHANNEL_1’, ‘MNE_STIM_CHANNEL_2’, etc. are read. If these are not found, it will default to ‘STI 014’.

min_duration : float

The minimum duration of a change in the events channel required to consider it as an event (in seconds).

Returns:
data : 2D array with shape [n_channels, n_times]

The epochs that are being simulated

get_measurement_info()[source]

Return the measurement info.

Returns:
self.info : dict

The measurement info.

register_receive_callback(x)[source]

Fake API boilerplate.

Parameters:
x : None

Not used.

send_data(epochs, picks, tmin, tmax, buffer_size)[source]

Read from raw object and send them to RtEpochs for processing.

Parameters:
epochs : instance of RtEpochs

The epochs object.

picks : str | list | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick all channels.

tmin : float

Time instant to start receiving buffers.

tmax : float

Time instant to stop receiving buffers.

buffer_size : int

Size of each buffer in terms of number of samples.

start_receive_thread(x)[source]

Fake API boilerplate.

Parameters:
x : None

Not used.

unregister_receive_callback(x)[source]

Fake API boilerplate.

Parameters:
x : None

Not used.