Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils.merge() does not save filter information #182

Open
obergmartin opened this issue Nov 2, 2023 · 1 comment
Open

utils.merge() does not save filter information #182

obergmartin opened this issue Nov 2, 2023 · 1 comment

Comments

@obergmartin
Copy link
Contributor

When making a merged epoch object I would expect the high/low pass filter information to be the same. Or do I not understand the intended behaviour?

Here's some code that reproduces the result I'm finding:

data_path = Path(mne.datasets.sample.data_path(verbose=False))
sample_dir = data_path / "MEG" / "sample"
subjects_dir = data_path / "subjects"
raw_path = sample_dir / "sample_audvis_filt-0-40_raw.fif"
raw = mne.io.read_raw(raw_path).crop(10)
e = mne.make_fixed_length_epochs(raw, duration=1, preload=True)
# use the same data just for the example
e_merge = utils.merge(e,e)
print(e_merge.info['highpass'], e.info['highpass'])
print(e_merge.info['lowpass'], e.info['lowpass'])
# the output:
# (0.0, 0.10000000149011612)
# (75.07687377929688, 40.0)

I think the that can be fixed here:?

info = mne.create_info(ch_names_merged, sfreq, ch_types='eeg',

@obergmartin
Copy link
Contributor Author

Is it safe to do this?

with info._unlock():
    info["lowpass"] = the_original_value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant