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

L2SS-613: Cache positions and calculators. Might as well directly calculate...

L2SS-613: Cache positions and calculators. Might as well directly calculate what we need in the INIT phase
parent b67a4678
No related branches found
No related tags found
1 merge request!236L2SS-613 L2SS-614: Expose HBAT properties using attributes instead of commands...
...@@ -66,8 +66,14 @@ class Beam(lofar_device): ...@@ -66,8 +66,14 @@ class Beam(lofar_device):
self.recv_proxy = DeviceProxy("STAT/RECV/1") self.recv_proxy = DeviceProxy("STAT/RECV/1")
# Retrieve positions from RECV device # Retrieve positions from RECV device
self.HBAT_reference_itrf = self.recv_proxy.HBAT_reference_itrf_R HBAT_reference_itrf = self.recv_proxy.HBAT_reference_itrf_R
self.HBAT_antenna_itrf_offsets = self.recv_proxy.HBAT_antenna_itrf_offsets_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 # internal functions
...@@ -83,11 +89,11 @@ class Beam(lofar_device): ...@@ -83,11 +89,11 @@ class Beam(lofar_device):
for tile in range(96): for tile in range(96):
# initialise delay calculator # initialise delay calculator
d = delay_calculator(self.HBAT_reference_itrf[tile]) d = self.HBAT_delay_calculators[tile]
d.set_measure_time(timestamp) 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 # 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 return delays
......
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