Skip to content

Commit

Permalink
Fix identifying common channels in TFR group average
Browse files Browse the repository at this point in the history
  • Loading branch information
teekuningas committed Apr 3, 2024
1 parent c9f53ce commit 967a65d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions meggie/actions/tfr_group_average/controller/tfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def group_average_tfr(experiment, tfr_name, groups, new_name):

# get common channels in "subject specific space"
subject_ch_names = tfr_item.info["ch_names"]
for ch_idx, ch_name in enumerate(clean_names(subject_ch_names)):
drop_names = []
if ch_name not in common_ch_names:
drop_names.append(subject_ch_names[ch_idx])
drop_names = [
name
for idx, name in enumerate(clean_names(subject_ch_names))
if name not in common_ch_names
]
tfr_item = tfr_item.copy().drop_channels(drop_names)

# sanity check
Expand Down

0 comments on commit 967a65d

Please sign in to comment.