#NEWLINE# def test_evoked_resample( ) : #NEWLINE# #INDENT# 'Test for resampling of evoked data\n    ' #NEWLINE# tempdir = _TempDir ( ) #NEWLINE# ave = read_evokeds ( fname , 0 ) #NEWLINE# sfreq_normal = ave . info [ 'sfreq' ] #NEWLINE# ave . resample ( ( 2 * sfreq_normal ) , npad = 100 ) #NEWLINE# write_evokeds ( op . join ( tempdir , 'evoked-ave.fif' ) , ave ) #NEWLINE# ave_up = read_evokeds ( op . join ( tempdir , 'evoked-ave.fif' ) , 0 ) #NEWLINE# ave_normal = read_evokeds ( fname , 0 ) #NEWLINE# ave_new = read_evokeds ( op . join ( tempdir , 'evoked-ave.fif' ) , 0 ) #NEWLINE# ave_new . resample ( sfreq_normal , npad = 100 ) #NEWLINE# assert_array_almost_equal ( ave_normal . data , ave_new . data , 2 ) #NEWLINE# assert_array_almost_equal ( ave_normal . times , ave_new . times ) #NEWLINE# assert_equal ( ave_normal . nave , ave_new . nave ) #NEWLINE# assert_equal ( ave_normal . _aspect_kind , ave_new . _aspect_kind ) #NEWLINE# assert_equal ( ave_normal . kind , ave_new . kind ) #NEWLINE# assert_equal ( ave_normal . last , ave_new . last ) #NEWLINE# assert_equal ( ave_normal . first , ave_new . first ) #NEWLINE# assert_true ( ( len ( ave . times ) == ( 2 * len ( ave_normal . times ) ) ) ) #NEWLINE# assert_true ( ( ave_up . data . shape [ 1 ] == ( 2 * ave_normal . data . shape [ 1 ] ) ) )