Commit d5c2a589 authored by Antoine Laudrain's avatar Antoine Laudrain
Browse files

MSO helpers_wav: use float32 for time_points as well.

parent c6522542
Pipeline #140104 passed with stages
in 3 minutes and 59 seconds
......@@ -108,7 +108,7 @@ def get_time_points(npoints, xinc, xorigin):
@param[in] yinc: float, gain of scope (mV/ADC).
@param[in] yorigin: float, offset of y axis.
"""
return np.arange(npoints) * xinc + xorigin
return np.arange(npoints, dtype=np.float32) * xinc + xorigin
def process_waveform(waveform, yinc, yorigin, bytes_per_point):
......
......@@ -57,6 +57,13 @@ class TestGetTimePoints(ut.TestCase):
expected = np.array([-45, -35, -25, -15, -5, 5, 15, 25, 35, 45])
np.testing.assert_equal(get_time_points(10, xinc=10, xorigin=-45), expected)
def test_dtype(self):
"""Time points array should be float32."""
result = get_time_points(10,
xinc=float("2.00000000E-10"),
xorigin=float("-4.00192886930E-07"))
self.assertIs(result.dtype, np.dtype(np.float32))
class TestProcessWaveform(ut.TestCase):
"""Test cases for process_waveform."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment