示例#1
0
 def test_rereference_cnt(self):
     """Rereference channels (cnt)."""
     cnt_r = rereference(self.cnt, 'chan0')
     dat_r = np.linspace(SAMPLES / 2, -SAMPLES / 2, SAMPLES, endpoint=False)
     dat_r = [dat_r for i in range(CHANS)]
     dat_r = np.array(dat_r).T
     dat_r[:, 0] = 0
     np.testing.assert_array_equal(cnt_r.data, dat_r)
示例#2
0
 def test_rereference_cnt(self):
     """Rereference channels (cnt)."""
     cnt_r = rereference(self.cnt, 'chan0')
     dat_r = np.linspace(SAMPLES/2, -SAMPLES/2, SAMPLES, endpoint=False)
     dat_r = [dat_r for i in range(CHANS)]
     dat_r = np.array(dat_r).T
     dat_r[:, 0] = 0
     np.testing.assert_array_equal(cnt_r.data, dat_r)
示例#3
0
 def test_rereference_epo(self):
     """Rereference channels (epo)."""
     epo_r = rereference(self.epo, 'chan0')
     dat_r = np.linspace(SAMPLES/2, -SAMPLES/2, SAMPLES, endpoint=False)
     dat_r = [dat_r for i in range(CHANS)]
     dat_r = np.array(dat_r).T
     dat_r[:, 0] = 0
     dat_r = np.array([dat_r for i in range(EPOS)])
     np.testing.assert_array_equal(epo_r.data, dat_r)
示例#4
0
 def test_rereference_epo(self):
     """Rereference channels (epo)."""
     epo_r = rereference(self.epo, 'chan0')
     dat_r = np.linspace(SAMPLES / 2, -SAMPLES / 2, SAMPLES, endpoint=False)
     dat_r = [dat_r for i in range(CHANS)]
     dat_r = np.array(dat_r).T
     dat_r[:, 0] = 0
     dat_r = np.array([dat_r for i in range(EPOS)])
     np.testing.assert_array_equal(epo_r.data, dat_r)
示例#5
0
 def test_rereference_swapaxes(self):
     """rereference must work with nonstandard chanaxis."""
     dat = rereference(swapaxes(self.epo, 1, 2), 'chan0', chanaxis=1)
     dat = swapaxes(dat, 1, 2)
     dat2 = rereference(self.epo, 'chan0')
     self.assertEqual(dat, dat2)
示例#6
0
 def test_rereference_copy(self):
     """rereference must not modify arguments."""
     cpy = self.cnt.copy()
     rereference(self.cnt, 'chan0')
     self.assertEqual(self.cnt, cpy)
示例#7
0
 def test_case_insensitivity(self):
     """rereference should not care about case."""
     try:
         rereference(self.cnt, 'ChAN0')
     except ValueError:
         self.fail()
示例#8
0
 def test_raise_value_error(self):
     """Raise ValueError if channel not found."""
     with self.assertRaises(ValueError):
         rereference(self.cnt, 'foo')
示例#9
0
 def test_rereference_swapaxes(self):
     """rereference must work with nonstandard chanaxis."""
     dat = rereference(swapaxes(self.epo, 1, 2), 'chan0', chanaxis=1)
     dat = swapaxes(dat, 1, 2)
     dat2 = rereference(self.epo, 'chan0')
     self.assertEqual(dat, dat2)
示例#10
0
 def test_rereference_copy(self):
     """rereference must not modify arguments."""
     cpy = self.cnt.copy()
     rereference(self.cnt, 'chan0')
     self.assertEqual(self.cnt, cpy)
示例#11
0
 def test_case_insensitivity(self):
     """rereference should not care about case."""
     try:
         rereference(self.cnt, 'ChAN0')
     except ValueError:
         self.fail()
示例#12
0
 def test_raise_value_error(self):
     """Raise ValueError if channel not found."""
     with self.assertRaises(ValueError):
         rereference(self.cnt, 'foo')