diff --git a/tangostationcontrol/tangostationcontrol/devices/beam.py b/tangostationcontrol/tangostationcontrol/devices/beam.py index 6114e3823be7f09413d667f3b642073f5f4b42e1..1ca5631b4d5d7e65981512fada14a3e398ec6556 100644 --- a/tangostationcontrol/tangostationcontrol/devices/beam.py +++ b/tangostationcontrol/tangostationcontrol/devices/beam.py @@ -66,8 +66,14 @@ class Beam(lofar_device): self.recv_proxy = DeviceProxy("STAT/RECV/1") # Retrieve positions from RECV device - self.HBAT_reference_itrf = self.recv_proxy.HBAT_reference_itrf_R - self.HBAT_antenna_itrf_offsets = self.recv_proxy.HBAT_antenna_itrf_offsets_R + HBAT_reference_itrf = self.recv_proxy.HBAT_reference_itrf_R + HBAT_antenna_itrf_offsets = self.recv_proxy.HBAT_antenna_itrf_offsets_R + + # a delay calculator for each tile + self.HBAT_delay_calculators = [delay_calculator(reference_itrf) for reference_itrf in HBAT_reference_itrf] + + # absolute positions of each antenna element + self.HBAT_antenna_positions = [reference_itrf + HBAT_antenna_itrf_offsets for reference_itrf in HBAT_reference_itrf] # -------- # internal functions @@ -83,11 +89,11 @@ class Beam(lofar_device): for tile in range(96): # initialise delay calculator - d = delay_calculator(self.HBAT_reference_itrf[tile]) + d = self.HBAT_delay_calculators[tile] d.set_measure_time(timestamp) # calculate the delays based on the set reference position, the set time and now the set direction and antenna positions - delays[tile] = d.convert(pointing_direction[tile], self.HBAT_antenna_itrf_offsets + self.HBAT_reference_itrf[tile]) + delays[tile] = d.convert(pointing_direction[tile], self.HBAT_antenna_positions[tile]) return delays