Skip to content

Commit 8fccf71

Browse files
committed
Merge branch 'channel_specific_epoch_rejection' of github.com:CarinaFo/mne-python into channel_specific_epoch_rejection
2 parents 32a87f8 + f94c7e4 commit 8fccf71

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

mne/epochs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4645,8 +4645,9 @@ def make_fixed_length_epochs(
46454645
)
46464646

46474647

4648-
def channel_specific_epoch_rejection(data: np.ndarray,
4649-
outliers: float) -> np.ndarray[bool]:
4648+
def channel_specific_epoch_rejection(
4649+
data: np.ndarray, outliers: float
4650+
) -> np.ndarray[bool]:
46504651
"""Mask outlier epochs for each channel.
46514652
46524653
Parameters
@@ -4675,6 +4676,4 @@ def channel_specific_epoch_rejection(data: np.ndarray,
46754676
mean = np.mean(abs_data, axis=(-1, 0)) # (channels X (frequency))
46764677
# keep epochs where the maximum voltage is smaller than the mean + (outliers * std)
46774678
keep = max < ((outliers * std) + mean) # (epochs X channels X (frequency))
4678-
# set values in 3D data arry to NaN where 2D mask is False
4679-
data[keep is False] = np.nan
4680-
return keep, data
4679+
return keep

0 commit comments

Comments
 (0)