'Read events from data.
Parameter
buffer_size : int
The size of chunk to by which the data are scanned.
Returns
events : array, [samples]
The event vector (1 x samples).'

def read_stim_ch(self, buffer_size=100000.0):

    buffer_size = int(buffer_size)
    start = int(self.first_samp)
    stop = int((self.last_samp + 1))
    pick = pick_types(self.info, meg=False, ref_meg=False, stim=True, exclude=[])
    stim_ch = np.empty((1, stop), dtype=np.int)
    for b_start in range(start, stop, buffer_size):
        b_stop = (b_start + buffer_size)
        x = self[pick, b_start:b_stop][0]
        stim_ch[:, b_start:(b_start + x.shape[1])] = x
    return stim_ch
