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

Calibrate all antenna fields explicitly when turning Calibration device ON

parent d8e34384
No related branches found
No related tags found
1 merge request!702Fixes after rollout 2023-08-08
......@@ -170,23 +170,22 @@ class Calibration(LOFARDevice):
device = device.casefold()
if device not in self.ant_proxies:
logger.error("Could not find %s", device)
return
raise ValueError(f"Could not find {device} in {self.ant_proxies}")
ant_proxy = self.ant_proxies[device]
sdpfirmware_device = str(ant_proxy.SDPFirmware_device_R).casefold()
if sdpfirmware_device not in self.sdpfirmware_proxies:
logger.error("Could not find %s", sdpfirmware_device)
return
raise ValueError(
f"Could not find {sdpfirmware_device} in {self.sdpfirmware_proxies}"
)
sdpfirmware_proxy = self.sdpfirmware_proxies[sdpfirmware_device]
sdp_device = str(sdpfirmware_proxy.SDP_device_R).casefold()
if sdp_device not in self.sdp_proxies:
logger.error("Could not find %s", sdp_device)
return
raise ValueError(f"Could not find {sdp_device} in {self.sdp_proxies}")
sdp_proxy = self.sdp_proxies[sdp_device]
......@@ -194,6 +193,18 @@ class Calibration(LOFARDevice):
self._calibration_manager.calibrate_subband_weights(ant_proxy, sdp_proxy)
@command()
@only_in_states(DEFAULT_COMMAND_STATES)
def calibrate_all(self):
for k in self.ant_proxies.keys():
logger.info("Re-calibrate antenna field %s", k)
try:
self.calibrate_sdp(k)
self.calibrate_recv(k)
except Exception as exc:
logger.exception("Could not calibrate antenna field %s", k)
# --------
# Overloaded functions
# --------
......@@ -250,6 +261,13 @@ class Calibration(LOFARDevice):
)
)
def configure_for_on(self):
# Calibrate all antennafields, as we did not receive
# any events yet.
self.calibrate_all()
super().configure_for_on()
def configure_for_off(self):
super().configure_for_off()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment