Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #7
0
 def test_case_insensitivity(self):
     """rereference should not care about case."""
     try:
         rereference(self.cnt, 'ChAN0')
     except ValueError:
         self.fail()
Example #8
0
 def test_raise_value_error(self):
     """Raise ValueError if channel not found."""
     with self.assertRaises(ValueError):
         rereference(self.cnt, 'foo')
Example #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)
Example #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)
Example #11
0
 def test_case_insensitivity(self):
     """rereference should not care about case."""
     try:
         rereference(self.cnt, 'ChAN0')
     except ValueError:
         self.fail()
Example #12
0
 def test_raise_value_error(self):
     """Raise ValueError if channel not found."""
     with self.assertRaises(ValueError):
         rereference(self.cnt, 'foo')