Problem with temporal spans mark with BAD when epoching data

External Email - Use Caution

Hi Group,

I have a problem when epoching data using the Epoch module. Even though the
annotations mark some of the time spans as BAD, but the drop_log info
indicated that all epochs are not BAD. I'm not sure which parameters that I
have not correctly configured for the code below

import mne

filename = r'S17_3.mff' # Accessible via the:
https://drive.google.com/drive/folders/15lAjuEPC2iSbBKBSy8y11Q0Fs24cnSd1

raw = mne.io.read_raw_egi(filename)

raw.crop(tmax=240)

my_annot = mne.Annotations(onset=[50, 95, 155], duration=[1, 3, 0.25],
description=['BAD_x', 'BAD', 'BAD_Y'])

raw2 = raw.copy().set_annotations(my_annot)

event_id = 1 # This is used to identify the events.

duration = 30 # Divide continous signal into an epoch of 30 seconds

events = mne.make_fixed_length_events(raw2, id=event_id, duration=duration)

epochs = mne.Epochs(raw2, events=events, event_id=event_id)

Thanks in advance for any insight

Regards

Rodney

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200803/582e3508/attachment.html

External Email - Use Caution

import mne

filename = r'S17_3.mff' # Accessible via the:
S17_1.mff - Google Drive

The file I can download from that link is S17_1.mff. When I download it,
modify your code snippet to use that filename, and run it, I get an
`epochs` instance with 8 events. `epochs.drop_bad()` gives 7 events, which
makes sense because the first event will be cut off by the `tmin=-0.2`
default. So I can't really reproduce your error.

You probably also want to pass `tmin=0, tmax=duration, baseline=None` or
something similar to make sure you actually get 30 second epochs (the
defaults are tmin=-0.2, tmax=5.0).

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200803/6863f403/attachment.html