def test_unity_with_fft(self): ''' This tests the not only that apodization of no arguments has no effect on the spectrum, but also it makes sure the 'no_transpose' flag is correctly set and reset. ''' spec2d = fromPipe(self.filename) apoded_2d = apod(spec2d) apoded_ffted_2d = fft1d(apoded_2d) spec2d = fromPipe(self.filename) ffted_2d = fft1d(apoded_2d) ts.assert_equal(ffted_2d, apoded_ffted_2d, '2D Apodization unity with FFT failed')
def test_apod_with_fft(self): spec = fromBruker(self.filename, False, False) spec = fft1d(spec, 'fft') spec = apod(spec, w=lambda s: EM(s, 0.)) test_data = ngp.fft( ngp.em(self.data) ) ts.assert_array_equal(spec, test_data, 'Apodization with zero filling and FFT failed.') self.assertEqual("apodization" in spec.history._stepnames, True, 'Apodization not added to Spec history') self.assertEqual(spec.history._stepnames, ['apodization', 'FFT'], 'Spec history not in the correct order (See fapplyBefore)')
def test_zf_with_fft(self): spec = fromBruker(self.filename, False, False) spec = fft1d(spec, 'fft') spec = zf1d(spec, size = 2**15) test_data = fft(zf_size(self.data, 2**15)) self.assertEqual(spec.shape[-1], 2**15, 'Spec size is not correct') self.assertEqual("ZF" in spec.history._stepnames, True, 'ZF not added to Spec history') self.assertEqual(spec.history._stepnames, ['ZF','FFT'], 'Spec history not in the correct order (See fapplyBefore)') ts.assert_array_equal(spec, test_data, 'Simple Zero filling falied (see zf_size)') self.assertEqual(spec.udic[0]['size'], 2**15, 'udic size not set correctly')