From 896ed85a9ecfd3c00dbbfdf255706b8ec28effa4 Mon Sep 17 00:00:00 2001 From: Jiao Lin Date: Sun, 6 Aug 2017 06:50:29 -0400 Subject: [PATCH] Refs #39. added a testcase for sqe2dos --- tests/backward/sqe2dos_TestCase.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/backward/sqe2dos_TestCase.py b/tests/backward/sqe2dos_TestCase.py index 8965093..0a2568c 100755 --- a/tests/backward/sqe2dos_TestCase.py +++ b/tests/backward/sqe2dos_TestCase.py @@ -92,6 +92,24 @@ def test2a(self): return + def test2a2(self): + iqehist = hh.load(os.path.join(datadir, "V-iqe.h5")) + from multiphonon.sqe import interp + newiqe = interp(iqehist, newE = np.arange(-15.5, 80, 1.)) + iterdos = sqe2dos.sqe2dos( + newiqe, T=300, Ecutoff=55., elastic_E_cutoff=(-12., 6.7), M=50.94, + C_ms=.2, Ei=120., workdir='work-V') + from multiphonon.backward.singlephonon_sqe2dos import EnergyAxisMissingBinCenterAtZero + with self.assertRaises(EnergyAxisMissingBinCenterAtZero): + for i, dos in enumerate(iterdos): + # print dos + # plot + if interactive: + # print '*' * 70 + pylab.plot(dos.E, dos.I, label='%d' % i) + return + + def test2b(self): iqehist = hh.load(os.path.join(datadir, "Al-iqe.h5")) from multiphonon.sqe import interp