Skip to content

Commit 6e6c4a4

Browse files
committed
added masked data to function and to return
1 parent 8fccf71 commit 6e6c4a4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

mne/epochs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4676,4 +4676,6 @@ def channel_specific_epoch_rejection(
46764676
mean = np.mean(abs_data, axis=(-1, 0)) # (channels X (frequency))
46774677
# keep epochs where the maximum voltage is smaller than the mean + (outliers * std)
46784678
keep = max < ((outliers * std) + mean) # (epochs X channels X (frequency))
4679+
# set values to NaN where 2D mask is False in the 3D data array
4680+
data[keep is False] = np.nan
46794681
return keep

0 commit comments

Comments
 (0)