def _construct_signal_from_epochs(epochs, events, sfreq, tmin):
 (n_epochs, n_channels, n_times) = epochs.shape
 tmax = (tmin + (n_times / float(sfreq)))
 start = (np.min(events[:, 0]) + int((tmin * sfreq)))
 stop = ((np.max(events[:, 0]) + int((tmax * sfreq))) + 1)
 n_samples = (stop - start)
 (n_epochs, n_channels, n_times) = epochs.shape
 events_pos = (events[:, 0] - events[(0, 0)])
 raw = np.zeros((n_channels, n_samples))
 for idx in range(n_epochs):
  onset = events_pos[idx]
  offset = (onset + n_times)
  raw[:, onset:offset] = epochs[idx]
 return raw

def _construct_signal_from_epochs ( epochs , events , sfreq , tmin ) : ( n_epochs , n_channels , n_times ) = epochs . shape tmax = ( tmin + ( n_times / float ( sfreq ) ) ) start = ( np . min ( events [ : , 0 ] ) + int ( ( tmin * sfreq ) ) ) stop = ( ( np . max ( events [ : , 0 ] ) + int ( ( tmax * sfreq ) ) ) + 1 ) n_samples = ( stop - start ) ( n_epochs , n_channels , n_times ) = epochs . shape events_pos = ( events [ : , 0 ] - events [ ( 0 , 0 ) ] ) raw = np . zeros ( ( n_channels , n_samples ) ) for idx in range ( n_epochs ) : onset = events_pos [ idx ] offset = ( onset + n_times ) raw [ : , onset : offset ] = epochs [ idx ] return raw
reconstruct pseudo continuous signal from epochs .