Beispiel #1
0
 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)')
Beispiel #2
0
 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')        
Beispiel #3
0
 def freq_domain(self):
     if self.udic[0]['freq']:
         return self
     else:
         return fft(self)