@testing.requires_testing_data
def test_lcmv_source_power():
 (raw, epochs, evoked, data_cov, noise_cov, label, forward, forward_surf_ori, forward_fixed, forward_vol) = _get_data()
 stc_source_power = _lcmv_source_power(epochs.info, forward, noise_cov, data_cov, label=label)
 max_source_idx = np.argmax(stc_source_power.data)
 max_source_power = np.max(stc_source_power.data)
 assert_true((max_source_idx == 0), max_source_idx)
 assert_true((0.4 < max_source_power < 2.4), max_source_power)
 stc_normal = _lcmv_source_power(epochs.info, forward_surf_ori, noise_cov, data_cov, pick_ori='normal', label=label)
 assert_true((np.abs(stc_normal.data[:, 0]) <= stc_source_power.data[:, 0]).all())
 assert_raises(ValueError, _lcmv_source_power, raw.info, forward_fixed, noise_cov, data_cov, pick_ori='normal')
 assert_raises(ValueError, _lcmv_source_power, raw.info, forward, noise_cov, data_cov, pick_ori='normal')
 assert_raises(ValueError, _lcmv_source_power, epochs.info, forward_vol, noise_cov, data_cov, pick_ori='normal')

@ testing . requires_testing_data def test_lcmv_source_power ( ) : ( raw , epochs , evoked , data_cov , noise_cov , label , forward , forward_surf_ori , forward_fixed , forward_vol ) = _get_data ( ) stc_source_power = _lcmv_source_power ( epochs . info , forward , noise_cov , data_cov , label = label ) max_source_idx = np . argmax ( stc_source_power . data ) max_source_power = np . max ( stc_source_power . data ) assert_true ( ( max_source_idx == 0 ) , max_source_idx ) assert_true ( ( 0.4 < max_source_power < 2.4 ) , max_source_power ) stc_normal = _lcmv_source_power ( epochs . info , forward_surf_ori , noise_cov , data_cov , pick_ori = 'normal' , label = label ) assert_true ( ( np . abs ( stc_normal . data [ : , 0 ] ) <= stc_source_power . data [ : , 0 ] ) . all ( ) ) assert_raises ( ValueError , _lcmv_source_power , raw . info , forward_fixed , noise_cov , data_cov , pick_ori = 'normal' ) assert_raises ( ValueError , _lcmv_source_power , raw . info , forward , noise_cov , data_cov , pick_ori = 'normal' ) assert_raises ( ValueError , _lcmv_source_power , epochs . info , forward_vol , noise_cov , data_cov , pick_ori = 'normal' )
test lcmv source power computation .