def test_apod_tm(self): spec = fromBruker(self.filename, False, False) # t1 < 1 results in dimension reduction of the apodization vector with self.assertRaises(NMRShapeError): apod(spec, w=lambda s: TM(s, 0.5, 10000)) spec = fromBruker(self.filename, False, False) spec = apod(spec, w=lambda s: TM(s, 5000, 10000)) C = converter() u = guess_udic(self.dic,self.data) C.from_bruker(self.dic, self.data, u) pipe_dic, pipe_data = C.to_pipe() test_data = pipep.tm(pipe_dic, pipe_data, t1=5000, t2=10000)[1] ts.assert_allclose(spec, test_data, 1e-7,1e-3, 'TM apodization not equal to NMRPipe processed one.')
#! /usr/bin/env python """ Create files for tm unit test """ # ignore RuntimeWarnings created by division by zero when appling apodization import warnings warnings.simplefilter('ignore', RuntimeWarning) import nmrglue.fileio.pipe as pipe import nmrglue.process.pipe_proc as p d, a = pipe.read("time_complex.fid") d, a = p.tm(d, a, t1=100, t2=200, c=1.0, inv=True) pipe.write("tm1.glue", d, a, overwrite=True) d, a = pipe.read("time_complex.fid") d, a = p.tm(d, a, t1=10, t2=1400, c=1.5, start=5, size=1490) pipe.write("tm2.glue", d, a, overwrite=True)