Esempio n. 1
0
 def test_zero(self):
     """Test discrete sampled constant pulse."""
     duration = 10
     times = np.arange(0, duration) + 0.5
     zero_ref = continuous.zero(times)
     zero_pulse = library.zero(duration)
     self.assertIsInstance(zero_pulse, Waveform)
     np.testing.assert_array_almost_equal(zero_pulse.samples, zero_ref)
Esempio n. 2
0
    def test_zero(self):
        """Test constant pulse."""
        times = np.linspace(0, 10, 50)
        zero_arr = continuous.zero(times)

        self.assertEqual(zero_arr.dtype, np.complex_)
        np.testing.assert_equal(zero_arr, 0.0)
        self.assertEqual(len(zero_arr), 50)