Epoch() classifies all epochs as "bad" (Alexandre Gramfort)

External Email - Use Caution

Dear Alex & list,

Following Alex G. recommendation (thanks, by the way) I checked the plot
with events (raw.plot(events=events); which perfectly displays all the
events at the correct timing), the sampling frequency (which is correctly
identified from raw.info['sfreq'] as 2048.0) and the first sample (also
correctly identifying the index of the first sample in the raw data file).

So, I am still stuck: the Epochs command still correctly detects the events
by the event_ids (epoch count is correct), but when the epochs are read it
sets them all as 'IGNORED', and occasionally 'NO_DATA' or 'TOO_SHORT'.

I put some sample data and a simplified version of the code that fails to
produce epochs on the following dropbox folder:
https://www.dropbox.com/sh/09b71oumga8xm4y/AABg04xw-cCiCnn9FMSSqODca?dl=0

Thanks in advance for your help!
Best,
Daniel

External Email - Use Caution

hi,

you wrote:

tmin=-500, tmax=2000

so 500s before stim and 2000s after.

Use:

tmin=-0.5, tmax=2.

and it should work.

Best,
Alex