def test_equivalent_data_to_copy(self):
"""Test that the data coming out of this pipeline is equivalent
the initial read data"""
self.logfile = '.log.txt'
self.blocks = []
self.blocks.append((
SigprocReadBlock(
'./data/1chan8bitNoDM.fil'),
[], [0]))
self.blocks.append((FFTBlock(gulp_size=4096 * 8 * 8 * 8 * 8), [0], [1]))
self.blocks.append((IFFTBlock(gulp_size=4096 * 8 * 8 * 8 * 8), [1], [2]))
self.blocks.append((WriteAsciiBlock(self.logfile), [2], []))
open(self.logfile, 'w').close()
Pipeline(self.blocks).main()
unfft_result = np.loadtxt(self.logfile).astype(np.float32).view(np.complex64)
self.blocks[1] = (CopyBlock(), [0], [1])
self.blocks[2] = (WriteAsciiBlock(self.logfile), [1], [])
del self.blocks[3]
open(self.logfile, 'w').close()
Pipeline(self.blocks).main()
untouched_result = np.loadtxt(self.logfile).astype(np.float32)
np.testing.assert_almost_equal(unfft_result, untouched_result, 2)
评论列表
文章目录