Beispiel #1
0
 def test_zf_object_overwrite(self):
     spec = fromBruker(self.filename, False, False)
     zf1d(spec, size = 2**15)
     
     ts.assert_array_equal(spec, zf_size(self.data, 2**15), 'Simple Zero filling falied (see zf_size)')
     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.udic[0]['size'], 2**15, 'udic size not set correctly')
Beispiel #2
0
    def test_apod_with_zf_fft(self):
        spec = fromBruker(self.filename, False, False)
        spec = fft1d(spec, 'fft')
        spec = zf1d(spec, size=2**15)
        spec = apod(spec, w=lambda s: EM(s, 0.))

        test_data = ngp.fft(ngp.zf_size( ngp.em(self.data) , 2**15))
        self.assertEqual(spec.shape[-1], 2**15, 'Spec size is not correct')
        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','ZF','FFT'], 'Spec history not in the correct order (See fapplyBefore)')
Beispiel #3
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')