Skip to content
Snippets Groups Projects
Commit b87c2d11 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-480: Made calculate_HBAT_bf_delays static to avoid needing to expose it...

L2SS-480: Made calculate_HBAT_bf_delays static to avoid needing to expose it as a command. The function does not depend on the actual device.
parent 634e66c8
No related branches found
No related tags found
1 merge request!220Resolve L2SS-480 "Delays to beam weights"
......@@ -98,7 +98,8 @@ class Beam(lofar_device):
return delays
def _calculate_HBAT_bf_delays(self, delays: numpy.ndarray):
@staticmethod
def _calculate_HBAT_bf_delays(delays: numpy.ndarray):
"""
Helper function that converts a signal path delay (in seconds) to an analog beam weight,
which is a value per tile per dipole per polarisation.
......@@ -181,22 +182,6 @@ class Beam(lofar_device):
return delays.flatten()
@command(dtype_in=DevVarFloatArray, dtype_out=DevVarLong64Array)
@DebugIt()
@log_exceptions()
@only_in_states([DevState.ON])
def calculate_HBAT_bf_delays(self, delays: numpy.ndarray):
"""
Helper function that converts a signal path delay (in seconds) to an analog beam weight,
which is a value per tile per dipole per polarisation.
"""
delays = delays.reshape(96,16)
result = self._calculate_HBAT_bf_delays(delays)
return result.flatten()
@command(dtype_in=DevVarStringArray)
@DebugIt()
@only_in_states([DevState.ON])
......
......@@ -78,5 +78,5 @@ class TestBeamDevice(base.TestCase):
# verify if values are actually transformed
HBAT_delays = proxy.HBAT_delays(numpy.array([["J2000","0deg","0deg"]] * 96).flatten())
HBAT_bf_delays = proxy.calculate_HBAT_bf_delays(HBAT_delays)
HBAT_bf_delays = beam.Beam._calculate_HBAT_bf_delays(HBAT_delays)
self.assertNotEqual(HBAT_delays, HBAT_bf_delays)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment