def test_evoked_detrend():
 ave = read_evokeds(fname, 0)
 ave_normal = read_evokeds(fname, 0)
 ave.detrend(0)
 ave_normal.data -= np.mean(ave_normal.data, axis=1)[:, np.newaxis]
 picks = pick_types(ave.info, meg=True, eeg=True, exclude='bads')
 assert_true(np.allclose(ave.data[picks], ave_normal.data[picks], rtol=1e-08, atol=1e-16))

def test_evoked_detrend ( ) : ave = read_evokeds ( fname , 0 ) ave_normal = read_evokeds ( fname , 0 ) ave . detrend ( 0 ) ave_normal . data -= np . mean ( ave_normal . data , axis = 1 ) [ : , np . newaxis ] picks = pick_types ( ave . info , meg = True , eeg = True , exclude = 'bads' ) assert_true ( np . allclose ( ave . data [ picks ] , ave_normal . data [ picks ] , rtol = 1e-08 , atol = 1e-16 ) )
test for detrending evoked data .