MCPcopy
hub / github.com/mne-tools/mne-python / _make_rand_csd

Function _make_rand_csd

mne/beamformer/tests/test_dics.py:143–154  ·  view source on GitHub ↗
(info, csd)

Source from the content-addressed store, hash-verified

141
142
143def _make_rand_csd(info, csd):
144 rng = np.random.RandomState(0)
145 data = _rand_csd(rng, info)
146 # now we need to have the same null space as the data csd
147 s, u = np.linalg.eigh(csd.get_data(csd.frequencies[0]))
148 mask = np.abs(s) >= s[-1] * 1e-7
149 rank = mask.sum()
150 assert rank == len(data) == len(info["ch_names"])
151 noise_csd = CrossSpectralDensity(
152 _sym_mat_to_vector(data), info["ch_names"], 0.0, csd.n_fft
153 )
154 return noise_csd, rank
155
156
157@pytest.mark.slowtest

Callers 2

test_make_dicsFunction · 0.85
test_make_dics_rankFunction · 0.85

Calls 5

_sym_mat_to_vectorFunction · 0.90
_rand_csdFunction · 0.85
get_dataMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected