@testing.requires_testing_data
def test_source_psd():
 raw = read_raw_fif(fname_data)
 inverse_operator = read_inverse_operator(fname_inv)
 label = read_label(fname_label)
 (tmin, tmax) = (0, 20)
 (fmin, fmax) = (55, 65)
 n_fft = 2048
 stc = compute_source_psd(raw, inverse_operator, lambda2=(1.0 / 9.0), method='dSPM', tmin=tmin, tmax=tmax, fmin=fmin, fmax=fmax, pick_ori='normal', n_fft=n_fft, label=label, overlap=0.1)
 assert_true((stc.times[0] >= (fmin * 0.001)))
 assert_true((stc.times[(-1)] <= (fmax * 0.001)))
 assert_true((0.059 <= stc.times[np.argmax(np.sum(stc.data, axis=0))] <= 0.061))

@ testing . requires_testing_data def test_source_psd ( ) : raw = read_raw_fif ( fname_data ) inverse_operator = read_inverse_operator ( fname_inv ) label = read_label ( fname_label ) ( tmin , tmax ) = ( 0 , 20 ) ( fmin , fmax ) = ( 55 , 65 ) n_fft = 2048 stc = compute_source_psd ( raw , inverse_operator , lambda2 = ( 1.0 / 9.0 ) , method = 'dSPM' , tmin = tmin , tmax = tmax , fmin = fmin , fmax = fmax , pick_ori = 'normal' , n_fft = n_fft , label = label , overlap = 0.1 ) assert_true ( ( stc . times [ 0 ] >= ( fmin * 0.001 ) ) ) assert_true ( ( stc . times [ ( - 1 ) ] <= ( fmax * 0.001 ) ) ) assert_true ( ( 0.059 <= stc . times [ np . argmax ( np . sum ( stc . data , axis = 0 ) ) ] <= 0.061 ) )
test source psd computation in label .