Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/dev/13466.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug with :func:`mne.add_reference_channels` not working correctly when passing more than one channel name, by `Michael Straube`_.
2 changes: 1 addition & 1 deletion mne/_fiff/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def add_reference_channels(inst, ref_channels, copy=True):
"unit_mul": FIFF.FIFF_UNITM_NONE,
"unit": FIFF.FIFF_UNIT_V,
"coord_frame": FIFF.FIFFV_COORD_HEAD,
"loc": ref_dig_array,
"loc": ref_dig_array.copy(),
}
inst.info["chs"].append(chan_info)
inst.info._update_redundant()
Expand Down
4 changes: 4 additions & 0 deletions mne/_fiff/tests/test_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@ def test_add_reference():
ref_data, _ = raw[[ref_idx, ref_idy]]
assert_array_equal(ref_data, 0)

loc1 = raw.info["chs"][ref_idx]["loc"]
loc2 = raw.info["chs"][ref_idy]["loc"]
assert loc1 is not loc2

# add reference channel to epochs
raw = read_raw_fif(fif_fname, preload=True)
events = read_events(eve_fname)
Expand Down