示例#1
0
 def test_check_imfs5(self):
     t = np.linspace(0, 1, 50)
     S = t + np.cos(np.cos(4. * t**2))
     emd = EMD()
     emd.emd(S, t)
     imfs, res = emd.get_imfs_and_residue()
     vis = Visualisation(emd)
     imfs2, res2 = vis._check_imfs(imfs, res, False)
     assert (imfs == imfs2).all()
     assert (res == res2).all()
示例#2
0
 def test_check_imfs4(self):
     vis = Visualisation()
     imfs = np.arange(50).reshape(2, 25)
     with self.assertRaises(AttributeError):
         vis._check_imfs(imfs, None, True)
示例#3
0
 def test_check_imfs2(self):
     vis = Visualisation()
     with self.assertRaises(AttributeError):
         vis._check_imfs(None, None, False)
示例#4
0
 def test_check_imfs3(self):
     vis = Visualisation()
     imfs = np.arange(50).reshape(2, 25)
     vis._check_imfs(imfs, None, False)
示例#5
0
 def test_check_imfs(self):
     vis = Visualisation()
     imfs = np.arange(50).reshape(2, 25)
     res = np.arange(25)
     imfs, res = vis._check_imfs(imfs, res, False)
     assert len(imfs) == 2