Ejemplo n.º 1
0
def test_find_bad_by_ransac(raw=raw):
    """Test find_bad_by_ransac."""
    # For now, simply see if it runs
    # Need better data to test properly
    nd = Noisydata(raw)
    nd.find_all_bads(ransac=True)  # equivalent to nd.find_bad_by_ransac()
    bads = nd.bad_by_ransac
    assert (bads == []) or (len(bads) > 0)
Ejemplo n.º 2
0
def test_get_bads(raw=raw):
    """Find all bads and then get them."""
    # Make sure that in the example, none are bad per se.
    nd = Noisydata(raw)

    # Do not test ransac yet ... need better data to confirm
    nd.find_all_bads(ransac=False)
    bads = nd.get_bads(verbose=True)  # also test the printout
    assert bads == []
Ejemplo n.º 3
0
                       ch_types=["eeg"] * n_chans)

time = np.arange(0, 60, 1.0 / sfreq)  # 60 seconds of recording
X = np.random.random((n_chans, time.shape[0]))
raw = mne.io.RawArray(X, info)
print(raw)

###############################################################################
# Assign the mne object to the :class:`Noisydata` class. The resulting object
# will be the place where all following methods are performed.

nd = Noisydata(raw)

###############################################################################
# Find all bad channels and print a summary
nd.find_all_bads(ransac=False)
bads = nd.get_bads(verbose=True)

###############################################################################
# Now the bad channels are saved in `bads` and we can continue processing our
# `raw` object. For more information, we can access attributes of the ``nd``
# instance:

# Check the high frequency noise per channel
print(nd._channel_hf_noise)

# and so on ...

###############################################################################
# For finding bad epochs, it is recommended to highpass the data or apply
# baseline correction. Furthermore, bad channels should be identified and
 def get_bad_channels(self, rawData, sfreq=128, n_chans=14):
     nd = Noisydata(rawData)
     nd.find_all_bads(ransac=False)
     bads = nd.get_bads(verbose=False)
     return bads
Ejemplo n.º 5
0
 def get_bad_channels(self,rawData,sfreq = 128,n_chans = 14):
     nd = Noisydata(rawData)
     nd.find_all_bads(ransac=False)
     bads = nd.get_bads(verbose=False)
     return bads