mne.realtime.MockRtClient

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

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

Methods

__hash__() <==> hash(x)
get_event_data(event_id, tmin, tmax, picks) Simulate the data for a particular event-id.
get_measurement_info() Returns the measurement info.
register_receive_callback(x) 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) API boilerplate
unregister_receive_callback(x) API boilerplate
__hash__() <==> hash(x)
get_event_data(event_id, tmin, tmax, picks, stim_channel=None, min_duration=0)

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 : array-like of int

Indices of 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()

Returns the measurement info.

Returns:

self.info : dict

The measurement info.

register_receive_callback(x)

API boilerplate

Parameters:

x : None

Not used.

send_data(epochs, picks, tmin, tmax, buffer_size)

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

Parameters:

epochs : instance of RtEpochs

The epochs object.

picks : array-like of int

Indices of 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)

API boilerplate

Parameters:

x : None

Not used.

unregister_receive_callback(x)

API boilerplate

Parameters:

x : None

Not used.