-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
if you run:
from pathlib import Path
import mne
mne.viz.set_browser_backend('matplotlib')
sample_dir = Path(mne.datasets.sample.data_path())
sample_fname = sample_dir / 'MEG' / 'sample' / 'sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(sample_fname, preload=True)
raw.crop(tmax=4)
meas_date = None
if meas_date is None:
raw.set_meas_date(None)
sfreq = raw.info['sfreq']
first_samp = 10_000
raw = mne.io.RawArray(raw.get_data(),
raw.info,
first_samp=first_samp)
annot = mne.Annotations(
onset=[0, 1.5],
duration=[1, 0.5],
description=["a", "b"],
orig_time=raw.info['meas_date'])
raw.set_annotations(annot)
raw.plot()
you get this
so far so good. But then if you do
raw.crop(0, 1.5) # should keep the first annotation
assert len(raw.annotations) == 1 # FAILS
the first annotation does not survive although you get the data from the first one.
@larsoner you agree it's a bug?
