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