Public Access
create base class MeasurementData for ADC_Result and Accumulation
This commit is contained in:
1 parent
5a18e48c2d
commit
bd060dc4d0
6 files changed
+184
-47
No files matched your search
@@ -30,6 +30,21 @@ class TestADCResult(unittest.TestCase):
|
||||
self.assertEqual(len(adc.x), 0)
|
||||
self.assertEqual(len(adc.y), 0)
|
||||
|
||||
def test_shared_measurement_statistics(self):
|
||||
adc = self.create_adc_result()
|
||||
np.testing.assert_allclose(adc.get_ymean(), [20, 25])
|
||||
np.testing.assert_allclose(adc.get_ymin_channels(), [10, 15])
|
||||
np.testing.assert_allclose(adc.get_ymax_channels(), [30, 35])
|
||||
np.testing.assert_allclose(adc.get_yrms(),
|
||||
[np.sqrt(np.mean(np.array([10, 20, 30]) ** 2)),
|
||||
np.sqrt(np.mean(np.array([15, 25, 35]) ** 2))])
|
||||
np.testing.assert_allclose(adc.get_ystd(), [np.std([10, 20, 30]),
|
||||
np.std([15, 25, 35])])
|
||||
|
||||
def test_shared_phase_uses_public_channel_values(self):
|
||||
adc = self.create_adc_result()
|
||||
self.assertAlmostEqual(adc.get_phase(), np.degrees(np.arctan2(15, 10)))
|
||||
|
||||
def test_constructor_with_arguments(self):
|
||||
"""Test initializer with all arguments."""
|
||||
x = np.array([0.0, 1.0, 2.0])
|
||||
|
||||
Reference in new issue
Block a user