mne.realtime.MockRtClient

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

Mock Realtime Client.

Parameters
rawinstance of Raw object

The raw object which simulates the RtClient

verbosebool, 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(self, event_id, tmin, tmax[, …])

Simulate the data for a particular event-id.

get_measurement_info(self)

Return the measurement info.

register_receive_callback(self, x)

Fake API boilerplate.

send_data(self, epochs, picks, tmin, tmax, …)

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

start_receive_thread(self, x)

Fake API boilerplate.

unregister_receive_callback(self, x)

Fake API boilerplate.

__hash__(self, /)

Return hash(self).

get_event_data(self, 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_idint

The id of the event to consider.

tminfloat

Start time before event.

tmaxfloat

End time after event.

picksstr | 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_channelNone | str | list of str

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_durationfloat

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

Returns
data2D array with shape [n_channels, n_times]

The epochs that are being simulated

get_measurement_info(self)[source]

Return the measurement info.

Returns
self.infodict

The measurement info.

register_receive_callback(self, x)[source]

Fake API boilerplate.

Parameters
xNone

Not used.

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

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

Parameters
epochsinstance of RtEpochs

The epochs object.

picksstr | 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.

tminfloat

Time instant to start receiving buffers.

tmaxfloat

Time instant to stop receiving buffers.

buffer_sizeint

Size of each buffer in terms of number of samples.

start_receive_thread(self, x)[source]

Fake API boilerplate.

Parameters
xNone

Not used.

unregister_receive_callback(self, x)[source]

Fake API boilerplate.

Parameters
xNone

Not used.