def test_many_channels(self): """See if many channels work with folding""" self.blocks[0] = ( SigprocReadBlock('./data/simple_pulsar_DM0_128ch.fil'), [], [0]) self.blocks.append((FoldBlock(bins=200), [0], [1])) histogram = self.dump_ring_and_read() self.assertTrue(np.min(histogram) > 1e-10) self.assertGreater(np.max(histogram) / np.min(histogram), 3)
def test_simple_pulsar(self): """Test whether a pulsar histogram shows a large peak and is mostly nonzero values""" self.blocks.append((FoldBlock(bins=100), [0], [1])) histogram = self.dump_ring_and_read() self.assertEqual(histogram.size, 100) self.assertTrue(np.min(histogram) > 1e-10)
def test_high_dispersion(self): """Test folding on a file with high DM""" self.blocks[0] = ( SigprocReadBlock('./data/simple_pulsar_DM10_128ch.fil'), [], [0]) self.blocks.append((FoldBlock(bins=200, dispersion_measure=10, core=0), [0], [1])) histogram = self.dump_ring_and_read() self.assertTrue(np.min(histogram) > 1e-10) self.assertGreater(np.max(histogram) / np.min(histogram), 3)
def test_show_pulse(self): """Test to see if a pulse is visible in the histogram from pulsar data""" self.blocks[0] = (SigprocReadBlock('./data/simple_pulsar_DM0.fil'), [], [0]) self.blocks.append((FoldBlock(bins=200), [0], [1])) histogram = self.dump_ring_and_read() self.assertTrue(np.min(histogram) > 1e-10) self.assertGreater(np.max(histogram) / np.average(histogram), 5)
def test_different_bin_size(self): """Try a different bin size""" self.blocks.append(( FoldBlock(bins=50), [0], [1])) histogram = self.dump_ring_and_read() self.assertEqual(histogram.size, 50)