Skip to content
Snippets Groups Projects
Commit 3e4b4fc1 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-984: add subband change test

parent 16d18364
No related branches found
No related tags found
1 merge request!440Resolve L2SS-984 "Fix beamlet subband tests"
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment