Fix cmr grouping
@@ -140,8 +140,10 @@ class CommonReferenceRecordingSegment(BasePreprocessorSegment):
selected_channels = []
if self.groups:
for chan_inds in self.groups:
- selected_groups.append(chan_inds)
sel_inds = [ind for ind in channel_indices if ind in chan_inds]
+ # if no channels are in a group, do not return the group
+ if len(sel_inds) > 0:
+ selected_groups.append(chan_inds)
selected_channels.append(sel_inds)
else:
# no groups = all channels
