diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py index b5d7c9f85e4051e7bcd1f7bc5482166583fb1939..ff8bcebded8c8b1bbc18980f273a640f2e570328 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py @@ -11,6 +11,8 @@ from .base import AbstractTestBases from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy +from tango import DevState + import numpy import numpy.testing import time @@ -41,8 +43,6 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase): sdp_proxy = self.setup_sdp() self.proxy.initialise() - # TODO(Corne): Update test so effects of attribute are asserted L2SS-984 - # self.proxy.subband_select_RW = [0] * 488 self.proxy.on() # The subband frequency of HBA subband 0 is 200 MHz, @@ -58,6 +58,27 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase): expected_bf_weights = numpy.array([49152] * 192 * 488, dtype=numpy.uint32) numpy.testing.assert_almost_equal(expected_bf_weights, calculated_bf_weights) + + def test_subband_select_change(self): + # Setup configuration + sdp_proxy = self.setup_sdp() + + # Change subband + self.proxy.off() + self.proxy.initialise() + self.assertEqual(DevState.STANDBY, self.proxy.state()) + self.proxy.subband_select_RW = [10] * 488 + self.proxy.on() + self.assertEqual(DevState.ON, self.proxy.state()) + + # The subband frequency of HBA subband 10 is 201953125 Hz + # so its period is 4.95 ns ca, half period is 2.4758e-9 + delays = numpy.array([[2.4758e-9] * 192] * 488) + calculated_bf_weights_subband_10 = self.proxy.calculate_bf_weights(delays.flatten()) + + self.assertEqual(-2**14, c_short(49152).value) # check our calculations + expected_bf_weights_10 = numpy.array([49152] * 192 * 488, dtype=numpy.uint32) + numpy.testing.assert_almost_equal(expected_bf_weights_10, calculated_bf_weights_subband_10) def test_sdp_clock_change(self): # Setup configuration