#NEWLINE# def get_event_data( self , event_id , tmin , tmax , picks , stim_channel = None , min_duration = 0 ) : #NEWLINE# #INDENT# "Simulate the data for a particular event-id.\n\n        The epochs corresponding to a particular event-id are returned. The\n        method remembers the epoch that was returned in the previous call and\n        returns the next epoch in sequence. Once all epochs corresponding to\n        an event-id have been exhausted, the method returns None.\n\n        Parameters\n        ----------\n        event_id : int\n            The id of the event to consider.\n        tmin : float\n            Start time before event.\n        tmax : float\n            End time after event.\n        picks : array-like of int\n            Indices of channels.\n        stim_channel : None | string | list of string\n            Name of the stim channel or all the stim channels\n            affected by the trigger. If None, the config variables\n            'MNE_STIM_CHANNEL', 'MNE_STIM_CHANNEL_1', 'MNE_STIM_CHANNEL_2',\n            etc. are read. If these are not found, it will default to\n            'STI 014'.\n        min_duration : float\n            The minimum duration of a change in the events channel required\n            to consider it as an event (in seconds).\n\n        Returns\n        -------\n        data : 2D array with shape [n_channels, n_times]\n            The epochs that are being simulated\n        " #NEWLINE# events = find_events ( self . raw , stim_channel = stim_channel , verbose = False , output = 'onset' , consecutive = 'increasing' , min_duration = min_duration ) #NEWLINE# idx = np . where ( ( events [ : , ( - 1 ) ] == event_id ) ) [ 0 ] #NEWLINE# event_samp = events [ ( idx , 0 ) ] #NEWLINE# if ( event_id not in self . _current ) : #NEWLINE# #INDENT# self . _current [ event_id ] = 0 #NEWLINE# self . _last [ event_id ] = len ( event_samp ) #NEWLINE# #UNINDENT# tmin_samp = int ( round ( ( self . info [ 'sfreq' ] * tmin ) ) ) #NEWLINE# tmax_samp = ( int ( round ( ( self . info [ 'sfreq' ] * tmax ) ) ) + 1 ) #NEWLINE# if ( self . _current [ event_id ] < self . _last [ event_id ] ) : #NEWLINE# #INDENT# ev_samp = event_samp [ self . _current [ event_id ] ] #NEWLINE# start = ( ( ev_samp + tmin_samp ) - self . raw . first_samp ) #NEWLINE# stop = ( ( ev_samp + tmax_samp ) - self . raw . first_samp ) #NEWLINE# self . _current [ min_duration ] += 1 #NEWLINE# ( data , _ ) = self . raw [ picks , start : stop ] #NEWLINE# return data #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return None