def test_subtract_evoked():
 (raw, events, picks) = _get_data()
 epochs = Epochs(raw, events[:10], event_id, tmin, tmax, picks=picks)
 assert_raises(ValueError, epochs.subtract_evoked, epochs.average(picks[:5]))
 epochs.subtract_evoked()
 epochs.apply_proj()
 epochs2 = Epochs(raw, events[:10], event_id, tmin, tmax, picks=picks, preload=True)
 evoked = epochs2.average()
 epochs2.subtract_evoked(evoked)
 assert_allclose(epochs.get_data(), epochs2.get_data())
 zero_evoked = epochs.average()
 data = zero_evoked.data
 assert_allclose(data, np.zeros_like(data), atol=1e-15)

def test_subtract_evoked ( ) : ( raw , events , picks ) = _get_data ( ) epochs = Epochs ( raw , events [ : 10 ] , event_id , tmin , tmax , picks = picks ) assert_raises ( ValueError , epochs . subtract_evoked , epochs . average ( picks [ : 5 ] ) ) epochs . subtract_evoked ( ) epochs . apply_proj ( ) epochs2 = Epochs ( raw , events [ : 10 ] , event_id , tmin , tmax , picks = picks , preload = True ) evoked = epochs2 . average ( ) epochs2 . subtract_evoked ( evoked ) assert_allclose ( epochs . get_data ( ) , epochs2 . get_data ( ) ) zero_evoked = epochs . average ( ) data = zero_evoked . data assert_allclose ( data , np . zeros_like ( data ) , atol = 1e-15 )
test subtraction of evoked from epochs .